From b2cbb9988604c76e210a018e1796fa315c9c770e Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Mon, 17 Aug 2026 20:40:34 +0000 Subject: [PATCH 01/21] chore: add librarian.yaml --- librarian.yaml | 1755 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1755 insertions(+) create mode 100644 librarian.yaml diff --git a/librarian.yaml b/librarian.yaml new file mode 100644 index 00000000000..292cf179d6c --- /dev/null +++ b/librarian.yaml @@ -0,0 +1,1755 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +language: php +sources: + googleapis: + commit: 6145fa8cc2b137bf4c0ed114e2e39c1157ea9722 + sha256: 489923d12c766c9e323b42de057037977b03f20c8a874bc8553d29f9dd3f0e3b +tools: + composer: + - name: google-cloud-php/dev + version: "" + local_path: dev + - name: google/gapic-generator-php + version: v1.25.0 + repo: github.com/googleapis/gapic-generator-php + sha256: fff773dd9f87b3f6cdd8807a330d820e1572f20a739e53c1efce8215210a2f47 + entrypoint: src/Main.php + - name: php-post-processor + version: v1.25.0 + repo: github.com/googleapis/gapic-generator-php + sha256: fff773dd9f87b3f6cdd8807a330d820e1572f20a739e53c1efce8215210a2f47 + entrypoint: src/PostProcessor/Main.php + pip: + - name: synthtool + version: e643ce8e20f8fe237a31a1754524ba987de72875 + package: gcp-synthtool@git+https://github.com/googleapis/synthtool@e643ce8e20f8fe237a31a1754524ba987de72875 + pnpm: + - name: '@prettier/plugin-php' + version: 0.19.2 + - name: prettier + version: 2.8.8 + protoc: + version: "33.2" + sha256: b24b53f87c151bfd48b112fe4c3a6e6574e5198874f38036aff41df3456b8caf +default: + php: + common_resources: true +libraries: + - name: accessapproval + version: 2.2.0 + apis: + - path: google/cloud/accessapproval/v1 + output: AccessApproval + - name: ads-admanager + version: 0.10.0 + apis: + - path: google/ads/admanager/v1 + output: AdsAdManager + - name: ads-datamanager + version: 0.8.0 + apis: + - path: google/ads/datamanager/v1 + output: AdsDataManager + - name: advisorynotifications + version: 1.3.0 + apis: + - path: google/cloud/advisorynotifications/v1 + php: + common_resources: false + output: AdvisoryNotifications + - name: aiplatform + version: 1.64.0 + apis: + - path: google/cloud/aiplatform/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: AiPlatform + php: + component_name: AiPlatform + - name: alloydb + version: 1.8.0 + apis: + - path: google/cloud/alloydb/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: AlloyDb + - name: analytics-admin + version: 0.34.0 + apis: + - path: google/analytics/admin/v1beta + - path: google/analytics/admin/v1alpha + output: AnalyticsAdmin + - name: analytics-data + version: 0.25.0 + apis: + - path: google/analytics/data/v1beta + - path: google/analytics/data/v1alpha + output: AnalyticsData + - name: api + version: 4.14.1 + apis: + - path: google/iam/v1 + php: + common_resources: false + staging_subdir: iam + - path: google/api + php: + common_resources: false + - path: google/cloud + php: + common_resources: false + staging_subdir: extendedoperations + - path: google/rpc + php: + common_resources: false + - path: google/type + php: + common_resources: false + - path: google/cloud/location + - path: google/logging/type + php: + common_resources: false + staging_subdir: logging + - path: google/iam/v1/logging + php: + common_resources: false + staging_subdir: iamlogging + output: CommonProtos + php: + component_name: CommonProtos + - name: api-apikeys + version: 1.2.0 + apis: + - path: google/api/apikeys/v2 + output: ApiKeys + - name: api-cloudquotas + version: 1.7.0 + apis: + - path: google/api/cloudquotas/v1 + php: + common_resources: false + - path: google/api/cloudquotas/v1beta + php: + common_resources: false + output: Quotas + php: + component_name: Quotas + - name: api-servicecontrol + version: 2.3.1 + apis: + - path: google/api/servicecontrol/v1 + output: ServiceControl + - name: api-servicemanagement + version: 2.2.2 + apis: + - path: google/api/servicemanagement/v1 + php: + additional_protos: + - google/iam/v1/iam_policy.proto + output: ServiceManagement + - name: api-serviceusage + version: 2.2.1 + apis: + - path: google/api/serviceusage/v1 + output: ServiceUsage + - name: apigateway + version: 2.2.0 + apis: + - path: google/cloud/apigateway/v1 + output: ApiGateway + - name: apigeeconnect + version: 2.2.0 + apis: + - path: google/cloud/apigeeconnect/v1 + output: ApigeeConnect + - name: apihub + version: 0.5.0 + apis: + - path: google/cloud/apihub/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: ApiHub + - name: apiregistry + version: 0.2.0 + apis: + - path: google/cloud/apiregistry/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - path: google/cloud/apiregistry/v1beta + php: + additional_protos: + - google/cloud/location/locations.proto + output: ApiRegistry + - name: appengine + version: 2.2.0 + apis: + - path: google/appengine/v1 + output: AppEngineAdmin + php: + component_name: AppEngineAdmin + - name: apphub + version: 0.5.0 + apis: + - path: google/cloud/apphub/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: AppHub + - name: appoptimize + version: 0.2.0 + apis: + - path: google/cloud/appoptimize/v1beta + php: + additional_protos: + - google/cloud/location/locations.proto + output: AppOptimize + - name: apps-events-subscriptions + version: 0.5.0 + apis: + - path: google/apps/events/subscriptions/v1 + - path: google/apps/events/subscriptions/v1beta + output: AppsEventsSubscriptions + - name: apps-meet + version: 0.6.0 + apis: + - path: google/apps/meet/v2 + - path: google/apps/meet/v2beta + output: AppsMeet + - name: asset + version: 2.4.0 + apis: + - path: google/cloud/asset/v1 + output: Asset + - name: assuredworkloads + version: 1.2.0 + apis: + - path: google/cloud/assuredworkloads/v1 + - path: google/cloud/assuredworkloads/v1beta1 + output: AssuredWorkloads + - name: audit + version: 1.0.1 + apis: + - path: google/devtools/source/v1 + php: + common_resources: false + staging_subdir: devtools-protos + - path: google/cloud/audit + php: + common_resources: false + staging_subdir: audit-protos + - path: google/cloud/common + php: + staging_subdir: common-protos + output: CloudCommonProtos + php: + component_name: CloudCommonProtos + - name: auditmanager + version: 0.2.0 + apis: + - path: google/cloud/auditmanager/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: AuditManager + - name: automl + version: 2.2.0 + apis: + - path: google/cloud/automl/v1 + output: AutoMl + - name: backupdr + version: 0.14.0 + apis: + - path: google/cloud/backupdr/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: BackupDr + php: + component_name: BackupDr + - name: baremetalsolution + version: 1.2.0 + apis: + - path: google/cloud/baremetalsolution/v2 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: BareMetalSolution + - name: batch + version: 1.5.0 + apis: + - path: google/cloud/batch/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: Batch + - name: beyondcorp-appconnections + version: 1.2.0 + apis: + - path: google/cloud/beyondcorp/appconnections/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: BeyondCorpAppConnections + php: + component_name: BeyondCorpAppConnections + - name: beyondcorp-appconnectors + version: 1.2.0 + apis: + - path: google/cloud/beyondcorp/appconnectors/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: BeyondCorpAppConnectors + php: + component_name: BeyondCorpAppConnectors + - name: beyondcorp-appgateways + version: 1.2.0 + apis: + - path: google/cloud/beyondcorp/appgateways/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: BeyondCorpAppGateways + php: + component_name: BeyondCorpAppGateways + - name: beyondcorp-clientconnectorservices + version: 1.2.0 + apis: + - path: google/cloud/beyondcorp/clientconnectorservices/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: BeyondCorpClientConnectorServices + php: + component_name: BeyondCorpClientConnectorServices + - name: beyondcorp-clientgateways + version: 1.2.0 + apis: + - path: google/cloud/beyondcorp/clientgateways/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: BeyondCorpClientGateways + php: + component_name: BeyondCorpClientGateways + - name: bigquery-analyticshub + version: 1.6.0 + apis: + - path: google/cloud/bigquery/analyticshub/v1 + output: BigQueryAnalyticsHub + php: + component_name: BigQueryAnalyticsHub + - name: bigquery-connection + version: 2.2.0 + apis: + - path: google/cloud/bigquery/connection/v1 + output: BigQueryConnection + php: + component_name: BigQueryConnection + - name: bigquery-dataexchange + version: 0.7.0 + apis: + - path: google/cloud/bigquery/dataexchange/v1beta1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: BigQueryDataExchange + php: + component_name: BigQueryDataExchange + - name: bigquery-datapolicies + version: 1.2.0 + apis: + - path: google/cloud/bigquery/datapolicies/v1 + output: BigQueryDataPolicies + php: + component_name: BigQueryDataPolicies + - name: bigquery-datatransfer + version: 2.3.0 + apis: + - path: google/cloud/bigquery/datatransfer/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: BigQueryDataTransfer + php: + component_name: BigQueryDataTransfer + - name: bigquery-migration + version: 1.4.0 + apis: + - path: google/cloud/bigquery/migration/v2 + output: BigQueryMigration + php: + component_name: BigQueryMigration + - name: bigquery-reservation + version: 2.8.0 + apis: + - path: google/cloud/bigquery/reservation/v1 + output: BigQueryReservation + php: + component_name: BigQueryReservation + - name: bigquery-storage + version: 2.4.0 + apis: + - path: google/cloud/bigquery/storage/v1 + output: BigQueryStorage + php: + component_name: BigQueryStorage + - name: bigtable + version: 2.26.0 + apis: + - path: google/bigtable/v2 + - path: google/bigtable/admin/v2 + php: + staging_subdir: v2/Admin + output: Bigtable + - name: billing + version: 2.3.0 + apis: + - path: google/cloud/billing/v1 + php: + common_resources: false + output: Billing + - name: billing-budgets + version: 2.2.0 + apis: + - path: google/cloud/billing/budgets/v1 + output: BillingBudgets + php: + component_name: BillingBudgets + - name: binaryauthorization + version: 1.3.0 + apis: + - path: google/cloud/binaryauthorization/v1 + php: + additional_protos: + - google/iam/v1/iam_policy.proto + output: BinaryAuthorization + - name: capacityplanner + version: 0.2.0 + apis: + - path: google/cloud/capacityplanner/v1beta + output: CapacityPlanner + - name: certificatemanager + version: 1.2.0 + apis: + - path: google/cloud/certificatemanager/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: CertificateManager + - name: ces + version: 0.4.0 + apis: + - path: google/cloud/ces/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: Ces + - name: channel + version: 2.5.0 + apis: + - path: google/cloud/channel/v1 + output: Channel + - name: chat + version: 0.25.0 + apis: + - path: google/chat/v1 + - path: google/apps/card/v1 + php: + common_resources: false + staging_subdir: card-protos/v1 + output: AppsChat + - name: chronicle + version: 0.6.0 + apis: + - path: google/cloud/chronicle/v1 + output: Chronicle + - name: cloudcontrolspartner + version: 0.6.0 + apis: + - path: google/cloud/cloudcontrolspartner/v1beta + output: ControlsPartner + php: + component_name: ControlsPartner + - name: clouddms + version: 2.2.0 + apis: + - path: google/cloud/clouddms/v1 + output: Dms + php: + component_name: Dms + - name: cloudsecuritycompliance + version: 0.4.2 + apis: + - path: google/cloud/cloudsecuritycompliance/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: SecurityCompliance + php: + component_name: SecurityCompliance + - name: commerce-consumer-procurement + version: 1.4.0 + apis: + - path: google/cloud/commerce/consumer/procurement/v1 + output: CommerceConsumerProcurement + php: + component_name: CommerceConsumerProcurement + - name: commerceproducer + version: 0.1.0 + apis: + - path: google/cloud/commerceproducer/v1beta + php: + additional_protos: + - google/cloud/location/locations.proto + output: CommerceProducer + php: + component_name: CommerceProducer + - name: compute + version: 2.12.0 + apis: + - path: google/cloud/compute/v1 + output: Compute + - name: confidentialcomputing + version: 1.8.0 + apis: + - path: google/cloud/confidentialcomputing/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: ConfidentialComputing + - name: config + version: 1.9.0 + apis: + - path: google/cloud/config/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: Config + - name: configdelivery + version: 0.4.0 + apis: + - path: google/cloud/configdelivery/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - path: google/cloud/configdelivery/v1beta + php: + additional_protos: + - google/cloud/location/locations.proto + output: ConfigDelivery + - name: contactcenterinsights + version: 2.5.0 + apis: + - path: google/cloud/contactcenterinsights/v1 + output: ContactCenterInsights + - name: container + version: 2.11.0 + apis: + - path: google/container/v1 + output: Container + - name: databasecenter + version: 0.8.0 + apis: + - path: google/cloud/databasecenter/v1beta + output: DatabaseCenter + - name: datacatalog + version: 2.5.0 + apis: + - path: google/cloud/datacatalog/v1 + php: + additional_protos: + - google/iam/v1/iam_policy.proto + output: DataCatalog + - name: datacatalog-lineage + version: 1.5.0 + apis: + - path: google/cloud/datacatalog/lineage/v1 + - path: google/cloud/datacatalog/lineage/configmanagement/v1 + php: + staging_subdir: ConfigManagement/v1 + output: DataCatalogLineage + php: + component_name: DataCatalogLineage + - name: dataflow + version: 0.11.0 + apis: + - path: google/dataflow/v1beta3 + output: Dataflow + - name: dataform + version: 0.14.0 + apis: + - path: google/cloud/dataform/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + - path: google/cloud/dataform/v1beta1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: Dataform + - name: datafusion + version: 1.2.0 + apis: + - path: google/cloud/datafusion/v1 + output: DataFusion + - name: datalabeling + version: 0.8.0 + apis: + - path: google/cloud/datalabeling/v1beta1 + output: DataLabeling + - name: dataplex + version: 1.15.0 + apis: + - path: google/cloud/dataplex/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: Dataplex + - name: dataproc + version: 4.1.0 + apis: + - path: google/cloud/dataproc/v1 + php: + additional_protos: + - google/iam/v1/iam_policy.proto + output: Dataproc + - name: datastore + version: 2.3.0 + apis: + - path: google/datastore/v1 + output: Datastore + - name: datastore-admin + version: 1.2.0 + apis: + - path: google/datastore/admin/v1 + output: DatastoreAdmin + php: + component_name: DatastoreAdmin + - name: datastream + version: 2.6.0 + apis: + - path: google/cloud/datastream/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: Datastream + - name: deploy + version: 1.7.0 + apis: + - path: google/cloud/deploy/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: Deploy + - name: developerconnect + version: 0.7.0 + apis: + - path: google/cloud/developerconnect/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: DeveloperConnect + - name: developers-knowledge + version: 0.3.0 + apis: + - path: google/developers/knowledge/v1 + output: DeveloperKnowledge + php: + component_name: DeveloperKnowledge + - name: devicestreaming + version: 0.3.0 + apis: + - path: google/cloud/devicestreaming/v1 + output: DeviceStreaming + - name: devtools-artifactregistry + version: 1.8.0 + apis: + - path: google/devtools/artifactregistry/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: ArtifactRegistry + - name: devtools-cloudbuild + version: 1.2.0 + apis: + - path: google/devtools/cloudbuild/v2 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: Build + - name: devtools-clouderrorreporting + version: 0.27.0 + apis: + - path: google/devtools/clouderrorreporting/v1beta1 + output: ErrorReporting + - name: devtools-cloudprofiler + version: 2.2.0 + apis: + - path: google/devtools/cloudprofiler/v2 + output: Profiler + - name: devtools-cloudtrace + version: 2.0.2 + apis: + - path: google/devtools/cloudtrace/v2 + - path: google/devtools/cloudtrace/v1 + output: Trace + - name: devtools-containeranalysis + version: 1.3.0 + apis: + - path: google/devtools/containeranalysis/v1 + output: ContainerAnalysis + - name: dialogflow + version: 2.6.0 + apis: + - path: google/cloud/dialogflow/v2 + php: + additional_protos: + - google/cloud/location/locations.proto + output: Dialogflow + - name: dialogflow-cx + version: 0.12.0 + apis: + - path: google/cloud/dialogflow/cx/v3 + php: + additional_protos: + - google/cloud/location/locations.proto + output: DialogflowCx + php: + component_name: DialogflowCx + - name: discoveryengine + version: 1.13.0 + apis: + - path: google/cloud/discoveryengine/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: DiscoveryEngine + - name: documentai + version: 2.8.0 + apis: + - path: google/cloud/documentai/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: DocumentAi + php: + component_name: DocumentAi + - name: domains + version: 1.2.0 + apis: + - path: google/cloud/domains/v1 + output: Domains + - name: edgenetwork + version: 1.5.0 + apis: + - path: google/cloud/edgenetwork/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: EdgeNetwork + - name: essentialcontacts + version: 1.2.0 + apis: + - path: google/cloud/essentialcontacts/v1 + output: EssentialContacts + - name: eventarc + version: 2.4.0 + apis: + - path: google/cloud/eventarc/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: Eventarc + - name: eventarc-publishing + version: 1.3.0 + apis: + - path: google/cloud/eventarc/publishing/v1 + output: EventarcPublishing + php: + component_name: EventarcPublishing + - name: filestore + version: 2.3.0 + apis: + - path: google/cloud/filestore/v1 + output: Filestore + - name: financialservices + version: 0.3.0 + apis: + - path: google/cloud/financialservices/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: FinancialServices + - name: firestore + version: 2.3.0 + apis: + - path: google/firestore/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - path: google/firestore/admin/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + staging_subdir: v1/Admin + output: Firestore + - name: functions + version: 2.2.0 + apis: + - path: google/cloud/functions/v2 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: Functions + - name: geminidataanalytics + version: 0.12.0 + apis: + - path: google/cloud/geminidataanalytics/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - path: google/cloud/geminidataanalytics/v1beta + php: + additional_protos: + - google/cloud/location/locations.proto + output: GeminiDataAnalytics + - name: geo-type + version: 0.2.4 + apis: + - path: google/geo/type + php: + common_resources: false + staging_subdir: . + output: GeoCommonProtos + php: + component_name: GeoCommonProtos + - name: gkebackup + version: 1.4.0 + apis: + - path: google/cloud/gkebackup/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: GkeBackup + - name: gkeconnect-gateway + version: 1.2.0 + apis: + - path: google/cloud/gkeconnect/gateway/v1 + - path: google/cloud/gkeconnect/gateway/v1beta1 + output: GkeConnectGateway + php: + component_name: GkeConnectGateway + - name: gkehub + version: 1.4.0 + apis: + - path: google/cloud/gkehub/v1 + output: GkeHub + - name: gkemulticloud + version: 1.5.0 + apis: + - path: google/cloud/gkemulticloud/v1 + output: GkeMultiCloud + - name: gkerecommender + version: 0.3.0 + apis: + - path: google/cloud/gkerecommender/v1 + output: GkeRecommender + - name: grafeas + version: 1.9.0 + apis: + - path: grafeas/v1 + output: Grafeas + - name: gsuiteaddons + version: 1.2.0 + apis: + - path: google/cloud/gsuiteaddons/v1 + output: GSuiteAddOns + - name: hypercomputecluster + version: 0.4.0 + apis: + - path: google/cloud/hypercomputecluster/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - path: google/cloud/hypercomputecluster/v1beta + php: + additional_protos: + - google/cloud/location/locations.proto + output: HypercomputeCluster + - name: iam + version: 1.5.0 + apis: + - path: google/iam/v3 + php: + additional_protos: + - google/cloud/location/locations.proto + - path: google/iam/v2 + output: Iam + - name: iam-credentials + version: 2.3.0 + apis: + - path: google/iam/credentials/v1 + output: IamCredentials + php: + component_name: IamCredentials + - name: iap + version: 2.4.0 + apis: + - path: google/cloud/iap/v1 + output: Iap + - name: identity-accesscontextmanager + version: 1.2.0 + apis: + - path: google/identity/accesscontextmanager/v1 + - path: google/identity/accesscontextmanager/type + php: + common_resources: false + staging_subdir: type-protos + output: AccessContextManager + php: + component_name: AccessContextManager + - name: ids + version: 1.3.0 + apis: + - path: google/cloud/ids/v1 + output: Ids + - name: kms + version: 2.12.0 + apis: + - path: google/cloud/kms/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: Kms + - name: kms-inventory + version: 1.5.0 + apis: + - path: google/cloud/kms/inventory/v1 + output: KmsInventory + php: + component_name: KmsInventory + - name: language + version: 1.3.0 + apis: + - path: google/cloud/language/v2 + - path: google/cloud/language/v1 + output: Language + - name: licensemanager + version: 0.4.0 + apis: + - path: google/cloud/licensemanager/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: LicenseManager + - name: lifesciences + version: 0.10.0 + apis: + - path: google/cloud/lifesciences/v2beta + php: + additional_protos: + - google/cloud/location/locations.proto + output: LifeSciences + - name: locationfinder + version: 0.3.0 + apis: + - path: google/cloud/locationfinder/v1 + output: LocationFinder + - name: logging + version: 2.2.0 + apis: + - path: google/logging/v2 + output: Logging + - name: longrunning + version: 0.8.1 + apis: + - path: google/longrunning + php: + common_resources: false + staging_subdir: src/LongRunning + output: LongRunning + - name: lustre + version: 0.5.0 + apis: + - path: google/cloud/lustre/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: Lustre + - name: maintenance-api + version: 0.5.0 + apis: + - path: google/cloud/maintenance/api/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - path: google/cloud/maintenance/api/v1beta + php: + additional_protos: + - google/cloud/location/locations.proto + output: Maintenance + php: + component_name: Maintenance + - name: managedidentities + version: 2.3.0 + apis: + - path: google/cloud/managedidentities/v1 + output: ManagedIdentities + - name: managedkafka + version: 0.9.0 + apis: + - path: google/cloud/managedkafka/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: ManagedKafka + - name: managedkafka-schemaregistry + version: 0.4.0 + apis: + - path: google/cloud/managedkafka/schemaregistry/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: ManagedKafkaSchemaRegistry + php: + component_name: ManagedKafkaSchemaRegistry + - name: maps-fleetengine + version: 0.6.0 + apis: + - path: google/maps/fleetengine/v1 + php: + proto_package: maps.fleetengine + output: MapsFleetEngine + - name: maps-fleetengine-delivery + version: 0.6.0 + apis: + - path: google/maps/fleetengine/delivery/v1 + php: + proto_package: maps.fleetengine.delivery + output: MapsFleetEngineDelivery + - name: maps-routeoptimization + version: 0.7.0 + apis: + - path: google/maps/routeoptimization/v1 + output: MapsRouteOptimization + - name: marketingplatform-admin + version: 0.5.0 + apis: + - path: google/marketingplatform/admin/v1alpha + php: + common_resources: false + output: AdsMarketingPlatformAdmin + - name: mediatranslation + version: 0.7.0 + apis: + - path: google/cloud/mediatranslation/v1beta1 + output: MediaTranslation + - name: memcache + version: 2.2.0 + apis: + - path: google/cloud/memcache/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: Memcache + - name: memorystore + version: 0.13.0 + apis: + - path: google/cloud/memorystore/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - path: google/cloud/memorystore/v1beta + php: + additional_protos: + - google/cloud/location/locations.proto + output: Memorystore + - name: metastore + version: 1.3.0 + apis: + - path: google/cloud/metastore/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + - path: google/cloud/metastore/v1beta + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + - path: google/cloud/metastore/v1alpha + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: DataprocMetastore + php: + component_name: DataprocMetastore + - name: migrationcenter + version: 1.3.0 + apis: + - path: google/cloud/migrationcenter/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: MigrationCenter + - name: modelarmor + version: 0.8.0 + apis: + - path: google/cloud/modelarmor/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - path: google/cloud/modelarmor/v1beta + php: + additional_protos: + - google/cloud/location/locations.proto + output: ModelArmor + - name: monitoring + version: 2.3.0 + apis: + - path: google/monitoring/v3 + output: Monitoring + - name: netapp + version: 1.13.0 + apis: + - path: google/cloud/netapp/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: NetApp + - name: networkconnectivity + version: 2.6.0 + apis: + - path: google/cloud/networkconnectivity/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: NetworkConnectivity + - name: networkmanagement + version: 2.11.0 + apis: + - path: google/cloud/networkmanagement/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: NetworkManagement + - name: networksecurity + version: 1.5.0 + apis: + - path: google/cloud/networksecurity/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: NetworkSecurity + - name: networkservices + version: 0.12.0 + apis: + - path: google/cloud/networkservices/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: NetworkServices + - name: notebooks + version: 1.2.0 + apis: + - path: google/cloud/notebooks/v2 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + - path: google/cloud/notebooks/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: Notebooks + - name: optimization + version: 1.2.0 + apis: + - path: google/cloud/optimization/v1 + output: Optimization + - name: oracledatabase + version: 0.11.0 + apis: + - path: google/cloud/oracledatabase/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: OracleDatabase + - name: orchestration-airflow-service + version: 2.3.0 + apis: + - path: google/cloud/orchestration/airflow/service/v1 + output: OrchestrationAirflow + php: + component_name: OrchestrationAirflow + - name: orgpolicy + version: 1.4.0 + apis: + - path: google/cloud/orgpolicy/v2 + output: OrgPolicy + - name: osconfig + version: 2.3.0 + apis: + - path: google/cloud/osconfig/v1 + output: OsConfig + - name: oslogin + version: 2.2.0 + apis: + - path: google/cloud/oslogin/v1 + output: OsLogin + - name: parallelstore + version: 0.14.0 + apis: + - path: google/cloud/parallelstore/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - path: google/cloud/parallelstore/v1beta + php: + additional_protos: + - google/cloud/location/locations.proto + output: Parallelstore + - name: parametermanager + version: 0.6.0 + apis: + - path: google/cloud/parametermanager/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: ParameterManager + - name: policysimulator + version: 1.4.0 + apis: + - path: google/cloud/policysimulator/v1 + output: PolicySimulator + - name: policytroubleshooter + version: 2.2.0 + apis: + - path: google/cloud/policytroubleshooter/v1 + output: PolicyTroubleshooter + - name: policytroubleshooter-iam + version: 0.5.0 + apis: + - path: google/cloud/policytroubleshooter/iam/v3 + output: PolicyTroubleshooterIam + php: + component_name: PolicyTroubleshooterIam + - name: privacy-dlp + version: 2.14.0 + apis: + - path: google/privacy/dlp/v2 + output: Dlp + - name: privatecatalog + version: 0.7.0 + apis: + - path: google/cloud/privatecatalog/v1beta1 + output: PrivateCatalog + - name: privilegedaccessmanager + version: 0.5.0 + apis: + - path: google/cloud/privilegedaccessmanager/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: PrivilegedAccessManager + - name: pubsub + version: 2.20.0 + apis: + - path: google/pubsub/v1 + php: + additional_protos: + - google/iam/v1/iam_policy.proto + output: PubSub + - name: rapidmigrationassessment + version: 1.3.0 + apis: + - path: google/cloud/rapidmigrationassessment/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: RapidMigrationAssessment + - name: recaptchaenterprise + version: 2.5.0 + apis: + - path: google/cloud/recaptchaenterprise/v1 + output: RecaptchaEnterprise + - name: recommendationengine + version: 0.10.0 + apis: + - path: google/cloud/recommendationengine/v1beta1 + output: RecommendationEngine + - name: recommender + version: 2.3.0 + apis: + - path: google/cloud/recommender/v1 + output: Recommender + - name: redis + version: 2.3.0 + apis: + - path: google/cloud/redis/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: Redis + - name: redis-cluster + version: 0.10.0 + apis: + - path: google/cloud/redis/cluster/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: RedisCluster + php: + component_name: RedisCluster + - name: resourcemanager + version: 1.2.0 + apis: + - path: google/cloud/resourcemanager/v3 + php: + common_resources: false + output: ResourceManager + - name: retail + version: 2.6.0 + apis: + - path: google/cloud/retail/v2 + php: + additional_protos: + - google/cloud/location/locations.proto + output: Retail + - name: run + version: 1.13.0 + apis: + - path: google/cloud/run/v2 + php: + additional_protos: + - google/cloud/location/locations.proto + output: Run + - name: scheduler + version: 2.3.0 + apis: + - path: google/cloud/scheduler/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: Scheduler + - name: secretmanager + version: 2.5.0 + apis: + - path: google/cloud/secretmanager/v1 + - path: google/cloud/secretmanager/v1beta2 + php: + additional_protos: + - google/cloud/location/locations.proto + output: SecretManager + - name: securesourcemanager + version: 1.10.0 + apis: + - path: google/cloud/securesourcemanager/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: SecureSourceManager + - name: security-privateca + version: 2.4.2 + apis: + - path: google/cloud/security/privateca/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: SecurityPrivateCa + php: + component_name: SecurityPrivateCa + - name: security-publicca + version: 1.2.1 + apis: + - path: google/cloud/security/publicca/v1 + output: SecurityPublicCA + php: + component_name: SecurityPublicCA + - name: securitycenter + version: 2.6.1 + apis: + - path: google/cloud/securitycenter/v2 + - path: google/cloud/securitycenter/v1 + output: SecurityCenter + - name: securitycentermanagement + version: 1.4.1 + apis: + - path: google/cloud/securitycentermanagement/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: SecurityCenterManagement + - name: servicedirectory + version: 2.2.1 + apis: + - path: google/cloud/servicedirectory/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: ServiceDirectory + - name: servicehealth + version: 0.5.1 + apis: + - path: google/cloud/servicehealth/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: ServiceHealth + - name: shell + version: 2.2.1 + apis: + - path: google/cloud/shell/v1 + output: Shell + - name: shopping-css + version: 0.8.3 + apis: + - path: google/shopping/css/v1 + output: ShoppingCss + - name: shopping-merchant-accounts + version: 1.4.3 + apis: + - path: google/shopping/merchant/accounts/v1 + - path: google/shopping/merchant/accounts/v1beta + output: ShoppingMerchantAccounts + - name: shopping-merchant-conversions + version: 1.2.1 + apis: + - path: google/shopping/merchant/conversions/v1 + - path: google/shopping/merchant/conversions/v1beta + output: ShoppingMerchantConversions + - name: shopping-merchant-datasources + version: 1.3.3 + apis: + - path: google/shopping/merchant/datasources/v1 + - path: google/shopping/merchant/datasources/v1beta + output: ShoppingMerchantDataSources + - name: shopping-merchant-inventories + version: 1.5.3 + apis: + - path: google/shopping/merchant/inventories/v1 + - path: google/shopping/merchant/inventories/v1beta + output: ShoppingMerchantInventories + - name: shopping-merchant-issueresolution + version: 1.3.3 + apis: + - path: google/shopping/merchant/issueresolution/v1 + output: ShoppingMerchantIssueResolution + - name: shopping-merchant-lfp + version: 1.2.3 + apis: + - path: google/shopping/merchant/lfp/v1 + - path: google/shopping/merchant/lfp/v1beta + output: ShoppingMerchantLfp + - name: shopping-merchant-notifications + version: 1.2.3 + apis: + - path: google/shopping/merchant/notifications/v1 + - path: google/shopping/merchant/notifications/v1beta + output: ShoppingMerchantNotifications + - name: shopping-merchant-ordertracking + version: 1.2.3 + apis: + - path: google/shopping/merchant/ordertracking/v1 + - path: google/shopping/merchant/ordertracking/v1beta + output: ShoppingMerchantOrderTracking + - name: shopping-merchant-products + version: 1.7.2 + apis: + - path: google/shopping/merchant/products/v1 + - path: google/shopping/merchant/products/v1beta + output: ShoppingMerchantProducts + - name: shopping-merchant-promotions + version: 1.2.3 + apis: + - path: google/shopping/merchant/promotions/v1 + - path: google/shopping/merchant/promotions/v1beta + output: ShoppingMerchantPromotions + - name: shopping-merchant-quota + version: 1.3.1 + apis: + - path: google/shopping/merchant/quota/v1 + - path: google/shopping/merchant/quota/v1beta + output: ShoppingMerchantQuota + - name: shopping-merchant-reports + version: 1.3.2 + apis: + - path: google/shopping/merchant/reports/v1 + - path: google/shopping/merchant/reports/v1beta + output: ShoppingMerchantReports + - name: shopping-merchant-reviews + version: 0.6.3 + apis: + - path: google/shopping/merchant/reviews/v1beta + output: ShoppingMerchantReviews + - name: shopping-type + version: 0.5.1 + apis: + - path: google/shopping/type + php: + common_resources: false + staging_subdir: . + output: ShoppingCommonProtos + php: + component_name: ShoppingCommonProtos + - name: spanner + version: 2.10.6 + apis: + - path: google/spanner/v1 + - path: google/spanner/admin/database/v1 + php: + staging_subdir: v1/Admin/Database/v1 + - path: google/spanner/admin/instance/v1 + php: + staging_subdir: v1/Admin/Instance/v1 + output: Spanner + - name: speech + version: 2.5.4 + apis: + - path: google/cloud/speech/v2 + php: + additional_protos: + - google/cloud/location/locations.proto + output: Speech + - name: sql + version: 1.11.1 + apis: + - path: google/cloud/sql/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: SqlAdmin + php: + component_name: SqlAdmin + - name: storage-control + version: 1.11.0 + apis: + - path: google/storage/control/v2 + output: StorageControl + php: + component_name: StorageControl + - name: storagebatchoperations + version: 0.7.1 + apis: + - path: google/cloud/storagebatchoperations/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: StorageBatchOperations + - name: storageinsights + version: 1.4.1 + apis: + - path: google/cloud/storageinsights/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: StorageInsights + - name: storagetransfer + version: 2.4.1 + apis: + - path: google/storagetransfer/v1 + output: StorageTransfer + - name: support + version: 1.8.1 + apis: + - path: google/cloud/support/v2 + - path: google/cloud/support/v2beta + output: Support + - name: talent + version: 2.3.1 + apis: + - path: google/cloud/talent/v4 + output: Talent + - name: tasks + version: 2.2.1 + apis: + - path: google/cloud/tasks/v2 + php: + additional_protos: + - google/cloud/location/locations.proto + output: Tasks + - name: telcoautomation + version: 1.3.1 + apis: + - path: google/cloud/telcoautomation/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: TelcoAutomation + - name: texttospeech + version: 2.8.1 + apis: + - path: google/cloud/texttospeech/v1 + output: TextToSpeech + - name: tpu + version: 2.3.1 + apis: + - path: google/cloud/tpu/v2 + php: + additional_protos: + - google/cloud/location/locations.proto + output: Tpu + - name: translate + version: 2.3.3 + apis: + - path: google/cloud/translate/v3 + php: + proto_package: google.cloud.translation + output: Translate + - name: vectorsearch + version: 0.6.0 + apis: + - path: google/cloud/vectorsearch/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: VectorSearch + - name: video-livestream + version: 1.5.0 + apis: + - path: google/cloud/video/livestream/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: VideoLiveStream + php: + component_name: VideoLiveStream + - name: video-stitcher + version: 1.3.0 + apis: + - path: google/cloud/video/stitcher/v1 + output: VideoStitcher + php: + component_name: VideoStitcher + - name: video-transcoder + version: 1.5.0 + apis: + - path: google/cloud/video/transcoder/v1 + output: VideoTranscoder + php: + component_name: VideoTranscoder + - name: videointelligence + version: 2.3.0 + apis: + - path: google/cloud/videointelligence/v1 + output: VideoIntelligence + - name: vision + version: 2.3.0 + apis: + - path: google/cloud/vision/v1 + output: Vision + - name: visionai + version: 0.4.0 + apis: + - path: google/cloud/visionai/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: VisionAi + php: + component_name: VisionAi + - name: vmmigration + version: 1.5.0 + apis: + - path: google/cloud/vmmigration/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: VmMigration + php: + component_name: VmMigration + - name: vmwareengine + version: 1.4.0 + apis: + - path: google/cloud/vmwareengine/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - google/iam/v1/iam_policy.proto + output: VmwareEngine + - name: vpcaccess + version: 2.3.0 + apis: + - path: google/cloud/vpcaccess/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: VpcAccess + - name: webrisk + version: 2.4.0 + apis: + - path: google/cloud/webrisk/v1 + output: WebRisk + - name: websecurityscanner + version: 1.3.0 + apis: + - path: google/cloud/websecurityscanner/v1 + output: WebSecurityScanner + - name: workflows + version: 1.4.0 + apis: + - path: google/cloud/workflows/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + - path: google/cloud/workflows/executions/v1 + php: + staging_subdir: Executions/v1 + output: Workflows + - name: workloadmanager + version: 0.3.0 + apis: + - path: google/cloud/workloadmanager/v1 + php: + additional_protos: + - google/cloud/location/locations.proto + output: WorkloadManager From 5f4bafa9c8c37488f6af1e2717bdd240e59e4445 Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Wed, 19 Aug 2026 19:41:27 +0000 Subject: [PATCH 02/21] update config --- librarian.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/librarian.yaml b/librarian.yaml index 292cf179d6c..f30dc430904 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -107,6 +107,7 @@ libraries: - path: google/iam/v1 php: common_resources: false + generate_gapic: false staging_subdir: iam - path: google/api php: @@ -114,14 +115,20 @@ libraries: - path: google/cloud php: common_resources: false + excluded_protos: + - google/cloud/common_resources.proto staging_subdir: extendedoperations - path: google/rpc php: common_resources: false + excluded_protos: + - google/rpc/http.proto - path: google/type php: common_resources: false - path: google/cloud/location + php: + generate_gapic: false - path: google/logging/type php: common_resources: false From c764fadc6e197da399e99d05bc901cf1772b3bf5 Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Thu, 20 Aug 2026 15:10:46 +0000 Subject: [PATCH 03/21] update config --- LongRunning/owlbot.py | 14 ++++++++++++++ librarian.yaml | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/LongRunning/owlbot.py b/LongRunning/owlbot.py index 42986be63ba..bd2ba888c67 100644 --- a/LongRunning/owlbot.py +++ b/LongRunning/owlbot.py @@ -15,7 +15,9 @@ """This script is used to synthesize generated parts of this library.""" import logging +import os from pathlib import Path +import shutil import subprocess import synthtool as s @@ -41,6 +43,18 @@ version_string="longrunning", ) +# move GAPIC generated files to src/LongRunning if present (for librarian backwards compatibility) +for path in ["src/Client", "src/resources"]: + if os.path.isdir(path): + s.move(path, f"src/LongRunning/{os.path.basename(path)}") + shutil.rmtree(path, ignore_errors=True) + +if os.path.isfile("src/gapic_metadata.json"): + s.move("src/gapic_metadata.json", "src/LongRunning/gapic_metadata.json") + if os.path.exists("src/gapic_metadata.json"): + os.remove("src/gapic_metadata.json") + + ### [START] protoc backwards compatibility fixes # roll back to private properties. diff --git a/librarian.yaml b/librarian.yaml index f30dc430904..5ed8d11b12d 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -1008,11 +1008,16 @@ libraries: output: Logging - name: longrunning version: 0.8.1 + keep: + - src/LongRunning/Gapic/OperationsGapicClient.php + - src/LongRunning/OperationsClient.php + - tests/Unit/OperationsClientTest.php apis: - path: google/longrunning php: common_resources: false - staging_subdir: src/LongRunning + samples: false + staging_subdir: . output: LongRunning - name: lustre version: 0.5.0 From b748bac48ebf90d98bc0b39f5a9cd626986b9c4a Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Thu, 20 Aug 2026 22:01:52 +0000 Subject: [PATCH 04/21] update config --- librarian.yaml | 49 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/librarian.yaml b/librarian.yaml index 5ed8d11b12d..e0dcfa80d11 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -14,8 +14,8 @@ language: php sources: googleapis: - commit: 6145fa8cc2b137bf4c0ed114e2e39c1157ea9722 - sha256: 489923d12c766c9e323b42de057037977b03f20c8a874bc8553d29f9dd3f0e3b + commit: 89040d1713699bad4878bd9a6ef94ca792a5b83d + sha256: e62fc9c8077ab89ec571fa85a1511d1381536b68962ee0b5565d68cc5254b063 tools: composer: - name: google-cloud-php/dev @@ -77,6 +77,43 @@ libraries: additional_protos: - google/cloud/location/locations.proto - google/iam/v1/iam_policy.proto + excluded_protos: + - google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto + - google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto + - google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto + - google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto + - google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto + - google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto + - google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto + - google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto + - google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto + - google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto + - google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto + - google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto + - google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto + - google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto + - google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto + - google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto + - google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto + - google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto + - google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto + - google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto + - google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto + - google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto + - google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto + - google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto + - google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto + - google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto + - google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto + - google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto + - google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto + - google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto + - google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto + - google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto + - google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto + - google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto + - google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto + - google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto output: AiPlatform php: component_name: AiPlatform @@ -1008,16 +1045,16 @@ libraries: output: Logging - name: longrunning version: 0.8.1 - keep: - - src/LongRunning/Gapic/OperationsGapicClient.php - - src/LongRunning/OperationsClient.php - - tests/Unit/OperationsClientTest.php apis: - path: google/longrunning php: common_resources: false samples: false staging_subdir: . + keep: + - src/LongRunning/Gapic/OperationsGapicClient.php + - src/LongRunning/OperationsClient.php + - tests/Unit/OperationsClientTest.php output: LongRunning - name: lustre version: 0.5.0 From 96e63e22eec9b455fff2aae6c7e08b439c2fe7dc Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Thu, 20 Aug 2026 22:24:42 +0000 Subject: [PATCH 05/21] update --- LongRunning/owlbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LongRunning/owlbot.py b/LongRunning/owlbot.py index bd2ba888c67..9cdeda9563a 100644 --- a/LongRunning/owlbot.py +++ b/LongRunning/owlbot.py @@ -88,7 +88,7 @@ '--package=@prettier/plugin-php@^0.19', '--', 'prettier', - '**/Gapic/*', + '**/Client/*', '--write', '--parser=php', '--single-quote', From 6a8b74b0f2399ad6155799c0f29e358023a427f0 Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Fri, 21 Aug 2026 13:28:23 +0000 Subject: [PATCH 06/21] chore: update owlbot --- ShoppingMerchantInventories/owlbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ShoppingMerchantInventories/owlbot.py b/ShoppingMerchantInventories/owlbot.py index 2f36f2715cc..267742791fc 100644 --- a/ShoppingMerchantInventories/owlbot.py +++ b/ShoppingMerchantInventories/owlbot.py @@ -47,7 +47,7 @@ '--package=@prettier/plugin-php@^0.19', '--', 'prettier', - '**/Gapic/*', + '**/Client/*', '--write', '--parser=php', '--single-quote', From 7db509bf33fa561a434194ed162715cf8274ef8a Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Fri, 21 Aug 2026 13:32:48 +0000 Subject: [PATCH 07/21] format --- .../V1/Client/LocalInventoryServiceClient.php | 10 +- .../Client/RegionalInventoryServiceClient.php | 19 ++-- .../Client/LocalInventoryServiceClient.php | 10 +- .../Client/RegionalInventoryServiceClient.php | 19 ++-- .../LocalInventoryServiceClientTest.php | 96 +++++++++++-------- .../RegionalInventoryServiceClientTest.php | 88 ++++++++++------- .../LocalInventoryServiceClientTest.php | 96 +++++++++++-------- .../RegionalInventoryServiceClientTest.php | 88 ++++++++++------- 8 files changed, 244 insertions(+), 182 deletions(-) diff --git a/ShoppingMerchantInventories/src/V1/Client/LocalInventoryServiceClient.php b/ShoppingMerchantInventories/src/V1/Client/LocalInventoryServiceClient.php index 0e7c1650838..3b6a3f57ab5 100644 --- a/ShoppingMerchantInventories/src/V1/Client/LocalInventoryServiceClient.php +++ b/ShoppingMerchantInventories/src/V1/Client/LocalInventoryServiceClient.php @@ -85,9 +85,7 @@ final class LocalInventoryServiceClient * * @internal */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/content', - ]; + public static $serviceScopes = ['https://www.googleapis.com/auth/content']; private static function getClientDefaults() { @@ -345,8 +343,10 @@ public function insertLocalInventory(InsertLocalInventoryRequest $request, array * * @throws ApiException Thrown if the API call fails. */ - public function listLocalInventories(ListLocalInventoriesRequest $request, array $callOptions = []): PagedListResponse - { + public function listLocalInventories( + ListLocalInventoriesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListLocalInventories', $request, $callOptions); } } diff --git a/ShoppingMerchantInventories/src/V1/Client/RegionalInventoryServiceClient.php b/ShoppingMerchantInventories/src/V1/Client/RegionalInventoryServiceClient.php index 6c308379089..39468afbcf8 100644 --- a/ShoppingMerchantInventories/src/V1/Client/RegionalInventoryServiceClient.php +++ b/ShoppingMerchantInventories/src/V1/Client/RegionalInventoryServiceClient.php @@ -86,9 +86,7 @@ final class RegionalInventoryServiceClient * * @internal */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/content', - ]; + public static $serviceScopes = ['https://www.googleapis.com/auth/content']; private static function getClientDefaults() { @@ -103,7 +101,8 @@ private static function getClientDefaults() ], 'transportConfig' => [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/regional_inventory_service_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/regional_inventory_service_rest_client_config.php', ], ], ]; @@ -314,8 +313,10 @@ public function deleteRegionalInventory(DeleteRegionalInventoryRequest $request, * * @throws ApiException Thrown if the API call fails. */ - public function insertRegionalInventory(InsertRegionalInventoryRequest $request, array $callOptions = []): RegionalInventory - { + public function insertRegionalInventory( + InsertRegionalInventoryRequest $request, + array $callOptions = [] + ): RegionalInventory { return $this->startApiCall('InsertRegionalInventory', $request, $callOptions)->wait(); } @@ -346,8 +347,10 @@ public function insertRegionalInventory(InsertRegionalInventoryRequest $request, * * @throws ApiException Thrown if the API call fails. */ - public function listRegionalInventories(ListRegionalInventoriesRequest $request, array $callOptions = []): PagedListResponse - { + public function listRegionalInventories( + ListRegionalInventoriesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListRegionalInventories', $request, $callOptions); } } diff --git a/ShoppingMerchantInventories/src/V1beta/Client/LocalInventoryServiceClient.php b/ShoppingMerchantInventories/src/V1beta/Client/LocalInventoryServiceClient.php index 0210e97e280..453edcaa871 100644 --- a/ShoppingMerchantInventories/src/V1beta/Client/LocalInventoryServiceClient.php +++ b/ShoppingMerchantInventories/src/V1beta/Client/LocalInventoryServiceClient.php @@ -89,9 +89,7 @@ final class LocalInventoryServiceClient * * @internal */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/content', - ]; + public static $serviceScopes = ['https://www.googleapis.com/auth/content']; private static function getClientDefaults() { @@ -363,8 +361,10 @@ public function insertLocalInventory(InsertLocalInventoryRequest $request, array * * @experimental */ - public function listLocalInventories(ListLocalInventoriesRequest $request, array $callOptions = []): PagedListResponse - { + public function listLocalInventories( + ListLocalInventoriesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListLocalInventories', $request, $callOptions); } } diff --git a/ShoppingMerchantInventories/src/V1beta/Client/RegionalInventoryServiceClient.php b/ShoppingMerchantInventories/src/V1beta/Client/RegionalInventoryServiceClient.php index bd65602a91b..4cd6ebbcf71 100644 --- a/ShoppingMerchantInventories/src/V1beta/Client/RegionalInventoryServiceClient.php +++ b/ShoppingMerchantInventories/src/V1beta/Client/RegionalInventoryServiceClient.php @@ -90,9 +90,7 @@ final class RegionalInventoryServiceClient * * @internal */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/content', - ]; + public static $serviceScopes = ['https://www.googleapis.com/auth/content']; private static function getClientDefaults() { @@ -107,7 +105,8 @@ private static function getClientDefaults() ], 'transportConfig' => [ 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/regional_inventory_service_rest_client_config.php', + 'restClientConfigPath' => + __DIR__ . '/../resources/regional_inventory_service_rest_client_config.php', ], ], ]; @@ -330,8 +329,10 @@ public function deleteRegionalInventory(DeleteRegionalInventoryRequest $request, * * @experimental */ - public function insertRegionalInventory(InsertRegionalInventoryRequest $request, array $callOptions = []): RegionalInventory - { + public function insertRegionalInventory( + InsertRegionalInventoryRequest $request, + array $callOptions = [] + ): RegionalInventory { return $this->startApiCall('InsertRegionalInventory', $request, $callOptions)->wait(); } @@ -364,8 +365,10 @@ public function insertRegionalInventory(InsertRegionalInventoryRequest $request, * * @experimental */ - public function listRegionalInventories(ListRegionalInventoriesRequest $request, array $callOptions = []): PagedListResponse - { + public function listRegionalInventories( + ListRegionalInventoriesRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListRegionalInventories', $request, $callOptions); } } diff --git a/ShoppingMerchantInventories/tests/Unit/V1/Client/LocalInventoryServiceClientTest.php b/ShoppingMerchantInventories/tests/Unit/V1/Client/LocalInventoryServiceClientTest.php index f81c50357c2..d7f8e3e9bfe 100644 --- a/ShoppingMerchantInventories/tests/Unit/V1/Client/LocalInventoryServiceClientTest.php +++ b/ShoppingMerchantInventories/tests/Unit/V1/Client/LocalInventoryServiceClientTest.php @@ -52,7 +52,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return LocalInventoryServiceClient */ @@ -77,14 +79,16 @@ public function deleteLocalInventoryTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->localInventoryName('[ACCOUNT]', '[PRODUCT]', '[STORE_CODE]'); - $request = (new DeleteLocalInventoryRequest()) - ->setName($formattedName); + $request = (new DeleteLocalInventoryRequest())->setName($formattedName); $gapicClient->deleteLocalInventory($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1.LocalInventoryService/DeleteLocalInventory', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1.LocalInventoryService/DeleteLocalInventory', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -101,17 +105,19 @@ public function deleteLocalInventoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->localInventoryName('[ACCOUNT]', '[PRODUCT]', '[STORE_CODE]'); - $request = (new DeleteLocalInventoryRequest()) - ->setName($formattedName); + $request = (new DeleteLocalInventoryRequest())->setName($formattedName); try { $gapicClient->deleteLocalInventory($request); // If the $gapicClient method call did not throw, fail the test @@ -149,16 +155,17 @@ public function insertLocalInventoryTest() $localInventory = new LocalInventory(); $localInventoryStoreCode = 'localInventoryStoreCode1126909757'; $localInventory->setStoreCode($localInventoryStoreCode); - $request = (new InsertLocalInventoryRequest()) - ->setParent($formattedParent) - ->setLocalInventory($localInventory); + $request = (new InsertLocalInventoryRequest())->setParent($formattedParent)->setLocalInventory($localInventory); $response = $gapicClient->insertLocalInventory($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1.LocalInventoryService/InsertLocalInventory', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1.LocalInventoryService/InsertLocalInventory', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualRequestObject->getLocalInventory(); @@ -177,21 +184,22 @@ public function insertLocalInventoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); $localInventory = new LocalInventory(); $localInventoryStoreCode = 'localInventoryStoreCode1126909757'; $localInventory->setStoreCode($localInventoryStoreCode); - $request = (new InsertLocalInventoryRequest()) - ->setParent($formattedParent) - ->setLocalInventory($localInventory); + $request = (new InsertLocalInventoryRequest())->setParent($formattedParent)->setLocalInventory($localInventory); try { $gapicClient->insertLocalInventory($request); // If the $gapicClient method call did not throw, fail the test @@ -216,17 +224,14 @@ public function listLocalInventoriesTest() // Mock response $nextPageToken = ''; $localInventoriesElement = new LocalInventory(); - $localInventories = [ - $localInventoriesElement, - ]; + $localInventories = [$localInventoriesElement]; $expectedResponse = new ListLocalInventoriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocalInventories($localInventories); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); - $request = (new ListLocalInventoriesRequest()) - ->setParent($formattedParent); + $request = (new ListLocalInventoriesRequest())->setParent($formattedParent); $response = $gapicClient->listLocalInventories($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -236,7 +241,10 @@ public function listLocalInventoriesTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1.LocalInventoryService/ListLocalInventories', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1.LocalInventoryService/ListLocalInventories', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -253,17 +261,19 @@ public function listLocalInventoriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); - $request = (new ListLocalInventoriesRequest()) - ->setParent($formattedParent); + $request = (new ListLocalInventoriesRequest())->setParent($formattedParent); try { $gapicClient->listLocalInventories($request); // If the $gapicClient method call did not throw, fail the test @@ -290,14 +300,16 @@ public function deleteLocalInventoryAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->localInventoryName('[ACCOUNT]', '[PRODUCT]', '[STORE_CODE]'); - $request = (new DeleteLocalInventoryRequest()) - ->setName($formattedName); + $request = (new DeleteLocalInventoryRequest())->setName($formattedName); $gapicClient->deleteLocalInventoryAsync($request)->wait(); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1.LocalInventoryService/DeleteLocalInventory', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1.LocalInventoryService/DeleteLocalInventory', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); diff --git a/ShoppingMerchantInventories/tests/Unit/V1/Client/RegionalInventoryServiceClientTest.php b/ShoppingMerchantInventories/tests/Unit/V1/Client/RegionalInventoryServiceClientTest.php index 0980e0929f2..2003608e256 100644 --- a/ShoppingMerchantInventories/tests/Unit/V1/Client/RegionalInventoryServiceClientTest.php +++ b/ShoppingMerchantInventories/tests/Unit/V1/Client/RegionalInventoryServiceClientTest.php @@ -52,7 +52,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return RegionalInventoryServiceClient */ @@ -77,14 +79,16 @@ public function deleteRegionalInventoryTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->regionalInventoryName('[ACCOUNT]', '[PRODUCT]', '[REGION]'); - $request = (new DeleteRegionalInventoryRequest()) - ->setName($formattedName); + $request = (new DeleteRegionalInventoryRequest())->setName($formattedName); $gapicClient->deleteRegionalInventory($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1.RegionalInventoryService/DeleteRegionalInventory', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1.RegionalInventoryService/DeleteRegionalInventory', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -101,17 +105,19 @@ public function deleteRegionalInventoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->regionalInventoryName('[ACCOUNT]', '[PRODUCT]', '[REGION]'); - $request = (new DeleteRegionalInventoryRequest()) - ->setName($formattedName); + $request = (new DeleteRegionalInventoryRequest())->setName($formattedName); try { $gapicClient->deleteRegionalInventory($request); // If the $gapicClient method call did not throw, fail the test @@ -158,7 +164,10 @@ public function insertRegionalInventoryTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1.RegionalInventoryService/InsertRegionalInventory', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1.RegionalInventoryService/InsertRegionalInventory', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualRequestObject->getRegionalInventory(); @@ -177,12 +186,15 @@ public function insertRegionalInventoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); @@ -216,17 +228,14 @@ public function listRegionalInventoriesTest() // Mock response $nextPageToken = ''; $regionalInventoriesElement = new RegionalInventory(); - $regionalInventories = [ - $regionalInventoriesElement, - ]; + $regionalInventories = [$regionalInventoriesElement]; $expectedResponse = new ListRegionalInventoriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setRegionalInventories($regionalInventories); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); - $request = (new ListRegionalInventoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRegionalInventoriesRequest())->setParent($formattedParent); $response = $gapicClient->listRegionalInventories($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -236,7 +245,10 @@ public function listRegionalInventoriesTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1.RegionalInventoryService/ListRegionalInventories', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1.RegionalInventoryService/ListRegionalInventories', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -253,17 +265,19 @@ public function listRegionalInventoriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); - $request = (new ListRegionalInventoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRegionalInventoriesRequest())->setParent($formattedParent); try { $gapicClient->listRegionalInventories($request); // If the $gapicClient method call did not throw, fail the test @@ -290,14 +304,16 @@ public function deleteRegionalInventoryAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->regionalInventoryName('[ACCOUNT]', '[PRODUCT]', '[REGION]'); - $request = (new DeleteRegionalInventoryRequest()) - ->setName($formattedName); + $request = (new DeleteRegionalInventoryRequest())->setName($formattedName); $gapicClient->deleteRegionalInventoryAsync($request)->wait(); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1.RegionalInventoryService/DeleteRegionalInventory', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1.RegionalInventoryService/DeleteRegionalInventory', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); diff --git a/ShoppingMerchantInventories/tests/Unit/V1beta/Client/LocalInventoryServiceClientTest.php b/ShoppingMerchantInventories/tests/Unit/V1beta/Client/LocalInventoryServiceClientTest.php index b0eeb897b60..5e469bf442c 100644 --- a/ShoppingMerchantInventories/tests/Unit/V1beta/Client/LocalInventoryServiceClientTest.php +++ b/ShoppingMerchantInventories/tests/Unit/V1beta/Client/LocalInventoryServiceClientTest.php @@ -52,7 +52,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return LocalInventoryServiceClient */ @@ -77,14 +79,16 @@ public function deleteLocalInventoryTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->localInventoryName('[ACCOUNT]', '[PRODUCT]', '[STORE_CODE]'); - $request = (new DeleteLocalInventoryRequest()) - ->setName($formattedName); + $request = (new DeleteLocalInventoryRequest())->setName($formattedName); $gapicClient->deleteLocalInventory($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.LocalInventoryService/DeleteLocalInventory', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1beta.LocalInventoryService/DeleteLocalInventory', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -101,17 +105,19 @@ public function deleteLocalInventoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->localInventoryName('[ACCOUNT]', '[PRODUCT]', '[STORE_CODE]'); - $request = (new DeleteLocalInventoryRequest()) - ->setName($formattedName); + $request = (new DeleteLocalInventoryRequest())->setName($formattedName); try { $gapicClient->deleteLocalInventory($request); // If the $gapicClient method call did not throw, fail the test @@ -157,16 +163,17 @@ public function insertLocalInventoryTest() $localInventory = new LocalInventory(); $localInventoryStoreCode = 'localInventoryStoreCode1126909757'; $localInventory->setStoreCode($localInventoryStoreCode); - $request = (new InsertLocalInventoryRequest()) - ->setParent($formattedParent) - ->setLocalInventory($localInventory); + $request = (new InsertLocalInventoryRequest())->setParent($formattedParent)->setLocalInventory($localInventory); $response = $gapicClient->insertLocalInventory($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.LocalInventoryService/InsertLocalInventory', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1beta.LocalInventoryService/InsertLocalInventory', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualRequestObject->getLocalInventory(); @@ -185,21 +192,22 @@ public function insertLocalInventoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); $localInventory = new LocalInventory(); $localInventoryStoreCode = 'localInventoryStoreCode1126909757'; $localInventory->setStoreCode($localInventoryStoreCode); - $request = (new InsertLocalInventoryRequest()) - ->setParent($formattedParent) - ->setLocalInventory($localInventory); + $request = (new InsertLocalInventoryRequest())->setParent($formattedParent)->setLocalInventory($localInventory); try { $gapicClient->insertLocalInventory($request); // If the $gapicClient method call did not throw, fail the test @@ -224,17 +232,14 @@ public function listLocalInventoriesTest() // Mock response $nextPageToken = ''; $localInventoriesElement = new LocalInventory(); - $localInventories = [ - $localInventoriesElement, - ]; + $localInventories = [$localInventoriesElement]; $expectedResponse = new ListLocalInventoriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocalInventories($localInventories); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); - $request = (new ListLocalInventoriesRequest()) - ->setParent($formattedParent); + $request = (new ListLocalInventoriesRequest())->setParent($formattedParent); $response = $gapicClient->listLocalInventories($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -244,7 +249,10 @@ public function listLocalInventoriesTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.LocalInventoryService/ListLocalInventories', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1beta.LocalInventoryService/ListLocalInventories', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -261,17 +269,19 @@ public function listLocalInventoriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); - $request = (new ListLocalInventoriesRequest()) - ->setParent($formattedParent); + $request = (new ListLocalInventoriesRequest())->setParent($formattedParent); try { $gapicClient->listLocalInventories($request); // If the $gapicClient method call did not throw, fail the test @@ -298,14 +308,16 @@ public function deleteLocalInventoryAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->localInventoryName('[ACCOUNT]', '[PRODUCT]', '[STORE_CODE]'); - $request = (new DeleteLocalInventoryRequest()) - ->setName($formattedName); + $request = (new DeleteLocalInventoryRequest())->setName($formattedName); $gapicClient->deleteLocalInventoryAsync($request)->wait(); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.LocalInventoryService/DeleteLocalInventory', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1beta.LocalInventoryService/DeleteLocalInventory', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); diff --git a/ShoppingMerchantInventories/tests/Unit/V1beta/Client/RegionalInventoryServiceClientTest.php b/ShoppingMerchantInventories/tests/Unit/V1beta/Client/RegionalInventoryServiceClientTest.php index e615063ee97..beb39f0bd0b 100644 --- a/ShoppingMerchantInventories/tests/Unit/V1beta/Client/RegionalInventoryServiceClientTest.php +++ b/ShoppingMerchantInventories/tests/Unit/V1beta/Client/RegionalInventoryServiceClientTest.php @@ -52,7 +52,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return RegionalInventoryServiceClient */ @@ -77,14 +79,16 @@ public function deleteRegionalInventoryTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->regionalInventoryName('[ACCOUNT]', '[PRODUCT]', '[REGION]'); - $request = (new DeleteRegionalInventoryRequest()) - ->setName($formattedName); + $request = (new DeleteRegionalInventoryRequest())->setName($formattedName); $gapicClient->deleteRegionalInventory($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.RegionalInventoryService/DeleteRegionalInventory', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1beta.RegionalInventoryService/DeleteRegionalInventory', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -101,17 +105,19 @@ public function deleteRegionalInventoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->regionalInventoryName('[ACCOUNT]', '[PRODUCT]', '[REGION]'); - $request = (new DeleteRegionalInventoryRequest()) - ->setName($formattedName); + $request = (new DeleteRegionalInventoryRequest())->setName($formattedName); try { $gapicClient->deleteRegionalInventory($request); // If the $gapicClient method call did not throw, fail the test @@ -158,7 +164,10 @@ public function insertRegionalInventoryTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.RegionalInventoryService/InsertRegionalInventory', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1beta.RegionalInventoryService/InsertRegionalInventory', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $actualValue = $actualRequestObject->getRegionalInventory(); @@ -177,12 +186,15 @@ public function insertRegionalInventoryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); @@ -216,17 +228,14 @@ public function listRegionalInventoriesTest() // Mock response $nextPageToken = ''; $regionalInventoriesElement = new RegionalInventory(); - $regionalInventories = [ - $regionalInventoriesElement, - ]; + $regionalInventories = [$regionalInventoriesElement]; $expectedResponse = new ListRegionalInventoriesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setRegionalInventories($regionalInventories); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); - $request = (new ListRegionalInventoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRegionalInventoriesRequest())->setParent($formattedParent); $response = $gapicClient->listRegionalInventories($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -236,7 +245,10 @@ public function listRegionalInventoriesTest() $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.RegionalInventoryService/ListRegionalInventories', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1beta.RegionalInventoryService/ListRegionalInventories', + $actualFuncCall + ); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); $this->assertTrue($transport->isExhausted()); @@ -253,17 +265,19 @@ public function listRegionalInventoriesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->productName('[ACCOUNT]', '[PRODUCT]'); - $request = (new ListRegionalInventoriesRequest()) - ->setParent($formattedParent); + $request = (new ListRegionalInventoriesRequest())->setParent($formattedParent); try { $gapicClient->listRegionalInventories($request); // If the $gapicClient method call did not throw, fail the test @@ -290,14 +304,16 @@ public function deleteRegionalInventoryAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->regionalInventoryName('[ACCOUNT]', '[PRODUCT]', '[REGION]'); - $request = (new DeleteRegionalInventoryRequest()) - ->setName($formattedName); + $request = (new DeleteRegionalInventoryRequest())->setName($formattedName); $gapicClient->deleteRegionalInventoryAsync($request)->wait(); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.shopping.merchant.inventories.v1beta.RegionalInventoryService/DeleteRegionalInventory', $actualFuncCall); + $this->assertSame( + '/google.shopping.merchant.inventories.v1beta.RegionalInventoryService/DeleteRegionalInventory', + $actualFuncCall + ); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); From 34f83311f1ff543075b1b5faec7b0953942d0410 Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Fri, 21 Aug 2026 15:30:56 +0000 Subject: [PATCH 08/21] chore: updatre owlbot.py --- Workflows/owlbot.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Workflows/owlbot.py b/Workflows/owlbot.py index 7acb0f50ece..f3c11a515c5 100644 --- a/Workflows/owlbot.py +++ b/Workflows/owlbot.py @@ -101,3 +101,17 @@ r"(.{0,})\]\((/.{0,})\)", r"\1](https://cloud.google.com\2)" ) + +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.19', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) From b959983f1889a7ae3ed158c20af21dd36f84ef39 Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Fri, 21 Aug 2026 15:34:28 +0000 Subject: [PATCH 09/21] format --- .../Executions/V1/Client/ExecutionsClient.php | 4 +- Workflows/src/V1/Client/WorkflowsClient.php | 24 ++- .../V1/Client/ExecutionsClientTest.php | 97 +++++----- .../Unit/V1/Client/WorkflowsClientTest.php | 166 ++++++++++-------- 4 files changed, 154 insertions(+), 137 deletions(-) diff --git a/Workflows/src/Executions/V1/Client/ExecutionsClient.php b/Workflows/src/Executions/V1/Client/ExecutionsClient.php index c99b9a8a85c..6ae9c04336e 100644 --- a/Workflows/src/Executions/V1/Client/ExecutionsClient.php +++ b/Workflows/src/Executions/V1/Client/ExecutionsClient.php @@ -88,9 +88,7 @@ final class ExecutionsClient * * @internal */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; + public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform']; private static function getClientDefaults() { diff --git a/Workflows/src/V1/Client/WorkflowsClient.php b/Workflows/src/V1/Client/WorkflowsClient.php index eaa5dba80e6..688b54b230a 100644 --- a/Workflows/src/V1/Client/WorkflowsClient.php +++ b/Workflows/src/V1/Client/WorkflowsClient.php @@ -101,9 +101,7 @@ final class WorkflowsClient * * @internal */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - ]; + public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform']; private $operationsClient; @@ -149,7 +147,10 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = $methodName && isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = + $methodName && isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; @@ -207,8 +208,13 @@ public static function cryptoKeyName(string $project, string $location, string $ * * @return string The formatted crypto_key_version resource. */ - public static function cryptoKeyVersionName(string $project, string $location, string $keyRing, string $cryptoKey, string $cryptoKeyVersion): string - { + public static function cryptoKeyVersionName( + string $project, + string $location, + string $keyRing, + string $cryptoKey, + string $cryptoKeyVersion + ): string { return self::getPathTemplate('cryptoKeyVersion')->render([ 'project' => $project, 'location' => $location, @@ -470,8 +476,10 @@ public function getWorkflow(GetWorkflowRequest $request, array $callOptions = [] * * @throws ApiException Thrown if the API call fails. */ - public function listWorkflowRevisions(ListWorkflowRevisionsRequest $request, array $callOptions = []): PagedListResponse - { + public function listWorkflowRevisions( + ListWorkflowRevisionsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListWorkflowRevisions', $request, $callOptions); } diff --git a/Workflows/tests/Unit/Executions/V1/Client/ExecutionsClientTest.php b/Workflows/tests/Unit/Executions/V1/Client/ExecutionsClientTest.php index 373e5f43077..768badee8b7 100644 --- a/Workflows/tests/Unit/Executions/V1/Client/ExecutionsClientTest.php +++ b/Workflows/tests/Unit/Executions/V1/Client/ExecutionsClientTest.php @@ -52,7 +52,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return ExecutionsClient */ @@ -85,8 +87,7 @@ public function cancelExecutionTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - $request = (new CancelExecutionRequest()) - ->setName($formattedName); + $request = (new CancelExecutionRequest())->setName($formattedName); $response = $gapicClient->cancelExecution($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -110,17 +111,19 @@ public function cancelExecutionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - $request = (new CancelExecutionRequest()) - ->setName($formattedName); + $request = (new CancelExecutionRequest())->setName($formattedName); try { $gapicClient->cancelExecution($request); // If the $gapicClient method call did not throw, fail the test @@ -156,9 +159,7 @@ public function createExecutionTest() // Mock request $formattedParent = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); $execution = new Execution(); - $request = (new CreateExecutionRequest()) - ->setParent($formattedParent) - ->setExecution($execution); + $request = (new CreateExecutionRequest())->setParent($formattedParent)->setExecution($execution); $response = $gapicClient->createExecution($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -184,19 +185,20 @@ public function createExecutionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); $execution = new Execution(); - $request = (new CreateExecutionRequest()) - ->setParent($formattedParent) - ->setExecution($execution); + $request = (new CreateExecutionRequest())->setParent($formattedParent)->setExecution($execution); try { $gapicClient->createExecution($request); // If the $gapicClient method call did not throw, fail the test @@ -231,8 +233,7 @@ public function getExecutionTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - $request = (new GetExecutionRequest()) - ->setName($formattedName); + $request = (new GetExecutionRequest())->setName($formattedName); $response = $gapicClient->getExecution($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -256,17 +257,19 @@ public function getExecutionExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - $request = (new GetExecutionRequest()) - ->setName($formattedName); + $request = (new GetExecutionRequest())->setName($formattedName); try { $gapicClient->getExecution($request); // If the $gapicClient method call did not throw, fail the test @@ -291,17 +294,14 @@ public function listExecutionsTest() // Mock response $nextPageToken = ''; $executionsElement = new Execution(); - $executions = [ - $executionsElement, - ]; + $executions = [$executionsElement]; $expectedResponse = new ListExecutionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setExecutions($executions); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new ListExecutionsRequest()) - ->setParent($formattedParent); + $request = (new ListExecutionsRequest())->setParent($formattedParent); $response = $gapicClient->listExecutions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -328,17 +328,19 @@ public function listExecutionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new ListExecutionsRequest()) - ->setParent($formattedParent); + $request = (new ListExecutionsRequest())->setParent($formattedParent); try { $gapicClient->listExecutions($request); // If the $gapicClient method call did not throw, fail the test @@ -373,8 +375,7 @@ public function cancelExecutionAsyncTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->executionName('[PROJECT]', '[LOCATION]', '[WORKFLOW]', '[EXECUTION]'); - $request = (new CancelExecutionRequest()) - ->setName($formattedName); + $request = (new CancelExecutionRequest())->setName($formattedName); $response = $gapicClient->cancelExecutionAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/Workflows/tests/Unit/V1/Client/WorkflowsClientTest.php b/Workflows/tests/Unit/V1/Client/WorkflowsClientTest.php index b8faf3eb756..719e18ad257 100644 --- a/Workflows/tests/Unit/V1/Client/WorkflowsClientTest.php +++ b/Workflows/tests/Unit/V1/Client/WorkflowsClientTest.php @@ -64,7 +64,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return WorkflowsClient */ @@ -186,12 +188,15 @@ public function createWorkflowExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -254,8 +259,7 @@ public function deleteWorkflowTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new DeleteWorkflowRequest()) - ->setName($formattedName); + $request = (new DeleteWorkflowRequest())->setName($formattedName); $response = $gapicClient->deleteWorkflow($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -311,17 +315,19 @@ public function deleteWorkflowExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new DeleteWorkflowRequest()) - ->setName($formattedName); + $request = (new DeleteWorkflowRequest())->setName($formattedName); $response = $gapicClient->deleteWorkflow($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -371,8 +377,7 @@ public function getWorkflowTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new GetWorkflowRequest()) - ->setName($formattedName); + $request = (new GetWorkflowRequest())->setName($formattedName); $response = $gapicClient->getWorkflow($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -396,17 +401,19 @@ public function getWorkflowExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new GetWorkflowRequest()) - ->setName($formattedName); + $request = (new GetWorkflowRequest())->setName($formattedName); try { $gapicClient->getWorkflow($request); // If the $gapicClient method call did not throw, fail the test @@ -431,17 +438,14 @@ public function listWorkflowRevisionsTest() // Mock response $nextPageToken = ''; $workflowsElement = new Workflow(); - $workflows = [ - $workflowsElement, - ]; + $workflows = [$workflowsElement]; $expectedResponse = new ListWorkflowRevisionsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setWorkflows($workflows); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new ListWorkflowRevisionsRequest()) - ->setName($formattedName); + $request = (new ListWorkflowRevisionsRequest())->setName($formattedName); $response = $gapicClient->listWorkflowRevisions($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -468,17 +472,19 @@ public function listWorkflowRevisionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->workflowName('[PROJECT]', '[LOCATION]', '[WORKFLOW]'); - $request = (new ListWorkflowRevisionsRequest()) - ->setName($formattedName); + $request = (new ListWorkflowRevisionsRequest())->setName($formattedName); try { $gapicClient->listWorkflowRevisions($request); // If the $gapicClient method call did not throw, fail the test @@ -503,17 +509,14 @@ public function listWorkflowsTest() // Mock response $nextPageToken = ''; $workflowsElement = new Workflow(); - $workflows = [ - $workflowsElement, - ]; + $workflows = [$workflowsElement]; $expectedResponse = new ListWorkflowsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setWorkflows($workflows); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListWorkflowsRequest()) - ->setParent($formattedParent); + $request = (new ListWorkflowsRequest())->setParent($formattedParent); $response = $gapicClient->listWorkflows($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -540,17 +543,19 @@ public function listWorkflowsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $request = (new ListWorkflowsRequest()) - ->setParent($formattedParent); + $request = (new ListWorkflowsRequest())->setParent($formattedParent); try { $gapicClient->listWorkflows($request); // If the $gapicClient method call did not throw, fail the test @@ -609,8 +614,7 @@ public function updateWorkflowTest() $operationsTransport->addResponse($completeOperation); // Mock request $workflow = new Workflow(); - $request = (new UpdateWorkflowRequest()) - ->setWorkflow($workflow); + $request = (new UpdateWorkflowRequest())->setWorkflow($workflow); $response = $gapicClient->updateWorkflow($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -666,17 +670,19 @@ public function updateWorkflowExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $workflow = new Workflow(); - $request = (new UpdateWorkflowRequest()) - ->setWorkflow($workflow); + $request = (new UpdateWorkflowRequest())->setWorkflow($workflow); $response = $gapicClient->updateWorkflow($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -738,12 +744,15 @@ public function getLocationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new GetLocationRequest(); try { @@ -770,9 +779,7 @@ public function listLocationsTest() // Mock response $nextPageToken = ''; $locationsElement = new Location(); - $locations = [ - $locationsElement, - ]; + $locations = [$locationsElement]; $expectedResponse = new ListLocationsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLocations($locations); @@ -802,12 +809,15 @@ public function listLocationsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); $request = new ListLocationsRequest(); try { From 863d3f8126fcdf738e76e66fdad9850f589448ff Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Fri, 21 Aug 2026 17:58:30 +0000 Subject: [PATCH 10/21] chore: rm obsolete samples --- .../create_ssh_public_key.php | 69 ------------------ .../delete_posix_account.php | 66 ----------------- .../delete_ssh_public_key.php | 66 ----------------- .../get_login_profile.php | 67 ----------------- .../get_ssh_public_key.php | 68 ------------------ .../import_ssh_public_key.php | 59 --------------- .../sign_ssh_public_key.php | 53 -------------- .../update_ssh_public_key.php | 72 ------------------- 8 files changed, 520 deletions(-) delete mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/create_ssh_public_key.php delete mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/delete_posix_account.php delete mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/delete_ssh_public_key.php delete mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/get_login_profile.php delete mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/get_ssh_public_key.php delete mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/import_ssh_public_key.php delete mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/sign_ssh_public_key.php delete mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/update_ssh_public_key.php diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/create_ssh_public_key.php b/OsLogin/samples/V1beta/OsLoginServiceClient/create_ssh_public_key.php deleted file mode 100644 index 74e3ff5cbd5..00000000000 --- a/OsLogin/samples/V1beta/OsLoginServiceClient/create_ssh_public_key.php +++ /dev/null @@ -1,69 +0,0 @@ -createSshPublicKey($formattedParent, $sshPublicKey); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = OsLoginServiceClient::userName('[USER]'); - - create_ssh_public_key_sample($formattedParent); -} -// [END oslogin_v1beta_generated_OsLoginService_CreateSshPublicKey_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/delete_posix_account.php b/OsLogin/samples/V1beta/OsLoginServiceClient/delete_posix_account.php deleted file mode 100644 index 9b841ea60b5..00000000000 --- a/OsLogin/samples/V1beta/OsLoginServiceClient/delete_posix_account.php +++ /dev/null @@ -1,66 +0,0 @@ -deletePosixAccount($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = OsLoginServiceClient::posixAccountName('[USER]', '[PROJECT]'); - - delete_posix_account_sample($formattedName); -} -// [END oslogin_v1beta_generated_OsLoginService_DeletePosixAccount_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/delete_ssh_public_key.php b/OsLogin/samples/V1beta/OsLoginServiceClient/delete_ssh_public_key.php deleted file mode 100644 index 9b5a69db648..00000000000 --- a/OsLogin/samples/V1beta/OsLoginServiceClient/delete_ssh_public_key.php +++ /dev/null @@ -1,66 +0,0 @@ -deleteSshPublicKey($formattedName); - printf('Call completed successfully.' . PHP_EOL); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = OsLoginServiceClient::sshPublicKeyName('[USER]', '[FINGERPRINT]'); - - delete_ssh_public_key_sample($formattedName); -} -// [END oslogin_v1beta_generated_OsLoginService_DeleteSshPublicKey_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/get_login_profile.php b/OsLogin/samples/V1beta/OsLoginServiceClient/get_login_profile.php deleted file mode 100644 index 0230c7ad6c1..00000000000 --- a/OsLogin/samples/V1beta/OsLoginServiceClient/get_login_profile.php +++ /dev/null @@ -1,67 +0,0 @@ -getLoginProfile($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = OsLoginServiceClient::userName('[USER]'); - - get_login_profile_sample($formattedName); -} -// [END oslogin_v1beta_generated_OsLoginService_GetLoginProfile_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/get_ssh_public_key.php b/OsLogin/samples/V1beta/OsLoginServiceClient/get_ssh_public_key.php deleted file mode 100644 index 397939f37be..00000000000 --- a/OsLogin/samples/V1beta/OsLoginServiceClient/get_ssh_public_key.php +++ /dev/null @@ -1,68 +0,0 @@ -getSshPublicKey($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = OsLoginServiceClient::sshPublicKeyName('[USER]', '[FINGERPRINT]'); - - get_ssh_public_key_sample($formattedName); -} -// [END oslogin_v1beta_generated_OsLoginService_GetSshPublicKey_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/import_ssh_public_key.php b/OsLogin/samples/V1beta/OsLoginServiceClient/import_ssh_public_key.php deleted file mode 100644 index 0d47c89a8b6..00000000000 --- a/OsLogin/samples/V1beta/OsLoginServiceClient/import_ssh_public_key.php +++ /dev/null @@ -1,59 +0,0 @@ -importSshPublicKey($sshPublicKey); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END oslogin_v1beta_generated_OsLoginService_ImportSshPublicKey_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/sign_ssh_public_key.php b/OsLogin/samples/V1beta/OsLoginServiceClient/sign_ssh_public_key.php deleted file mode 100644 index bbfb72f2de9..00000000000 --- a/OsLogin/samples/V1beta/OsLoginServiceClient/sign_ssh_public_key.php +++ /dev/null @@ -1,53 +0,0 @@ -signSshPublicKey(); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END oslogin_v1beta_generated_OsLoginService_SignSshPublicKey_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/update_ssh_public_key.php b/OsLogin/samples/V1beta/OsLoginServiceClient/update_ssh_public_key.php deleted file mode 100644 index 9d9cc071690..00000000000 --- a/OsLogin/samples/V1beta/OsLoginServiceClient/update_ssh_public_key.php +++ /dev/null @@ -1,72 +0,0 @@ -updateSshPublicKey($formattedName, $sshPublicKey); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = OsLoginServiceClient::sshPublicKeyName('[USER]', '[FINGERPRINT]'); - - update_ssh_public_key_sample($formattedName); -} -// [END oslogin_v1beta_generated_OsLoginService_UpdateSshPublicKey_sync] From 71082e477e155462712482e6beaa27cff6d400e4 Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Fri, 21 Aug 2026 18:22:07 +0000 Subject: [PATCH 11/21] update config --- librarian.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/librarian.yaml b/librarian.yaml index e0dcfa80d11..e8ce0a004bc 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -1290,6 +1290,10 @@ libraries: version: 2.2.0 apis: - path: google/cloud/oslogin/v1 + - path: google/cloud/oslogin/common + php: + generate_gapic: false + staging_subdir: common-protos output: OsLogin - name: parallelstore version: 0.14.0 From 499b94d9c190be5d363fffd60bfead7def349c65 Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Fri, 21 Aug 2026 18:22:33 +0000 Subject: [PATCH 12/21] chore: update owlbot.py --- OsLogin/owlbot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OsLogin/owlbot.py b/OsLogin/owlbot.py index ee8d3ef0a17..7d3128f2b59 100644 --- a/OsLogin/owlbot.py +++ b/OsLogin/owlbot.py @@ -30,6 +30,13 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) +# copy "common" protos +php.owlbot_copy_version( + src=src / "common-protos", + dest=dest, + version_string="common", +) + php.owlbot_main(src=src, dest=dest) # format generated clients From a0c7ce7eb117d08d71786de4a131ed3c3c747f3a Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Sun, 23 Aug 2026 00:18:55 +0000 Subject: [PATCH 13/21] update library --- OsLogin/metadata/Common/Common.php | Bin 1639 -> 2217 bytes OsLogin/metadata/V1/Oslogin.php | 51 +----------------- OsLogin/owlbot.py | 25 ++++++--- OsLogin/src/Common/PosixAccount.php | 2 +- OsLogin/src/Common/SshPublicKey.php | 14 ++--- OsLogin/src/V1/CreateSshPublicKeyRequest.php | 2 +- OsLogin/src/V1/DeletePosixAccountRequest.php | 2 +- OsLogin/src/V1/DeleteSshPublicKeyRequest.php | 2 +- OsLogin/src/V1/GetLoginProfileRequest.php | 2 +- OsLogin/src/V1/GetSshPublicKeyRequest.php | 2 +- OsLogin/src/V1/ImportSshPublicKeyRequest.php | 8 +-- OsLogin/src/V1/ImportSshPublicKeyResponse.php | 2 +- OsLogin/src/V1/LoginProfile.php | 8 +-- OsLogin/src/V1/UpdateSshPublicKeyRequest.php | 2 +- 14 files changed, 40 insertions(+), 82 deletions(-) diff --git a/OsLogin/metadata/Common/Common.php b/OsLogin/metadata/Common/Common.php index 58e5d425988ea0d4b0b5b1d94b5cba370ed0c736..012990fbfd524ad955ed52b2d4df9d6a30ae4e71 100644 GIT binary patch literal 2217 zcma)7{g2`{5dA%Wh3}&h*N;G!{UY0Km4tv$?+990U9XCSLNMTKh@;r4*q->`J7YV6 zWtUTtATfC}^Ze$;^Xu=$rm)_TAWW zGFc`viH9ma4lq8BbbK7B_&du=vqT7@m)19nz^AAd8B2+fiG<60Cgv<>k|i1Y7xr;a zR!Jr(gucYCsyvm9=L7?yJf*DMAC@hF$H%#$qcQ<0Xeki47# z)OFWXHUi>5tq-OwreiD8(i~m)1<89N%ZeUXC#0mZD)T$V8x!oCyZ9Boyn@98Mzf_) zH_1PYm#%x*)gj5b&XH!GsI8^U{=8xzrUp zNDZIe6eZgxj}EHI1XHn@s1xfCiakY}Hs1ML{q@|6rp*p|8WK5|bXPFcjpuX8z#&jN zHSIju(l}1p8q51D(3zItcl8oriGw{)q|mHhmG9uzlNk3w$)|dIPQKHfx1MPyj&uP5 zkNEC?oSD6M&oui7eEueygb&_qG#<{UU#7G0(|q=263!pT(@7YN2BQ#O6bD~u_$t{! zS>?*BkE8M9pXMR-=~+*1K99!z==0P(zJOj0Fp24>GXP_J&!5=aAQB&O45|t8*QGw! zYEOf&*8KHBSuF1KsaGuGori5iTl+&bA#F7wZIjv#)P#g%_XHN3NeZJ>ae%c!hBY$O z30+rZbX|jlb%XSN(powGnOEZx{BM*Cj@t^vJJ;|sNZx(hOo^ZMv^yG(X9uG~>hZO= H_LlV@wo>Ru delta 593 zcmY*WO^ee&7&eopN#16=?f9{&kyh%;DhmpFtEbdODV9yKF6*HZvgw!xlT64Yutj8l z#9Rf>3W8oed-CER@Ze48$zLE&(yicWcpm0`pO5!_`Zh%~bb5j;T zETaYL+>l+vlpE7fzR=5p1Te6(QuGpki)DD2R zc2shD$qnV7wu~LPOjDA1d6)$5`Bc74i3#FQlfSLq>)>}Lb z1EqJ?|001gWs6C15{3Q~vMiIlBJ0#Tz6O`bX&RO~G;#A#gc2?IRRc0Mq484alT1{V zr_BPUGA8TsxbY(kmgR+PQVR9#+G>C}DyNb5;pFA(>`zBm;HsPjKBhN%Md=vQB zdcW7YfOSyDqr;=;ElJo_k4J|G&hfN`hQB4~@du(!gS+Zb{(vn0QMGozA?tCaH=8|- zXfdD795ya(2u$OcCM(qCf7GtBviHH_+scl0ByNq3^5X37>+*SXQcp9Q)BAgzXa|1* DdFr0i diff --git a/OsLogin/metadata/V1/Oslogin.php b/OsLogin/metadata/V1/Oslogin.php index 8c82c08fb98..2bf0c3bc725 100644 --- a/OsLogin/metadata/V1/Oslogin.php +++ b/OsLogin/metadata/V1/Oslogin.php @@ -22,56 +22,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); $pool->internalAddGeneratedFile( - ' -’ -%google/cloud/oslogin/v1/oslogin.protogoogle.cloud.oslogin.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto(google/cloud/oslogin/common/common.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"˜ - LoginProfile -name ( BàAA -posix_accounts ( 2).google.cloud.oslogin.common.PosixAccountQ -ssh_public_keys ( 28.google.cloud.oslogin.v1.LoginProfile.SshPublicKeysEntry_ -SshPublicKeysEntry -key ( 8 -value ( 2).google.cloud.oslogin.common.SshPublicKey:8"  -CreateSshPublicKeyRequest; -parent ( B+àAúA%#oslogin.googleapis.com/SshPublicKeyF -ssh_public_key ( 2).google.cloud.oslogin.common.SshPublicKeyBàA"V -DeletePosixAccountRequest9 -name ( B+àAúA% -#oslogin.googleapis.com/PosixAccount"V -DeleteSshPublicKeyRequest9 -name ( B+àAúA% -#oslogin.googleapis.com/SshPublicKey"z -GetLoginProfileRequest9 -name ( B+àAúA%#oslogin.googleapis.com/PosixAccount - -project_id (  - system_id ( "S -GetSshPublicKeyRequest9 -name ( B+àAúA% -#oslogin.googleapis.com/SshPublicKey"Ê -ImportSshPublicKeyRequest; -parent ( B+àAúA%#oslogin.googleapis.com/SshPublicKeyF -ssh_public_key ( 2).google.cloud.oslogin.common.SshPublicKeyBàA - -project_id (  -regions ( BàA"k -ImportSshPublicKeyResponse< - login_profile ( 2%.google.cloud.oslogin.v1.LoginProfile -details ( "Ï -UpdateSshPublicKeyRequest9 -name ( B+àAúA% -#oslogin.googleapis.com/SshPublicKeyF -ssh_public_key ( 2).google.cloud.oslogin.common.SshPublicKeyBàA/ - update_mask ( 2.google.protobuf.FieldMask2† -OsLoginServiceÇ -CreateSshPublicKey2.google.cloud.oslogin.v1.CreateSshPublicKeyRequest).google.cloud.oslogin.common.SshPublicKey"RÚAparent,ssh_public_key‚Óä“4""/v1/{parent=users/*}/sshPublicKeys:ssh_public_keyŽ -DeletePosixAccount2.google.cloud.oslogin.v1.DeletePosixAccountRequest.google.protobuf.Empty",ÚAname‚Óä“*/v1/{name=users/*/projects/*}“ -DeleteSshPublicKey2.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest.google.protobuf.Empty"1ÚAname‚Óä“$*"/v1/{name=users/*/sshPublicKeys/*}™ -GetLoginProfile/.google.cloud.oslogin.v1.GetLoginProfileRequest%.google.cloud.oslogin.v1.LoginProfile".ÚAname‚Óä“!/v1/{name=users/*}/loginProfile  -GetSshPublicKey/.google.cloud.oslogin.v1.GetSshPublicKeyRequest).google.cloud.oslogin.common.SshPublicKey"1ÚAname‚Óä“$"/v1/{name=users/*/sshPublicKeys/*}ù -ImportSshPublicKey2.google.cloud.oslogin.v1.ImportSshPublicKeyRequest3.google.cloud.oslogin.v1.ImportSshPublicKeyResponse"zÚAparent,ssh_public_keyÚA parent,ssh_public_key,project_id‚Óä“9"\'/v1/{parent=users/*}:importSshPublicKey:ssh_public_keyç -UpdateSshPublicKey2.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest).google.cloud.oslogin.common.SshPublicKey"rÚAname,ssh_public_keyÚAname,ssh_public_key,update_mask‚Óä“42"/v1/{name=users/*/sshPublicKeys/*}:ssh_public_keyÝÊAoslogin.googleapis.comÒAÀhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonlyBµ -com.google.cloud.oslogin.v1B OsLoginProtoPZ5cloud.google.com/go/oslogin/apiv1/osloginpb;osloginpbªGoogle.Cloud.OsLogin.V1ÊGoogle\\Cloud\\OsLogin\\V1êGoogle::Cloud::OsLogin::V1bproto3' + "\x0A\x92\x1A\x0A%google/cloud/oslogin/v1/oslogin.proto\x12\x17google.cloud.oslogin.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A(google/cloud/oslogin/common/common.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\"\x98\x02\x0A\x0CLoginProfile\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12A\x0A\x0Eposix_accounts\x18\x02 \x03(\x0B2).google.cloud.oslogin.common.PosixAccount\x12Q\x0A\x0Fssh_public_keys\x18\x03 \x03(\x0B28.google.cloud.oslogin.v1.LoginProfile.SshPublicKeysEntry\x1A_\x0A\x12SshPublicKeysEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x128\x0A\x05value\x18\x02 \x01(\x0B2).google.cloud.oslogin.common.SshPublicKey:\x028\x01\"\xA0\x01\x0A\x19CreateSshPublicKeyRequest\x12;\x0A\x06parent\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x12#oslogin.googleapis.com/SshPublicKey\x12F\x0A\x0Essh_public_key\x18\x02 \x01(\x0B2).google.cloud.oslogin.common.SshPublicKeyB\x03\xE0A\x02\"V\x0A\x19DeletePosixAccountRequest\x129\x0A\x04name\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x0A#oslogin.googleapis.com/PosixAccount\"V\x0A\x19DeleteSshPublicKeyRequest\x129\x0A\x04name\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x0A#oslogin.googleapis.com/SshPublicKey\"z\x0A\x16GetLoginProfileRequest\x129\x0A\x04name\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x12#oslogin.googleapis.com/PosixAccount\x12\x12\x0A\x0Aproject_id\x18\x02 \x01(\x09\x12\x11\x0A\x09system_id\x18\x03 \x01(\x09\"S\x0A\x16GetSshPublicKeyRequest\x129\x0A\x04name\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x0A#oslogin.googleapis.com/SshPublicKey\"\xCA\x01\x0A\x19ImportSshPublicKeyRequest\x12;\x0A\x06parent\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x12#oslogin.googleapis.com/SshPublicKey\x12F\x0A\x0Essh_public_key\x18\x02 \x01(\x0B2).google.cloud.oslogin.common.SshPublicKeyB\x03\xE0A\x01\x12\x12\x0A\x0Aproject_id\x18\x03 \x01(\x09\x12\x14\x0A\x07regions\x18\x05 \x03(\x09B\x03\xE0A\x01\"k\x0A\x1AImportSshPublicKeyResponse\x12<\x0A\x0Dlogin_profile\x18\x01 \x01(\x0B2%.google.cloud.oslogin.v1.LoginProfile\x12\x0F\x0A\x07details\x18\x02 \x01(\x09\"\xCF\x01\x0A\x19UpdateSshPublicKeyRequest\x129\x0A\x04name\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x0A#oslogin.googleapis.com/SshPublicKey\x12F\x0A\x0Essh_public_key\x18\x02 \x01(\x0B2).google.cloud.oslogin.common.SshPublicKeyB\x03\xE0A\x02\x12/\x0A\x0Bupdate_mask\x18\x03 \x01(\x0B2\x1A.google.protobuf.FieldMask2\x86\x0C\x0A\x0EOsLoginService\x12\xC7\x01\x0A\x12CreateSshPublicKey\x122.google.cloud.oslogin.v1.CreateSshPublicKeyRequest\x1A).google.cloud.oslogin.common.SshPublicKey\"R\xDAA\x15parent,ssh_public_key\x82\xD3\xE4\x93\x024\"\"/v1/{parent=users/*}/sshPublicKeys:\x0Essh_public_key\x12\x8E\x01\x0A\x12DeletePosixAccount\x122.google.cloud.oslogin.v1.DeletePosixAccountRequest\x1A\x16.google.protobuf.Empty\",\xDAA\x04name\x82\xD3\xE4\x93\x02\x1F*\x1D/v1/{name=users/*/projects/*}\x12\x93\x01\x0A\x12DeleteSshPublicKey\x122.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest\x1A\x16.google.protobuf.Empty\"1\xDAA\x04name\x82\xD3\xE4\x93\x02\$*\"/v1/{name=users/*/sshPublicKeys/*}\x12\x99\x01\x0A\x0FGetLoginProfile\x12/.google.cloud.oslogin.v1.GetLoginProfileRequest\x1A%.google.cloud.oslogin.v1.LoginProfile\".\xDAA\x04name\x82\xD3\xE4\x93\x02!\x12\x1F/v1/{name=users/*}/loginProfile\x12\xA0\x01\x0A\x0FGetSshPublicKey\x12/.google.cloud.oslogin.v1.GetSshPublicKeyRequest\x1A).google.cloud.oslogin.common.SshPublicKey\"1\xDAA\x04name\x82\xD3\xE4\x93\x02\$\x12\"/v1/{name=users/*/sshPublicKeys/*}\x12\xF9\x01\x0A\x12ImportSshPublicKey\x122.google.cloud.oslogin.v1.ImportSshPublicKeyRequest\x1A3.google.cloud.oslogin.v1.ImportSshPublicKeyResponse\"z\xDAA\x15parent,ssh_public_key\xDAA parent,ssh_public_key,project_id\x82\xD3\xE4\x93\x029\"'/v1/{parent=users/*}:importSshPublicKey:\x0Essh_public_key\x12\xE7\x01\x0A\x12UpdateSshPublicKey\x122.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest\x1A).google.cloud.oslogin.common.SshPublicKey\"r\xDAA\x13name,ssh_public_key\xDAA\x1Fname,ssh_public_key,update_mask\x82\xD3\xE4\x93\x0242\"/v1/{name=users/*/sshPublicKeys/*}:\x0Essh_public_key\x1A\xDD\x01\xCAA\x16oslogin.googleapis.com\xD2A\xC0\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonlyB\xB5\x01\x0A\x1Bcom.google.cloud.oslogin.v1B\x0COsLoginProtoP\x01Z5cloud.google.com/go/oslogin/apiv1/osloginpb;osloginpb\xAA\x02\x17Google.Cloud.OsLogin.V1\xCA\x02\x17Google\\Cloud\\OsLogin\\V1\xEA\x02\x1AGoogle::Cloud::OsLogin::V1b\x06proto3" , true); static::$is_initialized = true; diff --git a/OsLogin/owlbot.py b/OsLogin/owlbot.py index 7d3128f2b59..694aa26503b 100644 --- a/OsLogin/owlbot.py +++ b/OsLogin/owlbot.py @@ -15,6 +15,7 @@ """This script is used to synthesize generated parts of this library.""" import logging +import shutil from pathlib import Path import subprocess @@ -30,13 +31,23 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -# copy "common" protos -php.owlbot_copy_version( - src=src / "common-protos", - dest=dest, - version_string="common", -) - +# 1. Handle common protos if staged separately (Librarian pipeline) +if (src / "common-protos").exists(): + php.owlbot_copy_version( + src=src / "common-protos", + dest=dest, + version_string="common", + ) +# 2. Handle common protos bundled inside v1 staging (Legacy OwlBot pipeline) +proto_common = src / "v1/proto/src/Google/Cloud/OsLogin/Common" +metadata_common = src / "v1/proto/src/GPBMetadata/Google/Cloud/Oslogin/Common" +if proto_common.exists(): + s.move([proto_common], dest / "src/Common", merge=php._merge) + shutil.rmtree(proto_common) +if metadata_common.exists(): + s.move([metadata_common], dest / "metadata/Common", merge=php._merge) + shutil.rmtree(metadata_common) +# 3. Copy V1 protos and GAPIC files php.owlbot_main(src=src, dest=dest) # format generated clients diff --git a/OsLogin/src/Common/PosixAccount.php b/OsLogin/src/Common/PosixAccount.php index 99d5713285c..21c5f38b900 100644 --- a/OsLogin/src/Common/PosixAccount.php +++ b/OsLogin/src/Common/PosixAccount.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\Common; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\RepeatedField; /** * The POSIX account information associated with a Google account. diff --git a/OsLogin/src/Common/SshPublicKey.php b/OsLogin/src/Common/SshPublicKey.php index 185588081e3..a6a22948e91 100644 --- a/OsLogin/src/Common/SshPublicKey.php +++ b/OsLogin/src/Common/SshPublicKey.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\Common; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\RepeatedField; /** * The SSH public key information associated with a Google account. @@ -17,8 +17,7 @@ class SshPublicKey extends \Google\Protobuf\Internal\Message { /** * Public key text in SSH format, defined by - * RFC4253 - * section 6.6. + * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6. * * Generated from protobuf field string key = 1; */ @@ -50,8 +49,7 @@ class SshPublicKey extends \Google\Protobuf\Internal\Message * * @type string $key * Public key text in SSH format, defined by - * RFC4253 - * section 6.6. + * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6. * @type int|string $expiration_time_usec * An expiration time in microseconds since epoch. * @type string $fingerprint @@ -67,8 +65,7 @@ public function __construct($data = NULL) { /** * Public key text in SSH format, defined by - * RFC4253 - * section 6.6. + * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6. * * Generated from protobuf field string key = 1; * @return string @@ -80,8 +77,7 @@ public function getKey() /** * Public key text in SSH format, defined by - * RFC4253 - * section 6.6. + * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6. * * Generated from protobuf field string key = 1; * @param string $var diff --git a/OsLogin/src/V1/CreateSshPublicKeyRequest.php b/OsLogin/src/V1/CreateSshPublicKeyRequest.php index 76728c29f5e..42dcb515aba 100644 --- a/OsLogin/src/V1/CreateSshPublicKeyRequest.php +++ b/OsLogin/src/V1/CreateSshPublicKeyRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\RepeatedField; /** * A request message for creating an SSH public key. diff --git a/OsLogin/src/V1/DeletePosixAccountRequest.php b/OsLogin/src/V1/DeletePosixAccountRequest.php index 965160ab977..9759d348125 100644 --- a/OsLogin/src/V1/DeletePosixAccountRequest.php +++ b/OsLogin/src/V1/DeletePosixAccountRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\RepeatedField; /** * A request message for deleting a POSIX account entry. diff --git a/OsLogin/src/V1/DeleteSshPublicKeyRequest.php b/OsLogin/src/V1/DeleteSshPublicKeyRequest.php index 11383a19392..a83f0eee3a4 100644 --- a/OsLogin/src/V1/DeleteSshPublicKeyRequest.php +++ b/OsLogin/src/V1/DeleteSshPublicKeyRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\RepeatedField; /** * A request message for deleting an SSH public key. diff --git a/OsLogin/src/V1/GetLoginProfileRequest.php b/OsLogin/src/V1/GetLoginProfileRequest.php index 85992364fab..592913c0420 100644 --- a/OsLogin/src/V1/GetLoginProfileRequest.php +++ b/OsLogin/src/V1/GetLoginProfileRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\RepeatedField; /** * A request message for retrieving the login profile information for a user. diff --git a/OsLogin/src/V1/GetSshPublicKeyRequest.php b/OsLogin/src/V1/GetSshPublicKeyRequest.php index 6e6de1d0ec8..dbda93eac14 100644 --- a/OsLogin/src/V1/GetSshPublicKeyRequest.php +++ b/OsLogin/src/V1/GetSshPublicKeyRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\RepeatedField; /** * A request message for retrieving an SSH public key. diff --git a/OsLogin/src/V1/ImportSshPublicKeyRequest.php b/OsLogin/src/V1/ImportSshPublicKeyRequest.php index 122ed6f2f13..e7142e79b04 100644 --- a/OsLogin/src/V1/ImportSshPublicKeyRequest.php +++ b/OsLogin/src/V1/ImportSshPublicKeyRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\RepeatedField; /** * A request message for importing an SSH public key. @@ -88,7 +88,7 @@ public static function buildFromParentSshPublicKeyProjectId(string $parent, \Goo * Optional. The SSH public key and expiration time. * @type string $project_id * The project ID of the Google Cloud Platform project. - * @type array|\Google\Protobuf\Internal\RepeatedField $regions + * @type string[] $regions * Optional. The regions to which to assert that the key was written. * If unspecified, defaults to all regions. * Regions are listed at https://cloud.google.com/about/locations#region. @@ -193,7 +193,7 @@ public function setProjectId($var) * Regions are listed at https://cloud.google.com/about/locations#region. * * Generated from protobuf field repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField */ public function getRegions() { @@ -206,7 +206,7 @@ public function getRegions() * Regions are listed at https://cloud.google.com/about/locations#region. * * Generated from protobuf field repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @param string[] $var * @return $this */ public function setRegions($var) diff --git a/OsLogin/src/V1/ImportSshPublicKeyResponse.php b/OsLogin/src/V1/ImportSshPublicKeyResponse.php index c9c749a53be..5a0fb928fe2 100644 --- a/OsLogin/src/V1/ImportSshPublicKeyResponse.php +++ b/OsLogin/src/V1/ImportSshPublicKeyResponse.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\RepeatedField; /** * A response message for importing an SSH public key. diff --git a/OsLogin/src/V1/LoginProfile.php b/OsLogin/src/V1/LoginProfile.php index 6abe567377c..3381d644032 100644 --- a/OsLogin/src/V1/LoginProfile.php +++ b/OsLogin/src/V1/LoginProfile.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\RepeatedField; /** * The user profile information used for logging in to a virtual machine on @@ -43,7 +43,7 @@ class LoginProfile extends \Google\Protobuf\Internal\Message * * @type string $name * Required. A unique user ID. - * @type array<\Google\Cloud\OsLogin\Common\PosixAccount>|\Google\Protobuf\Internal\RepeatedField $posix_accounts + * @type \Google\Cloud\OsLogin\Common\PosixAccount[] $posix_accounts * The list of POSIX accounts associated with the user. * @type array|\Google\Protobuf\Internal\MapField $ssh_public_keys * A map from SSH public key fingerprint to the associated key object. @@ -84,7 +84,7 @@ public function setName($var) * The list of POSIX accounts associated with the user. * * Generated from protobuf field repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; - * @return \Google\Protobuf\Internal\RepeatedField + * @return RepeatedField<\Google\Cloud\OsLogin\Common\PosixAccount> */ public function getPosixAccounts() { @@ -95,7 +95,7 @@ public function getPosixAccounts() * The list of POSIX accounts associated with the user. * * Generated from protobuf field repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; - * @param array<\Google\Cloud\OsLogin\Common\PosixAccount>|\Google\Protobuf\Internal\RepeatedField $var + * @param \Google\Cloud\OsLogin\Common\PosixAccount[] $var * @return $this */ public function setPosixAccounts($var) diff --git a/OsLogin/src/V1/UpdateSshPublicKeyRequest.php b/OsLogin/src/V1/UpdateSshPublicKeyRequest.php index 421c2a2586c..1e00af3a187 100644 --- a/OsLogin/src/V1/UpdateSshPublicKeyRequest.php +++ b/OsLogin/src/V1/UpdateSshPublicKeyRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; -use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; +use Google\Protobuf\RepeatedField; /** * A request message for updating an SSH public key. From be0aa916a5317de97978ac37d3b073e924fa42d7 Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Mon, 24 Aug 2026 15:03:06 +0000 Subject: [PATCH 14/21] update config --- librarian.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/librarian.yaml b/librarian.yaml index e8ce0a004bc..829e1f25c5d 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -1732,11 +1732,13 @@ libraries: version: 2.3.0 apis: - path: google/cloud/videointelligence/v1 + php: + gapic_yaml: google/cloud/videointelligence/v1/videointelligence_gapic.yaml output: VideoIntelligence - name: vision version: 2.3.0 apis: - - path: google/cloud/vision/v1 + - path: google/cloud/vision/v1gs output: Vision - name: visionai version: 0.4.0 From 0466f57ed3faaf7d5b2a4f6f06bb772efda59dbd Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Mon, 24 Aug 2026 15:32:30 +0000 Subject: [PATCH 15/21] update config --- librarian.yaml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/librarian.yaml b/librarian.yaml index 829e1f25c5d..6c6d651d482 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -472,6 +472,35 @@ libraries: - path: google/bigtable/admin/v2 php: staging_subdir: v2/Admin + keep: + - tests/Conformance/proxy/src/GPBMetadata/Google/Bigtable/Testproxy/TestProxy.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CheckAndMutateRowRequest.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CheckAndMutateRowResult.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CloseClientRequest.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CloseClientResponse.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CloudBigtableV2TestProxyInterface.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/OptionalFeatureConfig.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/ReadModifyWriteRowRequest.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/ReadRowRequest.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/ReadRowsRequest.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/RemoveClientRequest.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/RemoveClientResponse.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CreateClientRequest.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CreateClientRequest/SecurityOptions.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CreateClientResponse.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/ExecuteQueryRequest.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/ExecuteQueryResult.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/MutateRowRequest.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/MutateRowResult.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/MutateRowsRequest.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/MutateRowsResult.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/ResultSetMetadata.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/RowResult.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/RowsResult.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/SampleRowKeysRequest.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/SampleRowKeysResult.php + - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/SqlRow.php + - tests/Conformance/proxy/src/Google/Cloud/Bigtable/V2/BigtableInterface.php output: Bigtable - name: billing version: 2.3.0 From c547d0c6eb3dbfdd5e51a0fa511dbfce3e02cec7 Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Mon, 24 Aug 2026 15:39:30 +0000 Subject: [PATCH 16/21] chore: format bigtable --- Bigtable/owlbot.py | 13 + .../V2/Client/BigtableInstanceAdminClient.php | 41 +- .../V2/Client/BigtableTableAdminClient.php | 66 +- Bigtable/src/V2/Client/BigtableClient.php | 32 +- .../BigtableInstanceAdminClientTest.php | 649 ++++++++-------- .../Client/BigtableTableAdminClientTest.php | 735 +++++++++--------- .../Unit/V2/Client/BigtableClientTest.php | 300 +++---- 7 files changed, 984 insertions(+), 852 deletions(-) diff --git a/Bigtable/owlbot.py b/Bigtable/owlbot.py index 00fd9d596e6..19e68ca7623 100644 --- a/Bigtable/owlbot.py +++ b/Bigtable/owlbot.py @@ -54,3 +54,16 @@ s.move(admin_library / f'proto/src/Google/Cloud/Bigtable', f'src/', merge=preserve_copyright_year) s.move(admin_library / f'proto/src/GPBMetadata/Google/Bigtable', f'metadata/', merge=preserve_copyright_year) +# format generated clients +subprocess.run([ + 'npm', + 'exec', + '--yes', + '--package=@prettier/plugin-php@^0.19', + '--', + 'prettier', + '**/Client/*', + '--write', + '--parser=php', + '--single-quote', + '--print-width=120']) diff --git a/Bigtable/src/Admin/V2/Client/BigtableInstanceAdminClient.php b/Bigtable/src/Admin/V2/Client/BigtableInstanceAdminClient.php index cb812a4d13a..b25269907f8 100644 --- a/Bigtable/src/Admin/V2/Client/BigtableInstanceAdminClient.php +++ b/Bigtable/src/Admin/V2/Client/BigtableInstanceAdminClient.php @@ -208,7 +208,10 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = $methodName && isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = + $methodName && isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; @@ -641,8 +644,10 @@ public function createLogicalView(CreateLogicalViewRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function createMaterializedView(CreateMaterializedViewRequest $request, array $callOptions = []): OperationResponse - { + public function createMaterializedView( + CreateMaterializedViewRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateMaterializedView', $request, $callOptions)->wait(); } @@ -1082,8 +1087,10 @@ public function listLogicalViews(ListLogicalViewsRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function listMaterializedViews(ListMaterializedViewsRequest $request, array $callOptions = []): PagedListResponse - { + public function listMaterializedViews( + ListMaterializedViewsRequest $request, + array $callOptions = [] + ): PagedListResponse { return $this->startApiCall('ListMaterializedViews', $request, $callOptions); } @@ -1120,8 +1127,10 @@ public function listMaterializedViews(ListMaterializedViewsRequest $request, arr * * @throws ApiException Thrown if the API call fails. */ - public function partialUpdateCluster(PartialUpdateClusterRequest $request, array $callOptions = []): OperationResponse - { + public function partialUpdateCluster( + PartialUpdateClusterRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('PartialUpdateCluster', $request, $callOptions)->wait(); } @@ -1148,8 +1157,10 @@ public function partialUpdateCluster(PartialUpdateClusterRequest $request, array * * @throws ApiException Thrown if the API call fails. */ - public function partialUpdateInstance(PartialUpdateInstanceRequest $request, array $callOptions = []): OperationResponse - { + public function partialUpdateInstance( + PartialUpdateInstanceRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('PartialUpdateInstance', $request, $callOptions)->wait(); } @@ -1202,8 +1213,10 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } @@ -1341,8 +1354,10 @@ public function updateLogicalView(UpdateLogicalViewRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function updateMaterializedView(UpdateMaterializedViewRequest $request, array $callOptions = []): OperationResponse - { + public function updateMaterializedView( + UpdateMaterializedViewRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateMaterializedView', $request, $callOptions)->wait(); } diff --git a/Bigtable/src/Admin/V2/Client/BigtableTableAdminClient.php b/Bigtable/src/Admin/V2/Client/BigtableTableAdminClient.php index f3f5db0b68f..7b627630af9 100644 --- a/Bigtable/src/Admin/V2/Client/BigtableTableAdminClient.php +++ b/Bigtable/src/Admin/V2/Client/BigtableTableAdminClient.php @@ -221,7 +221,10 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = $methodName && isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $options = + $methodName && isset($this->descriptors[$methodName]['longRunning']) + ? $this->descriptors[$methodName]['longRunning'] + : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; @@ -257,8 +260,12 @@ private function createOperationsClient(array $options) * * @return string The formatted authorized_view resource. */ - public static function authorizedViewName(string $project, string $instance, string $table, string $authorizedView): string - { + public static function authorizedViewName( + string $project, + string $instance, + string $table, + string $authorizedView + ): string { return self::getPathTemplate('authorizedView')->render([ 'project' => $project, 'instance' => $instance, @@ -319,8 +326,13 @@ public static function clusterName(string $project, string $instance, string $cl * * @return string The formatted crypto_key_version resource. */ - public static function cryptoKeyVersionName(string $project, string $location, string $keyRing, string $cryptoKey, string $cryptoKeyVersion): string - { + public static function cryptoKeyVersionName( + string $project, + string $location, + string $keyRing, + string $cryptoKey, + string $cryptoKeyVersion + ): string { return self::getPathTemplate('cryptoKeyVersion')->render([ 'project' => $project, 'location' => $location, @@ -375,8 +387,12 @@ public static function locationName(string $project, string $location): string * * @return string The formatted schema_bundle resource. */ - public static function schemaBundleName(string $project, string $instance, string $table, string $schemaBundle): string - { + public static function schemaBundleName( + string $project, + string $instance, + string $table, + string $schemaBundle + ): string { return self::getPathTemplate('schemaBundle')->render([ 'project' => $project, 'instance' => $instance, @@ -571,8 +587,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function checkConsistency(CheckConsistencyRequest $request, array $callOptions = []): CheckConsistencyResponse - { + public function checkConsistency( + CheckConsistencyRequest $request, + array $callOptions = [] + ): CheckConsistencyResponse { return $this->startApiCall('CheckConsistency', $request, $callOptions)->wait(); } @@ -625,8 +643,10 @@ public function copyBackup(CopyBackupRequest $request, array $callOptions = []): * * @throws ApiException Thrown if the API call fails. */ - public function createAuthorizedView(CreateAuthorizedViewRequest $request, array $callOptions = []): OperationResponse - { + public function createAuthorizedView( + CreateAuthorizedViewRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateAuthorizedView', $request, $callOptions)->wait(); } @@ -747,8 +767,10 @@ public function createTable(CreateTableRequest $request, array $callOptions = [] * * @throws ApiException Thrown if the API call fails. */ - public function createTableFromSnapshot(CreateTableFromSnapshotRequest $request, array $callOptions = []): OperationResponse - { + public function createTableFromSnapshot( + CreateTableFromSnapshotRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('CreateTableFromSnapshot', $request, $callOptions)->wait(); } @@ -931,8 +953,10 @@ public function dropRowRange(DropRowRangeRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function generateConsistencyToken(GenerateConsistencyTokenRequest $request, array $callOptions = []): GenerateConsistencyTokenResponse - { + public function generateConsistencyToken( + GenerateConsistencyTokenRequest $request, + array $callOptions = [] + ): GenerateConsistencyTokenResponse { return $this->startApiCall('GenerateConsistencyToken', $request, $callOptions)->wait(); } @@ -1383,8 +1407,10 @@ public function snapshotTable(SnapshotTableRequest $request, array $callOptions * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse - { + public function testIamPermissions( + TestIamPermissionsRequest $request, + array $callOptions = [] + ): TestIamPermissionsResponse { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } @@ -1436,8 +1462,10 @@ public function undeleteTable(UndeleteTableRequest $request, array $callOptions * * @throws ApiException Thrown if the API call fails. */ - public function updateAuthorizedView(UpdateAuthorizedViewRequest $request, array $callOptions = []): OperationResponse - { + public function updateAuthorizedView( + UpdateAuthorizedViewRequest $request, + array $callOptions = [] + ): OperationResponse { return $this->startApiCall('UpdateAuthorizedView', $request, $callOptions)->wait(); } diff --git a/Bigtable/src/V2/Client/BigtableClient.php b/Bigtable/src/V2/Client/BigtableClient.php index 405f7f8fd3a..45ec3f1c5f3 100644 --- a/Bigtable/src/V2/Client/BigtableClient.php +++ b/Bigtable/src/V2/Client/BigtableClient.php @@ -152,8 +152,12 @@ private static function getClientDefaults() * * @return string The formatted authorized_view resource. */ - public static function authorizedViewName(string $project, string $instance, string $table, string $authorizedView): string - { + public static function authorizedViewName( + string $project, + string $instance, + string $table, + string $authorizedView + ): string { return self::getPathTemplate('authorizedView')->render([ 'project' => $project, 'instance' => $instance, @@ -355,8 +359,10 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function checkAndMutateRow(CheckAndMutateRowRequest $request, array $callOptions = []): CheckAndMutateRowResponse - { + public function checkAndMutateRow( + CheckAndMutateRowRequest $request, + array $callOptions = [] + ): CheckAndMutateRowResponse { return $this->startApiCall('CheckAndMutateRow', $request, $callOptions)->wait(); } @@ -402,8 +408,10 @@ public function executeQuery(ExecuteQueryRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function generateInitialChangeStreamPartitions(GenerateInitialChangeStreamPartitionsRequest $request, array $callOptions = []): ServerStream - { + public function generateInitialChangeStreamPartitions( + GenerateInitialChangeStreamPartitionsRequest $request, + array $callOptions = [] + ): ServerStream { return $this->startApiCall('GenerateInitialChangeStreamPartitions', $request, $callOptions); } @@ -430,8 +438,10 @@ public function generateInitialChangeStreamPartitions(GenerateInitialChangeStrea * * @throws ApiException Thrown if the API call fails. */ - public function getClientConfiguration(GetClientConfigurationRequest $request, array $callOptions = []): ClientConfiguration - { + public function getClientConfiguration( + GetClientConfigurationRequest $request, + array $callOptions = [] + ): ClientConfiguration { return $this->startApiCall('GetClientConfiguration', $request, $callOptions)->wait(); } @@ -658,8 +668,10 @@ public function readChangeStream(ReadChangeStreamRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function readModifyWriteRow(ReadModifyWriteRowRequest $request, array $callOptions = []): ReadModifyWriteRowResponse - { + public function readModifyWriteRow( + ReadModifyWriteRowRequest $request, + array $callOptions = [] + ): ReadModifyWriteRowResponse { return $this->startApiCall('ReadModifyWriteRow', $request, $callOptions)->wait(); } diff --git a/Bigtable/tests/Unit/Admin/V2/Client/BigtableInstanceAdminClientTest.php b/Bigtable/tests/Unit/Admin/V2/Client/BigtableInstanceAdminClientTest.php index 9408fe83731..aef275f247e 100644 --- a/Bigtable/tests/Unit/Admin/V2/Client/BigtableInstanceAdminClientTest.php +++ b/Bigtable/tests/Unit/Admin/V2/Client/BigtableInstanceAdminClientTest.php @@ -96,7 +96,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return BigtableInstanceAdminClient */ @@ -160,12 +162,15 @@ public function createAppProfileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -294,12 +299,15 @@ public function createClusterExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -461,12 +469,15 @@ public function createInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); @@ -624,12 +635,15 @@ public function createLogicalViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -769,12 +783,15 @@ public function createMaterializedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -822,9 +839,7 @@ public function deleteAppProfileTest() // Mock request $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); $ignoreWarnings = true; - $request = (new DeleteAppProfileRequest()) - ->setName($formattedName) - ->setIgnoreWarnings($ignoreWarnings); + $request = (new DeleteAppProfileRequest())->setName($formattedName)->setIgnoreWarnings($ignoreWarnings); $gapicClient->deleteAppProfile($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -849,19 +864,20 @@ public function deleteAppProfileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); $ignoreWarnings = true; - $request = (new DeleteAppProfileRequest()) - ->setName($formattedName) - ->setIgnoreWarnings($ignoreWarnings); + $request = (new DeleteAppProfileRequest())->setName($formattedName)->setIgnoreWarnings($ignoreWarnings); try { $gapicClient->deleteAppProfile($request); // If the $gapicClient method call did not throw, fail the test @@ -888,8 +904,7 @@ public function deleteClusterTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new DeleteClusterRequest()) - ->setName($formattedName); + $request = (new DeleteClusterRequest())->setName($formattedName); $gapicClient->deleteCluster($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -912,17 +927,19 @@ public function deleteClusterExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new DeleteClusterRequest()) - ->setName($formattedName); + $request = (new DeleteClusterRequest())->setName($formattedName); try { $gapicClient->deleteCluster($request); // If the $gapicClient method call did not throw, fail the test @@ -949,8 +966,7 @@ public function deleteInstanceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); + $request = (new DeleteInstanceRequest())->setName($formattedName); $gapicClient->deleteInstance($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -973,17 +989,19 @@ public function deleteInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest()) - ->setName($formattedName); + $request = (new DeleteInstanceRequest())->setName($formattedName); try { $gapicClient->deleteInstance($request); // If the $gapicClient method call did not throw, fail the test @@ -1010,8 +1028,7 @@ public function deleteLogicalViewTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->logicalViewName('[PROJECT]', '[INSTANCE]', '[LOGICAL_VIEW]'); - $request = (new DeleteLogicalViewRequest()) - ->setName($formattedName); + $request = (new DeleteLogicalViewRequest())->setName($formattedName); $gapicClient->deleteLogicalView($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1034,17 +1051,19 @@ public function deleteLogicalViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->logicalViewName('[PROJECT]', '[INSTANCE]', '[LOGICAL_VIEW]'); - $request = (new DeleteLogicalViewRequest()) - ->setName($formattedName); + $request = (new DeleteLogicalViewRequest())->setName($formattedName); try { $gapicClient->deleteLogicalView($request); // If the $gapicClient method call did not throw, fail the test @@ -1071,8 +1090,7 @@ public function deleteMaterializedViewTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->materializedViewName('[PROJECT]', '[INSTANCE]', '[MATERIALIZED_VIEW]'); - $request = (new DeleteMaterializedViewRequest()) - ->setName($formattedName); + $request = (new DeleteMaterializedViewRequest())->setName($formattedName); $gapicClient->deleteMaterializedView($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1095,17 +1113,19 @@ public function deleteMaterializedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->materializedViewName('[PROJECT]', '[INSTANCE]', '[MATERIALIZED_VIEW]'); - $request = (new DeleteMaterializedViewRequest()) - ->setName($formattedName); + $request = (new DeleteMaterializedViewRequest())->setName($formattedName); try { $gapicClient->deleteMaterializedView($request); // If the $gapicClient method call did not throw, fail the test @@ -1138,8 +1158,7 @@ public function getAppProfileTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - $request = (new GetAppProfileRequest()) - ->setName($formattedName); + $request = (new GetAppProfileRequest())->setName($formattedName); $response = $gapicClient->getAppProfile($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1163,17 +1182,19 @@ public function getAppProfileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - $request = (new GetAppProfileRequest()) - ->setName($formattedName); + $request = (new GetAppProfileRequest())->setName($formattedName); try { $gapicClient->getAppProfile($request); // If the $gapicClient method call did not throw, fail the test @@ -1206,8 +1227,7 @@ public function getClusterTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new GetClusterRequest()) - ->setName($formattedName); + $request = (new GetClusterRequest())->setName($formattedName); $response = $gapicClient->getCluster($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1231,17 +1251,19 @@ public function getClusterExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new GetClusterRequest()) - ->setName($formattedName); + $request = (new GetClusterRequest())->setName($formattedName); try { $gapicClient->getCluster($request); // If the $gapicClient method call did not throw, fail the test @@ -1272,8 +1294,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1297,17 +1318,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1342,8 +1365,7 @@ public function getInstanceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); + $request = (new GetInstanceRequest())->setName($formattedName); $response = $gapicClient->getInstance($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1367,17 +1389,19 @@ public function getInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new GetInstanceRequest()) - ->setName($formattedName); + $request = (new GetInstanceRequest())->setName($formattedName); try { $gapicClient->getInstance($request); // If the $gapicClient method call did not throw, fail the test @@ -1412,8 +1436,7 @@ public function getLogicalViewTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->logicalViewName('[PROJECT]', '[INSTANCE]', '[LOGICAL_VIEW]'); - $request = (new GetLogicalViewRequest()) - ->setName($formattedName); + $request = (new GetLogicalViewRequest())->setName($formattedName); $response = $gapicClient->getLogicalView($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1437,17 +1460,19 @@ public function getLogicalViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->logicalViewName('[PROJECT]', '[INSTANCE]', '[LOGICAL_VIEW]'); - $request = (new GetLogicalViewRequest()) - ->setName($formattedName); + $request = (new GetLogicalViewRequest())->setName($formattedName); try { $gapicClient->getLogicalView($request); // If the $gapicClient method call did not throw, fail the test @@ -1482,8 +1507,7 @@ public function getMaterializedViewTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->materializedViewName('[PROJECT]', '[INSTANCE]', '[MATERIALIZED_VIEW]'); - $request = (new GetMaterializedViewRequest()) - ->setName($formattedName); + $request = (new GetMaterializedViewRequest())->setName($formattedName); $response = $gapicClient->getMaterializedView($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1507,17 +1531,19 @@ public function getMaterializedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->materializedViewName('[PROJECT]', '[INSTANCE]', '[MATERIALIZED_VIEW]'); - $request = (new GetMaterializedViewRequest()) - ->setName($formattedName); + $request = (new GetMaterializedViewRequest())->setName($formattedName); try { $gapicClient->getMaterializedView($request); // If the $gapicClient method call did not throw, fail the test @@ -1542,17 +1568,14 @@ public function listAppProfilesTest() // Mock response $nextPageToken = ''; $appProfilesElement = new AppProfile(); - $appProfiles = [ - $appProfilesElement, - ]; + $appProfiles = [$appProfilesElement]; $expectedResponse = new ListAppProfilesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setAppProfiles($appProfiles); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListAppProfilesRequest()) - ->setParent($formattedParent); + $request = (new ListAppProfilesRequest())->setParent($formattedParent); $response = $gapicClient->listAppProfiles($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1579,17 +1602,19 @@ public function listAppProfilesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListAppProfilesRequest()) - ->setParent($formattedParent); + $request = (new ListAppProfilesRequest())->setParent($formattedParent); try { $gapicClient->listAppProfiles($request); // If the $gapicClient method call did not throw, fail the test @@ -1618,8 +1643,7 @@ public function listClustersTest() $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListClustersRequest()) - ->setParent($formattedParent); + $request = (new ListClustersRequest())->setParent($formattedParent); $response = $gapicClient->listClusters($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1643,17 +1667,19 @@ public function listClustersExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListClustersRequest()) - ->setParent($formattedParent); + $request = (new ListClustersRequest())->setParent($formattedParent); try { $gapicClient->listClusters($request); // If the $gapicClient method call did not throw, fail the test @@ -1678,17 +1704,14 @@ public function listHotTabletsTest() // Mock response $nextPageToken = ''; $hotTabletsElement = new HotTablet(); - $hotTablets = [ - $hotTabletsElement, - ]; + $hotTablets = [$hotTabletsElement]; $expectedResponse = new ListHotTabletsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setHotTablets($hotTablets); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new ListHotTabletsRequest()) - ->setParent($formattedParent); + $request = (new ListHotTabletsRequest())->setParent($formattedParent); $response = $gapicClient->listHotTablets($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1715,17 +1738,19 @@ public function listHotTabletsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new ListHotTabletsRequest()) - ->setParent($formattedParent); + $request = (new ListHotTabletsRequest())->setParent($formattedParent); try { $gapicClient->listHotTablets($request); // If the $gapicClient method call did not throw, fail the test @@ -1754,8 +1779,7 @@ public function listInstancesTest() $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); + $request = (new ListInstancesRequest())->setParent($formattedParent); $response = $gapicClient->listInstances($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1779,17 +1803,19 @@ public function listInstancesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListInstancesRequest()) - ->setParent($formattedParent); + $request = (new ListInstancesRequest())->setParent($formattedParent); try { $gapicClient->listInstances($request); // If the $gapicClient method call did not throw, fail the test @@ -1814,17 +1840,14 @@ public function listLogicalViewsTest() // Mock response $nextPageToken = ''; $logicalViewsElement = new LogicalView(); - $logicalViews = [ - $logicalViewsElement, - ]; + $logicalViews = [$logicalViewsElement]; $expectedResponse = new ListLogicalViewsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLogicalViews($logicalViews); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListLogicalViewsRequest()) - ->setParent($formattedParent); + $request = (new ListLogicalViewsRequest())->setParent($formattedParent); $response = $gapicClient->listLogicalViews($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1851,17 +1874,19 @@ public function listLogicalViewsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListLogicalViewsRequest()) - ->setParent($formattedParent); + $request = (new ListLogicalViewsRequest())->setParent($formattedParent); try { $gapicClient->listLogicalViews($request); // If the $gapicClient method call did not throw, fail the test @@ -1886,17 +1911,14 @@ public function listMaterializedViewsTest() // Mock response $nextPageToken = ''; $materializedViewsElement = new MaterializedView(); - $materializedViews = [ - $materializedViewsElement, - ]; + $materializedViews = [$materializedViewsElement]; $expectedResponse = new ListMaterializedViewsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMaterializedViews($materializedViews); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListMaterializedViewsRequest()) - ->setParent($formattedParent); + $request = (new ListMaterializedViewsRequest())->setParent($formattedParent); $response = $gapicClient->listMaterializedViews($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1923,17 +1945,19 @@ public function listMaterializedViewsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListMaterializedViewsRequest()) - ->setParent($formattedParent); + $request = (new ListMaterializedViewsRequest())->setParent($formattedParent); try { $gapicClient->listMaterializedViews($request); // If the $gapicClient method call did not throw, fail the test @@ -1989,9 +2013,7 @@ public function partialUpdateClusterTest() $clusterServeNodes = 1434304124; $cluster->setServeNodes($clusterServeNodes); $updateMask = new FieldMask(); - $request = (new PartialUpdateClusterRequest()) - ->setCluster($cluster) - ->setUpdateMask($updateMask); + $request = (new PartialUpdateClusterRequest())->setCluster($cluster)->setUpdateMask($updateMask); $response = $gapicClient->partialUpdateCluster($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2049,12 +2071,15 @@ public function partialUpdateClusterExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $cluster = new Cluster(); @@ -2063,9 +2088,7 @@ public function partialUpdateClusterExceptionTest() $clusterServeNodes = 1434304124; $cluster->setServeNodes($clusterServeNodes); $updateMask = new FieldMask(); - $request = (new PartialUpdateClusterRequest()) - ->setCluster($cluster) - ->setUpdateMask($updateMask); + $request = (new PartialUpdateClusterRequest())->setCluster($cluster)->setUpdateMask($updateMask); $response = $gapicClient->partialUpdateCluster($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2139,9 +2162,7 @@ public function partialUpdateInstanceTest() ]; $instance->setLabels($instanceLabels); $updateMask = new FieldMask(); - $request = (new PartialUpdateInstanceRequest()) - ->setInstance($instance) - ->setUpdateMask($updateMask); + $request = (new PartialUpdateInstanceRequest())->setInstance($instance)->setUpdateMask($updateMask); $response = $gapicClient->partialUpdateInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2199,12 +2220,15 @@ public function partialUpdateInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $instance = new Instance(); @@ -2220,9 +2244,7 @@ public function partialUpdateInstanceExceptionTest() ]; $instance->setLabels($instanceLabels); $updateMask = new FieldMask(); - $request = (new PartialUpdateInstanceRequest()) - ->setInstance($instance) - ->setUpdateMask($updateMask); + $request = (new PartialUpdateInstanceRequest())->setInstance($instance)->setUpdateMask($updateMask); $response = $gapicClient->partialUpdateInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2263,9 +2285,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2291,19 +2311,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2331,9 +2352,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2359,19 +2378,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -2423,9 +2443,7 @@ public function updateAppProfileTest() // Mock request $appProfile = new AppProfile(); $updateMask = new FieldMask(); - $request = (new UpdateAppProfileRequest()) - ->setAppProfile($appProfile) - ->setUpdateMask($updateMask); + $request = (new UpdateAppProfileRequest())->setAppProfile($appProfile)->setUpdateMask($updateMask); $response = $gapicClient->updateAppProfile($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2483,19 +2501,20 @@ public function updateAppProfileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $appProfile = new AppProfile(); $updateMask = new FieldMask(); - $request = (new UpdateAppProfileRequest()) - ->setAppProfile($appProfile) - ->setUpdateMask($updateMask); + $request = (new UpdateAppProfileRequest())->setAppProfile($appProfile)->setUpdateMask($updateMask); $response = $gapicClient->updateAppProfile($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2556,9 +2575,7 @@ public function updateClusterTest() // Mock request $name = 'name3373707'; $serveNodes = 1288838783; - $request = (new Cluster()) - ->setName($name) - ->setServeNodes($serveNodes); + $request = (new Cluster())->setName($name)->setServeNodes($serveNodes); $response = $gapicClient->updateCluster($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2616,19 +2633,20 @@ public function updateClusterExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; $serveNodes = 1288838783; - $request = (new Cluster()) - ->setName($name) - ->setServeNodes($serveNodes); + $request = (new Cluster())->setName($name)->setServeNodes($serveNodes); $response = $gapicClient->updateCluster($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2712,12 +2730,15 @@ public function updateInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; @@ -2786,8 +2807,7 @@ public function updateLogicalViewTest() $logicalView = new LogicalView(); $logicalViewQuery = 'logicalViewQuery1609026330'; $logicalView->setQuery($logicalViewQuery); - $request = (new UpdateLogicalViewRequest()) - ->setLogicalView($logicalView); + $request = (new UpdateLogicalViewRequest())->setLogicalView($logicalView); $response = $gapicClient->updateLogicalView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2843,19 +2863,21 @@ public function updateLogicalViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $logicalView = new LogicalView(); $logicalViewQuery = 'logicalViewQuery1609026330'; $logicalView->setQuery($logicalViewQuery); - $request = (new UpdateLogicalViewRequest()) - ->setLogicalView($logicalView); + $request = (new UpdateLogicalViewRequest())->setLogicalView($logicalView); $response = $gapicClient->updateLogicalView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2919,8 +2941,7 @@ public function updateMaterializedViewTest() $materializedView = new MaterializedView(); $materializedViewQuery = 'materializedViewQuery1755221932'; $materializedView->setQuery($materializedViewQuery); - $request = (new UpdateMaterializedViewRequest()) - ->setMaterializedView($materializedView); + $request = (new UpdateMaterializedViewRequest())->setMaterializedView($materializedView); $response = $gapicClient->updateMaterializedView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2976,19 +2997,21 @@ public function updateMaterializedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $materializedView = new MaterializedView(); $materializedViewQuery = 'materializedViewQuery1755221932'; $materializedView->setQuery($materializedViewQuery); - $request = (new UpdateMaterializedViewRequest()) - ->setMaterializedView($materializedView); + $request = (new UpdateMaterializedViewRequest())->setMaterializedView($materializedView); $response = $gapicClient->updateMaterializedView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); diff --git a/Bigtable/tests/Unit/Admin/V2/Client/BigtableTableAdminClientTest.php b/Bigtable/tests/Unit/Admin/V2/Client/BigtableTableAdminClientTest.php index 9422e682198..352041089ed 100644 --- a/Bigtable/tests/Unit/Admin/V2/Client/BigtableTableAdminClientTest.php +++ b/Bigtable/tests/Unit/Admin/V2/Client/BigtableTableAdminClientTest.php @@ -102,7 +102,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return BigtableTableAdminClient */ @@ -130,9 +132,7 @@ public function checkConsistencyTest() // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $consistencyToken = 'consistencyToken-1090516718'; - $request = (new CheckConsistencyRequest()) - ->setName($formattedName) - ->setConsistencyToken($consistencyToken); + $request = (new CheckConsistencyRequest())->setName($formattedName)->setConsistencyToken($consistencyToken); $response = $gapicClient->checkConsistency($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -158,19 +158,20 @@ public function checkConsistencyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $consistencyToken = 'consistencyToken-1090516718'; - $request = (new CheckConsistencyRequest()) - ->setName($formattedName) - ->setConsistencyToken($consistencyToken); + $request = (new CheckConsistencyRequest())->setName($formattedName)->setConsistencyToken($consistencyToken); try { $gapicClient->checkConsistency($request); // If the $gapicClient method call did not throw, fail the test @@ -292,12 +293,15 @@ public function copyBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); @@ -433,12 +437,15 @@ public function createAuthorizedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); @@ -578,12 +585,15 @@ public function createBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); @@ -719,12 +729,15 @@ public function createSchemaBundleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); @@ -806,12 +819,15 @@ public function createTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -934,12 +950,15 @@ public function createTableFromSnapshotExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -984,8 +1003,7 @@ public function deleteAuthorizedViewTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - $request = (new DeleteAuthorizedViewRequest()) - ->setName($formattedName); + $request = (new DeleteAuthorizedViewRequest())->setName($formattedName); $gapicClient->deleteAuthorizedView($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1008,17 +1026,19 @@ public function deleteAuthorizedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - $request = (new DeleteAuthorizedViewRequest()) - ->setName($formattedName); + $request = (new DeleteAuthorizedViewRequest())->setName($formattedName); try { $gapicClient->deleteAuthorizedView($request); // If the $gapicClient method call did not throw, fail the test @@ -1045,8 +1065,7 @@ public function deleteBackupTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - $request = (new DeleteBackupRequest()) - ->setName($formattedName); + $request = (new DeleteBackupRequest())->setName($formattedName); $gapicClient->deleteBackup($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1069,17 +1088,19 @@ public function deleteBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - $request = (new DeleteBackupRequest()) - ->setName($formattedName); + $request = (new DeleteBackupRequest())->setName($formattedName); try { $gapicClient->deleteBackup($request); // If the $gapicClient method call did not throw, fail the test @@ -1106,8 +1127,7 @@ public function deleteSchemaBundleTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->schemaBundleName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[SCHEMA_BUNDLE]'); - $request = (new DeleteSchemaBundleRequest()) - ->setName($formattedName); + $request = (new DeleteSchemaBundleRequest())->setName($formattedName); $gapicClient->deleteSchemaBundle($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1130,17 +1150,19 @@ public function deleteSchemaBundleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->schemaBundleName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[SCHEMA_BUNDLE]'); - $request = (new DeleteSchemaBundleRequest()) - ->setName($formattedName); + $request = (new DeleteSchemaBundleRequest())->setName($formattedName); try { $gapicClient->deleteSchemaBundle($request); // If the $gapicClient method call did not throw, fail the test @@ -1167,8 +1189,7 @@ public function deleteSnapshotTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - $request = (new DeleteSnapshotRequest()) - ->setName($formattedName); + $request = (new DeleteSnapshotRequest())->setName($formattedName); $gapicClient->deleteSnapshot($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1191,17 +1212,19 @@ public function deleteSnapshotExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - $request = (new DeleteSnapshotRequest()) - ->setName($formattedName); + $request = (new DeleteSnapshotRequest())->setName($formattedName); try { $gapicClient->deleteSnapshot($request); // If the $gapicClient method call did not throw, fail the test @@ -1228,8 +1251,7 @@ public function deleteTableTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new DeleteTableRequest()) - ->setName($formattedName); + $request = (new DeleteTableRequest())->setName($formattedName); $gapicClient->deleteTable($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1252,17 +1274,19 @@ public function deleteTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new DeleteTableRequest()) - ->setName($formattedName); + $request = (new DeleteTableRequest())->setName($formattedName); try { $gapicClient->deleteTable($request); // If the $gapicClient method call did not throw, fail the test @@ -1289,8 +1313,7 @@ public function dropRowRangeTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new DropRowRangeRequest()) - ->setName($formattedName); + $request = (new DropRowRangeRequest())->setName($formattedName); $gapicClient->dropRowRange($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1313,17 +1336,19 @@ public function dropRowRangeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new DropRowRangeRequest()) - ->setName($formattedName); + $request = (new DropRowRangeRequest())->setName($formattedName); try { $gapicClient->dropRowRange($request); // If the $gapicClient method call did not throw, fail the test @@ -1352,8 +1377,7 @@ public function generateConsistencyTokenTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new GenerateConsistencyTokenRequest()) - ->setName($formattedName); + $request = (new GenerateConsistencyTokenRequest())->setName($formattedName); $response = $gapicClient->generateConsistencyToken($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1377,17 +1401,19 @@ public function generateConsistencyTokenExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new GenerateConsistencyTokenRequest()) - ->setName($formattedName); + $request = (new GenerateConsistencyTokenRequest())->setName($formattedName); try { $gapicClient->generateConsistencyToken($request); // If the $gapicClient method call did not throw, fail the test @@ -1420,8 +1446,7 @@ public function getAuthorizedViewTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - $request = (new GetAuthorizedViewRequest()) - ->setName($formattedName); + $request = (new GetAuthorizedViewRequest())->setName($formattedName); $response = $gapicClient->getAuthorizedView($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1445,17 +1470,19 @@ public function getAuthorizedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - $request = (new GetAuthorizedViewRequest()) - ->setName($formattedName); + $request = (new GetAuthorizedViewRequest())->setName($formattedName); try { $gapicClient->getAuthorizedView($request); // If the $gapicClient method call did not throw, fail the test @@ -1490,8 +1517,7 @@ public function getBackupTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - $request = (new GetBackupRequest()) - ->setName($formattedName); + $request = (new GetBackupRequest())->setName($formattedName); $response = $gapicClient->getBackup($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1515,17 +1541,19 @@ public function getBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - $request = (new GetBackupRequest()) - ->setName($formattedName); + $request = (new GetBackupRequest())->setName($formattedName); try { $gapicClient->getBackup($request); // If the $gapicClient method call did not throw, fail the test @@ -1556,8 +1584,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1581,17 +1608,19 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest()) - ->setResource($resource); + $request = (new GetIamPolicyRequest())->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1622,8 +1651,7 @@ public function getSchemaBundleTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->schemaBundleName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[SCHEMA_BUNDLE]'); - $request = (new GetSchemaBundleRequest()) - ->setName($formattedName); + $request = (new GetSchemaBundleRequest())->setName($formattedName); $response = $gapicClient->getSchemaBundle($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1647,17 +1675,19 @@ public function getSchemaBundleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->schemaBundleName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[SCHEMA_BUNDLE]'); - $request = (new GetSchemaBundleRequest()) - ->setName($formattedName); + $request = (new GetSchemaBundleRequest())->setName($formattedName); try { $gapicClient->getSchemaBundle($request); // If the $gapicClient method call did not throw, fail the test @@ -1690,8 +1720,7 @@ public function getSnapshotTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - $request = (new GetSnapshotRequest()) - ->setName($formattedName); + $request = (new GetSnapshotRequest())->setName($formattedName); $response = $gapicClient->getSnapshot($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1715,17 +1744,19 @@ public function getSnapshotExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - $request = (new GetSnapshotRequest()) - ->setName($formattedName); + $request = (new GetSnapshotRequest())->setName($formattedName); try { $gapicClient->getSnapshot($request); // If the $gapicClient method call did not throw, fail the test @@ -1756,8 +1787,7 @@ public function getTableTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new GetTableRequest()) - ->setName($formattedName); + $request = (new GetTableRequest())->setName($formattedName); $response = $gapicClient->getTable($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1781,17 +1811,19 @@ public function getTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new GetTableRequest()) - ->setName($formattedName); + $request = (new GetTableRequest())->setName($formattedName); try { $gapicClient->getTable($request); // If the $gapicClient method call did not throw, fail the test @@ -1816,17 +1848,14 @@ public function listAuthorizedViewsTest() // Mock response $nextPageToken = ''; $authorizedViewsElement = new AuthorizedView(); - $authorizedViews = [ - $authorizedViewsElement, - ]; + $authorizedViews = [$authorizedViewsElement]; $expectedResponse = new ListAuthorizedViewsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setAuthorizedViews($authorizedViews); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ListAuthorizedViewsRequest()) - ->setParent($formattedParent); + $request = (new ListAuthorizedViewsRequest())->setParent($formattedParent); $response = $gapicClient->listAuthorizedViews($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1853,17 +1882,19 @@ public function listAuthorizedViewsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ListAuthorizedViewsRequest()) - ->setParent($formattedParent); + $request = (new ListAuthorizedViewsRequest())->setParent($formattedParent); try { $gapicClient->listAuthorizedViews($request); // If the $gapicClient method call did not throw, fail the test @@ -1888,17 +1919,14 @@ public function listBackupsTest() // Mock response $nextPageToken = ''; $backupsElement = new Backup(); - $backups = [ - $backupsElement, - ]; + $backups = [$backupsElement]; $expectedResponse = new ListBackupsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setBackups($backups); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new ListBackupsRequest()) - ->setParent($formattedParent); + $request = (new ListBackupsRequest())->setParent($formattedParent); $response = $gapicClient->listBackups($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1925,17 +1953,19 @@ public function listBackupsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new ListBackupsRequest()) - ->setParent($formattedParent); + $request = (new ListBackupsRequest())->setParent($formattedParent); try { $gapicClient->listBackups($request); // If the $gapicClient method call did not throw, fail the test @@ -1960,17 +1990,14 @@ public function listSchemaBundlesTest() // Mock response $nextPageToken = ''; $schemaBundlesElement = new SchemaBundle(); - $schemaBundles = [ - $schemaBundlesElement, - ]; + $schemaBundles = [$schemaBundlesElement]; $expectedResponse = new ListSchemaBundlesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setSchemaBundles($schemaBundles); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ListSchemaBundlesRequest()) - ->setParent($formattedParent); + $request = (new ListSchemaBundlesRequest())->setParent($formattedParent); $response = $gapicClient->listSchemaBundles($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1997,17 +2024,19 @@ public function listSchemaBundlesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ListSchemaBundlesRequest()) - ->setParent($formattedParent); + $request = (new ListSchemaBundlesRequest())->setParent($formattedParent); try { $gapicClient->listSchemaBundles($request); // If the $gapicClient method call did not throw, fail the test @@ -2032,17 +2061,14 @@ public function listSnapshotsTest() // Mock response $nextPageToken = ''; $snapshotsElement = new Snapshot(); - $snapshots = [ - $snapshotsElement, - ]; + $snapshots = [$snapshotsElement]; $expectedResponse = new ListSnapshotsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setSnapshots($snapshots); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new ListSnapshotsRequest()) - ->setParent($formattedParent); + $request = (new ListSnapshotsRequest())->setParent($formattedParent); $response = $gapicClient->listSnapshots($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2069,17 +2095,19 @@ public function listSnapshotsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new ListSnapshotsRequest()) - ->setParent($formattedParent); + $request = (new ListSnapshotsRequest())->setParent($formattedParent); try { $gapicClient->listSnapshots($request); // If the $gapicClient method call did not throw, fail the test @@ -2104,17 +2132,14 @@ public function listTablesTest() // Mock response $nextPageToken = ''; $tablesElement = new Table(); - $tables = [ - $tablesElement, - ]; + $tables = [$tablesElement]; $expectedResponse = new ListTablesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTables($tables); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListTablesRequest()) - ->setParent($formattedParent); + $request = (new ListTablesRequest())->setParent($formattedParent); $response = $gapicClient->listTables($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2141,17 +2166,19 @@ public function listTablesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListTablesRequest()) - ->setParent($formattedParent); + $request = (new ListTablesRequest())->setParent($formattedParent); try { $gapicClient->listTables($request); // If the $gapicClient method call did not throw, fail the test @@ -2183,9 +2210,7 @@ public function modifyColumnFamiliesTest() // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $modifications = []; - $request = (new ModifyColumnFamiliesRequest()) - ->setName($formattedName) - ->setModifications($modifications); + $request = (new ModifyColumnFamiliesRequest())->setName($formattedName)->setModifications($modifications); $response = $gapicClient->modifyColumnFamilies($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2211,19 +2236,20 @@ public function modifyColumnFamiliesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $modifications = []; - $request = (new ModifyColumnFamiliesRequest()) - ->setName($formattedName) - ->setModifications($modifications); + $request = (new ModifyColumnFamiliesRequest())->setName($formattedName)->setModifications($modifications); try { $gapicClient->modifyColumnFamilies($request); // If the $gapicClient method call did not throw, fail the test @@ -2273,9 +2299,7 @@ public function restoreTableTest() // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); $tableId = 'tableId-895419604'; - $request = (new RestoreTableRequest()) - ->setParent($formattedParent) - ->setTableId($tableId); + $request = (new RestoreTableRequest())->setParent($formattedParent)->setTableId($tableId); $response = $gapicClient->restoreTable($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2333,19 +2357,20 @@ public function restoreTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); $tableId = 'tableId-895419604'; - $request = (new RestoreTableRequest()) - ->setParent($formattedParent) - ->setTableId($tableId); + $request = (new RestoreTableRequest())->setParent($formattedParent)->setTableId($tableId); $response = $gapicClient->restoreTable($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2386,9 +2411,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2414,19 +2437,20 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest()) - ->setResource($resource) - ->setPolicy($policy); + $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2542,12 +2566,15 @@ public function snapshotTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); @@ -2593,9 +2620,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2621,19 +2646,20 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest()) - ->setResource($resource) - ->setPermissions($permissions); + $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -2682,8 +2708,7 @@ public function undeleteTableTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new UndeleteTableRequest()) - ->setName($formattedName); + $request = (new UndeleteTableRequest())->setName($formattedName); $response = $gapicClient->undeleteTable($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2739,17 +2764,19 @@ public function undeleteTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new UndeleteTableRequest()) - ->setName($formattedName); + $request = (new UndeleteTableRequest())->setName($formattedName); $response = $gapicClient->undeleteTable($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2809,8 +2836,7 @@ public function updateAuthorizedViewTest() $operationsTransport->addResponse($completeOperation); // Mock request $authorizedView = new AuthorizedView(); - $request = (new UpdateAuthorizedViewRequest()) - ->setAuthorizedView($authorizedView); + $request = (new UpdateAuthorizedViewRequest())->setAuthorizedView($authorizedView); $response = $gapicClient->updateAuthorizedView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2866,17 +2892,19 @@ public function updateAuthorizedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $authorizedView = new AuthorizedView(); - $request = (new UpdateAuthorizedViewRequest()) - ->setAuthorizedView($authorizedView); + $request = (new UpdateAuthorizedViewRequest())->setAuthorizedView($authorizedView); $response = $gapicClient->updateAuthorizedView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2925,9 +2953,7 @@ public function updateBackupTest() $backupExpireTime = new Timestamp(); $backup->setExpireTime($backupExpireTime); $updateMask = new FieldMask(); - $request = (new UpdateBackupRequest()) - ->setBackup($backup) - ->setUpdateMask($updateMask); + $request = (new UpdateBackupRequest())->setBackup($backup)->setUpdateMask($updateMask); $response = $gapicClient->updateBackup($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2953,12 +2979,15 @@ public function updateBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $backup = new Backup(); @@ -2967,9 +2996,7 @@ public function updateBackupExceptionTest() $backupExpireTime = new Timestamp(); $backup->setExpireTime($backupExpireTime); $updateMask = new FieldMask(); - $request = (new UpdateBackupRequest()) - ->setBackup($backup) - ->setUpdateMask($updateMask); + $request = (new UpdateBackupRequest())->setBackup($backup)->setUpdateMask($updateMask); try { $gapicClient->updateBackup($request); // If the $gapicClient method call did not throw, fail the test @@ -3018,8 +3045,7 @@ public function updateSchemaBundleTest() $operationsTransport->addResponse($completeOperation); // Mock request $schemaBundle = new SchemaBundle(); - $request = (new UpdateSchemaBundleRequest()) - ->setSchemaBundle($schemaBundle); + $request = (new UpdateSchemaBundleRequest())->setSchemaBundle($schemaBundle); $response = $gapicClient->updateSchemaBundle($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3075,17 +3101,19 @@ public function updateSchemaBundleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $schemaBundle = new SchemaBundle(); - $request = (new UpdateSchemaBundleRequest()) - ->setSchemaBundle($schemaBundle); + $request = (new UpdateSchemaBundleRequest())->setSchemaBundle($schemaBundle); $response = $gapicClient->updateSchemaBundle($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3144,9 +3172,7 @@ public function updateTableTest() // Mock request $table = new Table(); $updateMask = new FieldMask(); - $request = (new UpdateTableRequest()) - ->setTable($table) - ->setUpdateMask($updateMask); + $request = (new UpdateTableRequest())->setTable($table)->setUpdateMask($updateMask); $response = $gapicClient->updateTable($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3204,19 +3230,20 @@ public function updateTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $operationsTransport->addResponse(null, $status); // Mock request $table = new Table(); $updateMask = new FieldMask(); - $request = (new UpdateTableRequest()) - ->setTable($table) - ->setUpdateMask($updateMask); + $request = (new UpdateTableRequest())->setTable($table)->setUpdateMask($updateMask); $response = $gapicClient->updateTable($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3255,9 +3282,7 @@ public function checkConsistencyAsyncTest() // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $consistencyToken = 'consistencyToken-1090516718'; - $request = (new CheckConsistencyRequest()) - ->setName($formattedName) - ->setConsistencyToken($consistencyToken); + $request = (new CheckConsistencyRequest())->setName($formattedName)->setConsistencyToken($consistencyToken); $response = $gapicClient->checkConsistencyAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/Bigtable/tests/Unit/V2/Client/BigtableClientTest.php b/Bigtable/tests/Unit/V2/Client/BigtableClientTest.php index ab9a89d987e..8d120bc5ae2 100644 --- a/Bigtable/tests/Unit/V2/Client/BigtableClientTest.php +++ b/Bigtable/tests/Unit/V2/Client/BigtableClientTest.php @@ -76,7 +76,9 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class) + ->disableOriginalConstructor() + ->getMock(); } /** @return BigtableClient */ @@ -104,9 +106,7 @@ public function checkAndMutateRowTest() // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $rowKey = '122'; - $request = (new CheckAndMutateRowRequest()) - ->setTableName($formattedTableName) - ->setRowKey($rowKey); + $request = (new CheckAndMutateRowRequest())->setTableName($formattedTableName)->setRowKey($rowKey); $response = $gapicClient->checkAndMutateRow($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -132,19 +132,20 @@ public function checkAndMutateRowExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $rowKey = '122'; - $request = (new CheckAndMutateRowRequest()) - ->setTableName($formattedTableName) - ->setRowKey($rowKey); + $request = (new CheckAndMutateRowRequest())->setTableName($formattedTableName)->setRowKey($rowKey); try { $gapicClient->checkAndMutateRow($request); // If the $gapicClient method call did not throw, fail the test @@ -216,12 +217,15 @@ public function executeQueryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request @@ -267,8 +271,7 @@ public function generateInitialChangeStreamPartitionsTest() $transport->addResponse($expectedResponse3); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new GenerateInitialChangeStreamPartitionsRequest()) - ->setTableName($formattedTableName); + $request = (new GenerateInitialChangeStreamPartitionsRequest())->setTableName($formattedTableName); $serverStream = $gapicClient->generateInitialChangeStreamPartitions($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -297,18 +300,20 @@ public function generateInitialChangeStreamPartitionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new GenerateInitialChangeStreamPartitionsRequest()) - ->setTableName($formattedTableName); + $request = (new GenerateInitialChangeStreamPartitionsRequest())->setTableName($formattedTableName); $serverStream = $gapicClient->generateInitialChangeStreamPartitions($request); $results = $serverStream->readAll(); try { @@ -339,8 +344,7 @@ public function getClientConfigurationTest() $transport->addResponse($expectedResponse); // Mock request $formattedInstanceName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new GetClientConfigurationRequest()) - ->setInstanceName($formattedInstanceName); + $request = (new GetClientConfigurationRequest())->setInstanceName($formattedInstanceName); $response = $gapicClient->getClientConfiguration($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -364,17 +368,19 @@ public function getClientConfigurationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedInstanceName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new GetClientConfigurationRequest()) - ->setInstanceName($formattedInstanceName); + $request = (new GetClientConfigurationRequest())->setInstanceName($formattedInstanceName); try { $gapicClient->getClientConfiguration($request); // If the $gapicClient method call did not throw, fail the test @@ -434,12 +440,15 @@ public function mutateRowExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); @@ -480,9 +489,7 @@ public function mutateRowsTest() // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $entries = []; - $request = (new MutateRowsRequest()) - ->setTableName($formattedTableName) - ->setEntries($entries); + $request = (new MutateRowsRequest())->setTableName($formattedTableName)->setEntries($entries); $serverStream = $gapicClient->mutateRows($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -513,20 +520,21 @@ public function mutateRowsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $entries = []; - $request = (new MutateRowsRequest()) - ->setTableName($formattedTableName) - ->setEntries($entries); + $request = (new MutateRowsRequest())->setTableName($formattedTableName)->setEntries($entries); $serverStream = $gapicClient->mutateRows($request); $results = $serverStream->readAll(); try { @@ -566,10 +574,7 @@ public function openAuthorizedViewTest() $bidi->write($request); $responses = []; $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); + $bidi->writeAll([$request2, $request3]); foreach ($bidi->closeWriteAndReadAll() as $response) { $responses[] = $response; } @@ -607,12 +612,15 @@ public function openAuthorizedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); $bidi = $gapicClient->openAuthorizedView(); @@ -654,10 +662,7 @@ public function openMaterializedViewTest() $bidi->write($request); $responses = []; $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); + $bidi->writeAll([$request2, $request3]); foreach ($bidi->closeWriteAndReadAll() as $response) { $responses[] = $response; } @@ -695,12 +700,15 @@ public function openMaterializedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); $bidi = $gapicClient->openMaterializedView(); @@ -742,10 +750,7 @@ public function openTableTest() $bidi->write($request); $responses = []; $responses[] = $bidi->read(); - $bidi->writeAll([ - $request2, - $request3, - ]); + $bidi->writeAll([$request2, $request3]); foreach ($bidi->closeWriteAndReadAll() as $response) { $responses[] = $response; } @@ -783,12 +788,15 @@ public function openTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); $bidi = $gapicClient->openTable(); @@ -819,8 +827,7 @@ public function pingAndWarmTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new PingAndWarmRequest()) - ->setName($formattedName); + $request = (new PingAndWarmRequest())->setName($formattedName); $response = $gapicClient->pingAndWarm($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -844,17 +851,19 @@ public function pingAndWarmExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new PingAndWarmRequest()) - ->setName($formattedName); + $request = (new PingAndWarmRequest())->setName($formattedName); try { $gapicClient->pingAndWarm($request); // If the $gapicClient method call did not throw, fail the test @@ -919,12 +928,15 @@ public function prepareQueryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedInstanceName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -967,8 +979,7 @@ public function readChangeStreamTest() $transport->addResponse($expectedResponse3); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ReadChangeStreamRequest()) - ->setTableName($formattedTableName); + $request = (new ReadChangeStreamRequest())->setTableName($formattedTableName); $serverStream = $gapicClient->readChangeStream($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -997,18 +1008,20 @@ public function readChangeStreamExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ReadChangeStreamRequest()) - ->setTableName($formattedTableName); + $request = (new ReadChangeStreamRequest())->setTableName($formattedTableName); $serverStream = $gapicClient->readChangeStream($request); $results = $serverStream->readAll(); try { @@ -1070,12 +1083,15 @@ public function readModifyWriteRowExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->addResponse(null, $status); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); @@ -1121,8 +1137,7 @@ public function readRowsTest() $transport->addResponse($expectedResponse3); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ReadRowsRequest()) - ->setTableName($formattedTableName); + $request = (new ReadRowsRequest())->setTableName($formattedTableName); $serverStream = $gapicClient->readRows($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -1151,18 +1166,20 @@ public function readRowsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ReadRowsRequest()) - ->setTableName($formattedTableName); + $request = (new ReadRowsRequest())->setTableName($formattedTableName); $serverStream = $gapicClient->readRows($request); $results = $serverStream->readAll(); try { @@ -1207,8 +1224,7 @@ public function sampleRowKeysTest() $transport->addResponse($expectedResponse3); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new SampleRowKeysRequest()) - ->setTableName($formattedTableName); + $request = (new SampleRowKeysRequest())->setTableName($formattedTableName); $serverStream = $gapicClient->sampleRowKeys($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -1237,18 +1253,20 @@ public function sampleRowKeysExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new SampleRowKeysRequest()) - ->setTableName($formattedTableName); + $request = (new SampleRowKeysRequest())->setTableName($formattedTableName); $serverStream = $gapicClient->sampleRowKeys($request); $results = $serverStream->readAll(); try { @@ -1280,9 +1298,7 @@ public function checkAndMutateRowAsyncTest() // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $rowKey = '122'; - $request = (new CheckAndMutateRowRequest()) - ->setTableName($formattedTableName) - ->setRowKey($rowKey); + $request = (new CheckAndMutateRowRequest())->setTableName($formattedTableName)->setRowKey($rowKey); $response = $gapicClient->checkAndMutateRowAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); From 38da60b0d1e99dac3355fbdb8cd5f6bfe930d3dc Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Mon, 24 Aug 2026 15:44:27 +0000 Subject: [PATCH 17/21] update config --- librarian.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/librarian.yaml b/librarian.yaml index 6c6d651d482..4c4dbaae89a 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -471,6 +471,7 @@ libraries: - path: google/bigtable/v2 - path: google/bigtable/admin/v2 php: + gapic_yaml: google/bigtable/admin/v2/bigtableadmin_gapic.yaml staging_subdir: v2/Admin keep: - tests/Conformance/proxy/src/GPBMetadata/Google/Bigtable/Testproxy/TestProxy.php From b47e72df4d83d7f52ad7544d9a36816e545d889b Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Mon, 24 Aug 2026 18:55:22 +0000 Subject: [PATCH 18/21] update config --- Bigtable/.OwlBot.yaml | 2 +- Bigtable/owlbot.py | 2 +- librarian.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Bigtable/.OwlBot.yaml b/Bigtable/.OwlBot.yaml index ac8294e9c4b..23450d47144 100644 --- a/Bigtable/.OwlBot.yaml +++ b/Bigtable/.OwlBot.yaml @@ -2,5 +2,5 @@ deep-copy-regex: - source: /google/bigtable/(v2)/.*-php/(.*) dest: /owl-bot-staging/Bigtable/$1/$2 - source: /google/bigtable/admin/(v2)/.*-php/(.*) - dest: /owl-bot-staging/Bigtable/$1/Admin/$2 + dest: /owl-bot-staging/Bigtable/Admin/$1/$2 api-name: Bigtable diff --git a/Bigtable/owlbot.py b/Bigtable/owlbot.py index 19e68ca7623..a1cbbc3d093 100644 --- a/Bigtable/owlbot.py +++ b/Bigtable/owlbot.py @@ -43,7 +43,7 @@ ) # First copy the Bigtable Admin -admin_library = Path(f"../{php.STAGING_DIR}/Bigtable/v2/Admin").resolve() +admin_library = Path(f"../{php.STAGING_DIR}/Bigtable/Admin/v2").resolve() # copy gapic src, samples, and tests s.move(admin_library / f'src', 'src/Admin', merge=preserve_copyright_year) diff --git a/librarian.yaml b/librarian.yaml index 4c4dbaae89a..677685b585d 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -472,7 +472,7 @@ libraries: - path: google/bigtable/admin/v2 php: gapic_yaml: google/bigtable/admin/v2/bigtableadmin_gapic.yaml - staging_subdir: v2/Admin + staging_subdir: Admin/v2 keep: - tests/Conformance/proxy/src/GPBMetadata/Google/Bigtable/Testproxy/TestProxy.php - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CheckAndMutateRowRequest.php From dae1da8ade56764b5c83c05e894387fa78de1a87 Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Mon, 24 Aug 2026 18:56:54 +0000 Subject: [PATCH 19/21] restore --- librarian.yaml | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/librarian.yaml b/librarian.yaml index 677685b585d..e0dcfa80d11 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -471,37 +471,7 @@ libraries: - path: google/bigtable/v2 - path: google/bigtable/admin/v2 php: - gapic_yaml: google/bigtable/admin/v2/bigtableadmin_gapic.yaml - staging_subdir: Admin/v2 - keep: - - tests/Conformance/proxy/src/GPBMetadata/Google/Bigtable/Testproxy/TestProxy.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CheckAndMutateRowRequest.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CheckAndMutateRowResult.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CloseClientRequest.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CloseClientResponse.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CloudBigtableV2TestProxyInterface.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/OptionalFeatureConfig.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/ReadModifyWriteRowRequest.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/ReadRowRequest.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/ReadRowsRequest.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/RemoveClientRequest.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/RemoveClientResponse.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CreateClientRequest.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CreateClientRequest/SecurityOptions.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/CreateClientResponse.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/ExecuteQueryRequest.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/ExecuteQueryResult.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/MutateRowRequest.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/MutateRowResult.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/MutateRowsRequest.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/MutateRowsResult.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/ResultSetMetadata.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/RowResult.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/RowsResult.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/SampleRowKeysRequest.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/SampleRowKeysResult.php - - tests/Conformance/proxy/src/Google/Bigtable/Testproxy/SqlRow.php - - tests/Conformance/proxy/src/Google/Cloud/Bigtable/V2/BigtableInterface.php + staging_subdir: v2/Admin output: Bigtable - name: billing version: 2.3.0 @@ -1320,10 +1290,6 @@ libraries: version: 2.2.0 apis: - path: google/cloud/oslogin/v1 - - path: google/cloud/oslogin/common - php: - generate_gapic: false - staging_subdir: common-protos output: OsLogin - name: parallelstore version: 0.14.0 @@ -1762,13 +1728,11 @@ libraries: version: 2.3.0 apis: - path: google/cloud/videointelligence/v1 - php: - gapic_yaml: google/cloud/videointelligence/v1/videointelligence_gapic.yaml output: VideoIntelligence - name: vision version: 2.3.0 apis: - - path: google/cloud/vision/v1gs + - path: google/cloud/vision/v1 output: Vision - name: visionai version: 0.4.0 From 341530038843424c0cea09ced051500a1274cc58 Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Mon, 24 Aug 2026 18:57:46 +0000 Subject: [PATCH 20/21] restore --- OsLogin/metadata/Common/Common.php | Bin 2217 -> 1639 bytes OsLogin/metadata/V1/Oslogin.php | 51 ++++++++++++- OsLogin/owlbot.py | 18 ----- .../create_ssh_public_key.php | 69 +++++++++++++++++ .../delete_posix_account.php | 66 ++++++++++++++++ .../delete_ssh_public_key.php | 66 ++++++++++++++++ .../get_login_profile.php | 67 ++++++++++++++++ .../get_ssh_public_key.php | 68 +++++++++++++++++ .../import_ssh_public_key.php | 59 ++++++++++++++ .../sign_ssh_public_key.php | 53 +++++++++++++ .../update_ssh_public_key.php | 72 ++++++++++++++++++ OsLogin/src/Common/PosixAccount.php | 2 +- OsLogin/src/Common/SshPublicKey.php | 14 ++-- OsLogin/src/V1/CreateSshPublicKeyRequest.php | 2 +- OsLogin/src/V1/DeletePosixAccountRequest.php | 2 +- OsLogin/src/V1/DeleteSshPublicKeyRequest.php | 2 +- OsLogin/src/V1/GetLoginProfileRequest.php | 2 +- OsLogin/src/V1/GetSshPublicKeyRequest.php | 2 +- OsLogin/src/V1/ImportSshPublicKeyRequest.php | 8 +- OsLogin/src/V1/ImportSshPublicKeyResponse.php | 2 +- OsLogin/src/V1/LoginProfile.php | 8 +- OsLogin/src/V1/UpdateSshPublicKeyRequest.php | 2 +- 22 files changed, 595 insertions(+), 40 deletions(-) create mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/create_ssh_public_key.php create mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/delete_posix_account.php create mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/delete_ssh_public_key.php create mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/get_login_profile.php create mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/get_ssh_public_key.php create mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/import_ssh_public_key.php create mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/sign_ssh_public_key.php create mode 100644 OsLogin/samples/V1beta/OsLoginServiceClient/update_ssh_public_key.php diff --git a/OsLogin/metadata/Common/Common.php b/OsLogin/metadata/Common/Common.php index 012990fbfd524ad955ed52b2d4df9d6a30ae4e71..58e5d425988ea0d4b0b5b1d94b5cba370ed0c736 100644 GIT binary patch delta 593 zcmY*WO^ee&7&eopN#16=?f9{&kyh%;DhmpFtEbdODV9yKF6*HZvgw!xlT64Yutj8l z#9Rf>3W8oed-CER@Ze48$zLE&(yicWcpm0`pO5!_`Zh%~bb5j;T zETaYL+>l+vlpE7fzR=5p1Te6(QuGpki)DD2R zc2shD$qnV7wu~LPOjDA1d6)$5`Bc74i3#FQlfSLq>)>}Lb z1EqJ?|001gWs6C15{3Q~vMiIlBJ0#Tz6O`bX&RO~G;#A#gc2?IRRc0Mq484alT1{V zr_BPUGA8TsxbY(kmgR+PQVR9#+G>C}DyNb5;pFA(>`zBm;HsPjKBhN%Md=vQB zdcW7YfOSyDqr;=;ElJo_k4J|G&hfN`hQB4~@du(!gS+Zb{(vn0QMGozA?tCaH=8|- zXfdD795ya(2u$OcCM(qCf7GtBviHH_+scl0ByNq3^5X37>+*SXQcp9Q)BAgzXa|1* DdFr0i literal 2217 zcma)7{g2`{5dA%Wh3}&h*N;G!{UY0Km4tv$?+990U9XCSLNMTKh@;r4*q->`J7YV6 zWtUTtATfC}^Ze$;^Xu=$rm)_TAWW zGFc`viH9ma4lq8BbbK7B_&du=vqT7@m)19nz^AAd8B2+fiG<60Cgv<>k|i1Y7xr;a zR!Jr(gucYCsyvm9=L7?yJf*DMAC@hF$H%#$qcQ<0Xeki47# z)OFWXHUi>5tq-OwreiD8(i~m)1<89N%ZeUXC#0mZD)T$V8x!oCyZ9Boyn@98Mzf_) zH_1PYm#%x*)gj5b&XH!GsI8^U{=8xzrUp zNDZIe6eZgxj}EHI1XHn@s1xfCiakY}Hs1ML{q@|6rp*p|8WK5|bXPFcjpuX8z#&jN zHSIju(l}1p8q51D(3zItcl8oriGw{)q|mHhmG9uzlNk3w$)|dIPQKHfx1MPyj&uP5 zkNEC?oSD6M&oui7eEueygb&_qG#<{UU#7G0(|q=263!pT(@7YN2BQ#O6bD~u_$t{! zS>?*BkE8M9pXMR-=~+*1K99!z==0P(zJOj0Fp24>GXP_J&!5=aAQB&O45|t8*QGw! zYEOf&*8KHBSuF1KsaGuGori5iTl+&bA#F7wZIjv#)P#g%_XHN3NeZJ>ae%c!hBY$O z30+rZbX|jlb%XSN(powGnOEZx{BM*Cj@t^vJJ;|sNZx(hOo^ZMv^yG(X9uG~>hZO= H_LlV@wo>Ru diff --git a/OsLogin/metadata/V1/Oslogin.php b/OsLogin/metadata/V1/Oslogin.php index 2bf0c3bc725..8c82c08fb98 100644 --- a/OsLogin/metadata/V1/Oslogin.php +++ b/OsLogin/metadata/V1/Oslogin.php @@ -22,7 +22,56 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\x92\x1A\x0A%google/cloud/oslogin/v1/oslogin.proto\x12\x17google.cloud.oslogin.v1\x1A\x17google/api/client.proto\x1A\x1Fgoogle/api/field_behavior.proto\x1A\x19google/api/resource.proto\x1A(google/cloud/oslogin/common/common.proto\x1A\x1Bgoogle/protobuf/empty.proto\x1A google/protobuf/field_mask.proto\"\x98\x02\x0A\x0CLoginProfile\x12\x11\x0A\x04name\x18\x01 \x01(\x09B\x03\xE0A\x02\x12A\x0A\x0Eposix_accounts\x18\x02 \x03(\x0B2).google.cloud.oslogin.common.PosixAccount\x12Q\x0A\x0Fssh_public_keys\x18\x03 \x03(\x0B28.google.cloud.oslogin.v1.LoginProfile.SshPublicKeysEntry\x1A_\x0A\x12SshPublicKeysEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x128\x0A\x05value\x18\x02 \x01(\x0B2).google.cloud.oslogin.common.SshPublicKey:\x028\x01\"\xA0\x01\x0A\x19CreateSshPublicKeyRequest\x12;\x0A\x06parent\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x12#oslogin.googleapis.com/SshPublicKey\x12F\x0A\x0Essh_public_key\x18\x02 \x01(\x0B2).google.cloud.oslogin.common.SshPublicKeyB\x03\xE0A\x02\"V\x0A\x19DeletePosixAccountRequest\x129\x0A\x04name\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x0A#oslogin.googleapis.com/PosixAccount\"V\x0A\x19DeleteSshPublicKeyRequest\x129\x0A\x04name\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x0A#oslogin.googleapis.com/SshPublicKey\"z\x0A\x16GetLoginProfileRequest\x129\x0A\x04name\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x12#oslogin.googleapis.com/PosixAccount\x12\x12\x0A\x0Aproject_id\x18\x02 \x01(\x09\x12\x11\x0A\x09system_id\x18\x03 \x01(\x09\"S\x0A\x16GetSshPublicKeyRequest\x129\x0A\x04name\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x0A#oslogin.googleapis.com/SshPublicKey\"\xCA\x01\x0A\x19ImportSshPublicKeyRequest\x12;\x0A\x06parent\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x12#oslogin.googleapis.com/SshPublicKey\x12F\x0A\x0Essh_public_key\x18\x02 \x01(\x0B2).google.cloud.oslogin.common.SshPublicKeyB\x03\xE0A\x01\x12\x12\x0A\x0Aproject_id\x18\x03 \x01(\x09\x12\x14\x0A\x07regions\x18\x05 \x03(\x09B\x03\xE0A\x01\"k\x0A\x1AImportSshPublicKeyResponse\x12<\x0A\x0Dlogin_profile\x18\x01 \x01(\x0B2%.google.cloud.oslogin.v1.LoginProfile\x12\x0F\x0A\x07details\x18\x02 \x01(\x09\"\xCF\x01\x0A\x19UpdateSshPublicKeyRequest\x129\x0A\x04name\x18\x01 \x01(\x09B+\xE0A\x02\xFAA%\x0A#oslogin.googleapis.com/SshPublicKey\x12F\x0A\x0Essh_public_key\x18\x02 \x01(\x0B2).google.cloud.oslogin.common.SshPublicKeyB\x03\xE0A\x02\x12/\x0A\x0Bupdate_mask\x18\x03 \x01(\x0B2\x1A.google.protobuf.FieldMask2\x86\x0C\x0A\x0EOsLoginService\x12\xC7\x01\x0A\x12CreateSshPublicKey\x122.google.cloud.oslogin.v1.CreateSshPublicKeyRequest\x1A).google.cloud.oslogin.common.SshPublicKey\"R\xDAA\x15parent,ssh_public_key\x82\xD3\xE4\x93\x024\"\"/v1/{parent=users/*}/sshPublicKeys:\x0Essh_public_key\x12\x8E\x01\x0A\x12DeletePosixAccount\x122.google.cloud.oslogin.v1.DeletePosixAccountRequest\x1A\x16.google.protobuf.Empty\",\xDAA\x04name\x82\xD3\xE4\x93\x02\x1F*\x1D/v1/{name=users/*/projects/*}\x12\x93\x01\x0A\x12DeleteSshPublicKey\x122.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest\x1A\x16.google.protobuf.Empty\"1\xDAA\x04name\x82\xD3\xE4\x93\x02\$*\"/v1/{name=users/*/sshPublicKeys/*}\x12\x99\x01\x0A\x0FGetLoginProfile\x12/.google.cloud.oslogin.v1.GetLoginProfileRequest\x1A%.google.cloud.oslogin.v1.LoginProfile\".\xDAA\x04name\x82\xD3\xE4\x93\x02!\x12\x1F/v1/{name=users/*}/loginProfile\x12\xA0\x01\x0A\x0FGetSshPublicKey\x12/.google.cloud.oslogin.v1.GetSshPublicKeyRequest\x1A).google.cloud.oslogin.common.SshPublicKey\"1\xDAA\x04name\x82\xD3\xE4\x93\x02\$\x12\"/v1/{name=users/*/sshPublicKeys/*}\x12\xF9\x01\x0A\x12ImportSshPublicKey\x122.google.cloud.oslogin.v1.ImportSshPublicKeyRequest\x1A3.google.cloud.oslogin.v1.ImportSshPublicKeyResponse\"z\xDAA\x15parent,ssh_public_key\xDAA parent,ssh_public_key,project_id\x82\xD3\xE4\x93\x029\"'/v1/{parent=users/*}:importSshPublicKey:\x0Essh_public_key\x12\xE7\x01\x0A\x12UpdateSshPublicKey\x122.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest\x1A).google.cloud.oslogin.common.SshPublicKey\"r\xDAA\x13name,ssh_public_key\xDAA\x1Fname,ssh_public_key,update_mask\x82\xD3\xE4\x93\x0242\"/v1/{name=users/*/sshPublicKeys/*}:\x0Essh_public_key\x1A\xDD\x01\xCAA\x16oslogin.googleapis.com\xD2A\xC0\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonlyB\xB5\x01\x0A\x1Bcom.google.cloud.oslogin.v1B\x0COsLoginProtoP\x01Z5cloud.google.com/go/oslogin/apiv1/osloginpb;osloginpb\xAA\x02\x17Google.Cloud.OsLogin.V1\xCA\x02\x17Google\\Cloud\\OsLogin\\V1\xEA\x02\x1AGoogle::Cloud::OsLogin::V1b\x06proto3" + ' +’ +%google/cloud/oslogin/v1/oslogin.protogoogle.cloud.oslogin.v1google/api/client.protogoogle/api/field_behavior.protogoogle/api/resource.proto(google/cloud/oslogin/common/common.protogoogle/protobuf/empty.proto google/protobuf/field_mask.proto"˜ + LoginProfile +name ( BàAA +posix_accounts ( 2).google.cloud.oslogin.common.PosixAccountQ +ssh_public_keys ( 28.google.cloud.oslogin.v1.LoginProfile.SshPublicKeysEntry_ +SshPublicKeysEntry +key ( 8 +value ( 2).google.cloud.oslogin.common.SshPublicKey:8"  +CreateSshPublicKeyRequest; +parent ( B+àAúA%#oslogin.googleapis.com/SshPublicKeyF +ssh_public_key ( 2).google.cloud.oslogin.common.SshPublicKeyBàA"V +DeletePosixAccountRequest9 +name ( B+àAúA% +#oslogin.googleapis.com/PosixAccount"V +DeleteSshPublicKeyRequest9 +name ( B+àAúA% +#oslogin.googleapis.com/SshPublicKey"z +GetLoginProfileRequest9 +name ( B+àAúA%#oslogin.googleapis.com/PosixAccount + +project_id (  + system_id ( "S +GetSshPublicKeyRequest9 +name ( B+àAúA% +#oslogin.googleapis.com/SshPublicKey"Ê +ImportSshPublicKeyRequest; +parent ( B+àAúA%#oslogin.googleapis.com/SshPublicKeyF +ssh_public_key ( 2).google.cloud.oslogin.common.SshPublicKeyBàA + +project_id (  +regions ( BàA"k +ImportSshPublicKeyResponse< + login_profile ( 2%.google.cloud.oslogin.v1.LoginProfile +details ( "Ï +UpdateSshPublicKeyRequest9 +name ( B+àAúA% +#oslogin.googleapis.com/SshPublicKeyF +ssh_public_key ( 2).google.cloud.oslogin.common.SshPublicKeyBàA/ + update_mask ( 2.google.protobuf.FieldMask2† +OsLoginServiceÇ +CreateSshPublicKey2.google.cloud.oslogin.v1.CreateSshPublicKeyRequest).google.cloud.oslogin.common.SshPublicKey"RÚAparent,ssh_public_key‚Óä“4""/v1/{parent=users/*}/sshPublicKeys:ssh_public_keyŽ +DeletePosixAccount2.google.cloud.oslogin.v1.DeletePosixAccountRequest.google.protobuf.Empty",ÚAname‚Óä“*/v1/{name=users/*/projects/*}“ +DeleteSshPublicKey2.google.cloud.oslogin.v1.DeleteSshPublicKeyRequest.google.protobuf.Empty"1ÚAname‚Óä“$*"/v1/{name=users/*/sshPublicKeys/*}™ +GetLoginProfile/.google.cloud.oslogin.v1.GetLoginProfileRequest%.google.cloud.oslogin.v1.LoginProfile".ÚAname‚Óä“!/v1/{name=users/*}/loginProfile  +GetSshPublicKey/.google.cloud.oslogin.v1.GetSshPublicKeyRequest).google.cloud.oslogin.common.SshPublicKey"1ÚAname‚Óä“$"/v1/{name=users/*/sshPublicKeys/*}ù +ImportSshPublicKey2.google.cloud.oslogin.v1.ImportSshPublicKeyRequest3.google.cloud.oslogin.v1.ImportSshPublicKeyResponse"zÚAparent,ssh_public_keyÚA parent,ssh_public_key,project_id‚Óä“9"\'/v1/{parent=users/*}:importSshPublicKey:ssh_public_keyç +UpdateSshPublicKey2.google.cloud.oslogin.v1.UpdateSshPublicKeyRequest).google.cloud.oslogin.common.SshPublicKey"rÚAname,ssh_public_keyÚAname,ssh_public_key,update_mask‚Óä“42"/v1/{name=users/*/sshPublicKeys/*}:ssh_public_keyÝÊAoslogin.googleapis.comÒAÀhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/compute,https://www.googleapis.com/auth/compute.readonlyBµ +com.google.cloud.oslogin.v1B OsLoginProtoPZ5cloud.google.com/go/oslogin/apiv1/osloginpb;osloginpbªGoogle.Cloud.OsLogin.V1ÊGoogle\\Cloud\\OsLogin\\V1êGoogle::Cloud::OsLogin::V1bproto3' , true); static::$is_initialized = true; diff --git a/OsLogin/owlbot.py b/OsLogin/owlbot.py index 694aa26503b..ee8d3ef0a17 100644 --- a/OsLogin/owlbot.py +++ b/OsLogin/owlbot.py @@ -15,7 +15,6 @@ """This script is used to synthesize generated parts of this library.""" import logging -import shutil from pathlib import Path import subprocess @@ -31,23 +30,6 @@ # Added so that we can pass copy_excludes in the owlbot_main() call _tracked_paths.add(src) -# 1. Handle common protos if staged separately (Librarian pipeline) -if (src / "common-protos").exists(): - php.owlbot_copy_version( - src=src / "common-protos", - dest=dest, - version_string="common", - ) -# 2. Handle common protos bundled inside v1 staging (Legacy OwlBot pipeline) -proto_common = src / "v1/proto/src/Google/Cloud/OsLogin/Common" -metadata_common = src / "v1/proto/src/GPBMetadata/Google/Cloud/Oslogin/Common" -if proto_common.exists(): - s.move([proto_common], dest / "src/Common", merge=php._merge) - shutil.rmtree(proto_common) -if metadata_common.exists(): - s.move([metadata_common], dest / "metadata/Common", merge=php._merge) - shutil.rmtree(metadata_common) -# 3. Copy V1 protos and GAPIC files php.owlbot_main(src=src, dest=dest) # format generated clients diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/create_ssh_public_key.php b/OsLogin/samples/V1beta/OsLoginServiceClient/create_ssh_public_key.php new file mode 100644 index 00000000000..74e3ff5cbd5 --- /dev/null +++ b/OsLogin/samples/V1beta/OsLoginServiceClient/create_ssh_public_key.php @@ -0,0 +1,69 @@ +createSshPublicKey($formattedParent, $sshPublicKey); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedParent = OsLoginServiceClient::userName('[USER]'); + + create_ssh_public_key_sample($formattedParent); +} +// [END oslogin_v1beta_generated_OsLoginService_CreateSshPublicKey_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/delete_posix_account.php b/OsLogin/samples/V1beta/OsLoginServiceClient/delete_posix_account.php new file mode 100644 index 00000000000..9b841ea60b5 --- /dev/null +++ b/OsLogin/samples/V1beta/OsLoginServiceClient/delete_posix_account.php @@ -0,0 +1,66 @@ +deletePosixAccount($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = OsLoginServiceClient::posixAccountName('[USER]', '[PROJECT]'); + + delete_posix_account_sample($formattedName); +} +// [END oslogin_v1beta_generated_OsLoginService_DeletePosixAccount_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/delete_ssh_public_key.php b/OsLogin/samples/V1beta/OsLoginServiceClient/delete_ssh_public_key.php new file mode 100644 index 00000000000..9b5a69db648 --- /dev/null +++ b/OsLogin/samples/V1beta/OsLoginServiceClient/delete_ssh_public_key.php @@ -0,0 +1,66 @@ +deleteSshPublicKey($formattedName); + printf('Call completed successfully.' . PHP_EOL); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = OsLoginServiceClient::sshPublicKeyName('[USER]', '[FINGERPRINT]'); + + delete_ssh_public_key_sample($formattedName); +} +// [END oslogin_v1beta_generated_OsLoginService_DeleteSshPublicKey_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/get_login_profile.php b/OsLogin/samples/V1beta/OsLoginServiceClient/get_login_profile.php new file mode 100644 index 00000000000..0230c7ad6c1 --- /dev/null +++ b/OsLogin/samples/V1beta/OsLoginServiceClient/get_login_profile.php @@ -0,0 +1,67 @@ +getLoginProfile($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = OsLoginServiceClient::userName('[USER]'); + + get_login_profile_sample($formattedName); +} +// [END oslogin_v1beta_generated_OsLoginService_GetLoginProfile_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/get_ssh_public_key.php b/OsLogin/samples/V1beta/OsLoginServiceClient/get_ssh_public_key.php new file mode 100644 index 00000000000..397939f37be --- /dev/null +++ b/OsLogin/samples/V1beta/OsLoginServiceClient/get_ssh_public_key.php @@ -0,0 +1,68 @@ +getSshPublicKey($formattedName); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = OsLoginServiceClient::sshPublicKeyName('[USER]', '[FINGERPRINT]'); + + get_ssh_public_key_sample($formattedName); +} +// [END oslogin_v1beta_generated_OsLoginService_GetSshPublicKey_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/import_ssh_public_key.php b/OsLogin/samples/V1beta/OsLoginServiceClient/import_ssh_public_key.php new file mode 100644 index 00000000000..0d47c89a8b6 --- /dev/null +++ b/OsLogin/samples/V1beta/OsLoginServiceClient/import_ssh_public_key.php @@ -0,0 +1,59 @@ +importSshPublicKey($sshPublicKey); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END oslogin_v1beta_generated_OsLoginService_ImportSshPublicKey_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/sign_ssh_public_key.php b/OsLogin/samples/V1beta/OsLoginServiceClient/sign_ssh_public_key.php new file mode 100644 index 00000000000..bbfb72f2de9 --- /dev/null +++ b/OsLogin/samples/V1beta/OsLoginServiceClient/sign_ssh_public_key.php @@ -0,0 +1,53 @@ +signSshPublicKey(); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END oslogin_v1beta_generated_OsLoginService_SignSshPublicKey_sync] diff --git a/OsLogin/samples/V1beta/OsLoginServiceClient/update_ssh_public_key.php b/OsLogin/samples/V1beta/OsLoginServiceClient/update_ssh_public_key.php new file mode 100644 index 00000000000..9d9cc071690 --- /dev/null +++ b/OsLogin/samples/V1beta/OsLoginServiceClient/update_ssh_public_key.php @@ -0,0 +1,72 @@ +updateSshPublicKey($formattedName, $sshPublicKey); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $formattedName = OsLoginServiceClient::sshPublicKeyName('[USER]', '[FINGERPRINT]'); + + update_ssh_public_key_sample($formattedName); +} +// [END oslogin_v1beta_generated_OsLoginService_UpdateSshPublicKey_sync] diff --git a/OsLogin/src/Common/PosixAccount.php b/OsLogin/src/Common/PosixAccount.php index 21c5f38b900..99d5713285c 100644 --- a/OsLogin/src/Common/PosixAccount.php +++ b/OsLogin/src/Common/PosixAccount.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\Common; use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; -use Google\Protobuf\RepeatedField; /** * The POSIX account information associated with a Google account. diff --git a/OsLogin/src/Common/SshPublicKey.php b/OsLogin/src/Common/SshPublicKey.php index a6a22948e91..185588081e3 100644 --- a/OsLogin/src/Common/SshPublicKey.php +++ b/OsLogin/src/Common/SshPublicKey.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\Common; use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; -use Google\Protobuf\RepeatedField; /** * The SSH public key information associated with a Google account. @@ -17,7 +17,8 @@ class SshPublicKey extends \Google\Protobuf\Internal\Message { /** * Public key text in SSH format, defined by - * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6. + * RFC4253 + * section 6.6. * * Generated from protobuf field string key = 1; */ @@ -49,7 +50,8 @@ class SshPublicKey extends \Google\Protobuf\Internal\Message * * @type string $key * Public key text in SSH format, defined by - * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6. + * RFC4253 + * section 6.6. * @type int|string $expiration_time_usec * An expiration time in microseconds since epoch. * @type string $fingerprint @@ -65,7 +67,8 @@ public function __construct($data = NULL) { /** * Public key text in SSH format, defined by - * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6. + * RFC4253 + * section 6.6. * * Generated from protobuf field string key = 1; * @return string @@ -77,7 +80,8 @@ public function getKey() /** * Public key text in SSH format, defined by - * [RFC4253](https://www.ietf.org/rfc/rfc4253.txt) section 6.6. + * RFC4253 + * section 6.6. * * Generated from protobuf field string key = 1; * @param string $var diff --git a/OsLogin/src/V1/CreateSshPublicKeyRequest.php b/OsLogin/src/V1/CreateSshPublicKeyRequest.php index 42dcb515aba..76728c29f5e 100644 --- a/OsLogin/src/V1/CreateSshPublicKeyRequest.php +++ b/OsLogin/src/V1/CreateSshPublicKeyRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; -use Google\Protobuf\RepeatedField; /** * A request message for creating an SSH public key. diff --git a/OsLogin/src/V1/DeletePosixAccountRequest.php b/OsLogin/src/V1/DeletePosixAccountRequest.php index 9759d348125..965160ab977 100644 --- a/OsLogin/src/V1/DeletePosixAccountRequest.php +++ b/OsLogin/src/V1/DeletePosixAccountRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; -use Google\Protobuf\RepeatedField; /** * A request message for deleting a POSIX account entry. diff --git a/OsLogin/src/V1/DeleteSshPublicKeyRequest.php b/OsLogin/src/V1/DeleteSshPublicKeyRequest.php index a83f0eee3a4..11383a19392 100644 --- a/OsLogin/src/V1/DeleteSshPublicKeyRequest.php +++ b/OsLogin/src/V1/DeleteSshPublicKeyRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; -use Google\Protobuf\RepeatedField; /** * A request message for deleting an SSH public key. diff --git a/OsLogin/src/V1/GetLoginProfileRequest.php b/OsLogin/src/V1/GetLoginProfileRequest.php index 592913c0420..85992364fab 100644 --- a/OsLogin/src/V1/GetLoginProfileRequest.php +++ b/OsLogin/src/V1/GetLoginProfileRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; -use Google\Protobuf\RepeatedField; /** * A request message for retrieving the login profile information for a user. diff --git a/OsLogin/src/V1/GetSshPublicKeyRequest.php b/OsLogin/src/V1/GetSshPublicKeyRequest.php index dbda93eac14..6e6de1d0ec8 100644 --- a/OsLogin/src/V1/GetSshPublicKeyRequest.php +++ b/OsLogin/src/V1/GetSshPublicKeyRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; -use Google\Protobuf\RepeatedField; /** * A request message for retrieving an SSH public key. diff --git a/OsLogin/src/V1/ImportSshPublicKeyRequest.php b/OsLogin/src/V1/ImportSshPublicKeyRequest.php index e7142e79b04..122ed6f2f13 100644 --- a/OsLogin/src/V1/ImportSshPublicKeyRequest.php +++ b/OsLogin/src/V1/ImportSshPublicKeyRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; -use Google\Protobuf\RepeatedField; /** * A request message for importing an SSH public key. @@ -88,7 +88,7 @@ public static function buildFromParentSshPublicKeyProjectId(string $parent, \Goo * Optional. The SSH public key and expiration time. * @type string $project_id * The project ID of the Google Cloud Platform project. - * @type string[] $regions + * @type array|\Google\Protobuf\Internal\RepeatedField $regions * Optional. The regions to which to assert that the key was written. * If unspecified, defaults to all regions. * Regions are listed at https://cloud.google.com/about/locations#region. @@ -193,7 +193,7 @@ public function setProjectId($var) * Regions are listed at https://cloud.google.com/about/locations#region. * * Generated from protobuf field repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @return RepeatedField + * @return \Google\Protobuf\Internal\RepeatedField */ public function getRegions() { @@ -206,7 +206,7 @@ public function getRegions() * Regions are listed at https://cloud.google.com/about/locations#region. * * Generated from protobuf field repeated string regions = 5 [(.google.api.field_behavior) = OPTIONAL]; - * @param string[] $var + * @param array|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setRegions($var) diff --git a/OsLogin/src/V1/ImportSshPublicKeyResponse.php b/OsLogin/src/V1/ImportSshPublicKeyResponse.php index 5a0fb928fe2..c9c749a53be 100644 --- a/OsLogin/src/V1/ImportSshPublicKeyResponse.php +++ b/OsLogin/src/V1/ImportSshPublicKeyResponse.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; -use Google\Protobuf\RepeatedField; /** * A response message for importing an SSH public key. diff --git a/OsLogin/src/V1/LoginProfile.php b/OsLogin/src/V1/LoginProfile.php index 3381d644032..6abe567377c 100644 --- a/OsLogin/src/V1/LoginProfile.php +++ b/OsLogin/src/V1/LoginProfile.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; -use Google\Protobuf\RepeatedField; /** * The user profile information used for logging in to a virtual machine on @@ -43,7 +43,7 @@ class LoginProfile extends \Google\Protobuf\Internal\Message * * @type string $name * Required. A unique user ID. - * @type \Google\Cloud\OsLogin\Common\PosixAccount[] $posix_accounts + * @type array<\Google\Cloud\OsLogin\Common\PosixAccount>|\Google\Protobuf\Internal\RepeatedField $posix_accounts * The list of POSIX accounts associated with the user. * @type array|\Google\Protobuf\Internal\MapField $ssh_public_keys * A map from SSH public key fingerprint to the associated key object. @@ -84,7 +84,7 @@ public function setName($var) * The list of POSIX accounts associated with the user. * * Generated from protobuf field repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; - * @return RepeatedField<\Google\Cloud\OsLogin\Common\PosixAccount> + * @return \Google\Protobuf\Internal\RepeatedField */ public function getPosixAccounts() { @@ -95,7 +95,7 @@ public function getPosixAccounts() * The list of POSIX accounts associated with the user. * * Generated from protobuf field repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2; - * @param \Google\Cloud\OsLogin\Common\PosixAccount[] $var + * @param array<\Google\Cloud\OsLogin\Common\PosixAccount>|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setPosixAccounts($var) diff --git a/OsLogin/src/V1/UpdateSshPublicKeyRequest.php b/OsLogin/src/V1/UpdateSshPublicKeyRequest.php index 1e00af3a187..421c2a2586c 100644 --- a/OsLogin/src/V1/UpdateSshPublicKeyRequest.php +++ b/OsLogin/src/V1/UpdateSshPublicKeyRequest.php @@ -5,8 +5,8 @@ namespace Google\Cloud\OsLogin\V1; use Google\Protobuf\Internal\GPBType; +use Google\Protobuf\Internal\RepeatedField; use Google\Protobuf\Internal\GPBUtil; -use Google\Protobuf\RepeatedField; /** * A request message for updating an SSH public key. From 936bef6e731a4f07b72af3ab0e65c370c1020b35 Mon Sep 17 00:00:00 2001 From: JoeWang1127 Date: Mon, 24 Aug 2026 18:58:19 +0000 Subject: [PATCH 21/21] restore --- .../V2/Client/BigtableInstanceAdminClient.php | 41 +- .../V2/Client/BigtableTableAdminClient.php | 66 +- Bigtable/src/V2/Client/BigtableClient.php | 32 +- .../BigtableInstanceAdminClientTest.php | 649 ++++++++-------- .../Client/BigtableTableAdminClientTest.php | 735 +++++++++--------- .../Unit/V2/Client/BigtableClientTest.php | 300 ++++--- 6 files changed, 852 insertions(+), 971 deletions(-) diff --git a/Bigtable/src/Admin/V2/Client/BigtableInstanceAdminClient.php b/Bigtable/src/Admin/V2/Client/BigtableInstanceAdminClient.php index b25269907f8..cb812a4d13a 100644 --- a/Bigtable/src/Admin/V2/Client/BigtableInstanceAdminClient.php +++ b/Bigtable/src/Admin/V2/Client/BigtableInstanceAdminClient.php @@ -208,10 +208,7 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = - $methodName && isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; + $options = $methodName && isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; @@ -644,10 +641,8 @@ public function createLogicalView(CreateLogicalViewRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function createMaterializedView( - CreateMaterializedViewRequest $request, - array $callOptions = [] - ): OperationResponse { + public function createMaterializedView(CreateMaterializedViewRequest $request, array $callOptions = []): OperationResponse + { return $this->startApiCall('CreateMaterializedView', $request, $callOptions)->wait(); } @@ -1087,10 +1082,8 @@ public function listLogicalViews(ListLogicalViewsRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function listMaterializedViews( - ListMaterializedViewsRequest $request, - array $callOptions = [] - ): PagedListResponse { + public function listMaterializedViews(ListMaterializedViewsRequest $request, array $callOptions = []): PagedListResponse + { return $this->startApiCall('ListMaterializedViews', $request, $callOptions); } @@ -1127,10 +1120,8 @@ public function listMaterializedViews( * * @throws ApiException Thrown if the API call fails. */ - public function partialUpdateCluster( - PartialUpdateClusterRequest $request, - array $callOptions = [] - ): OperationResponse { + public function partialUpdateCluster(PartialUpdateClusterRequest $request, array $callOptions = []): OperationResponse + { return $this->startApiCall('PartialUpdateCluster', $request, $callOptions)->wait(); } @@ -1157,10 +1148,8 @@ public function partialUpdateCluster( * * @throws ApiException Thrown if the API call fails. */ - public function partialUpdateInstance( - PartialUpdateInstanceRequest $request, - array $callOptions = [] - ): OperationResponse { + public function partialUpdateInstance(PartialUpdateInstanceRequest $request, array $callOptions = []): OperationResponse + { return $this->startApiCall('PartialUpdateInstance', $request, $callOptions)->wait(); } @@ -1213,10 +1202,8 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions( - TestIamPermissionsRequest $request, - array $callOptions = [] - ): TestIamPermissionsResponse { + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } @@ -1354,10 +1341,8 @@ public function updateLogicalView(UpdateLogicalViewRequest $request, array $call * * @throws ApiException Thrown if the API call fails. */ - public function updateMaterializedView( - UpdateMaterializedViewRequest $request, - array $callOptions = [] - ): OperationResponse { + public function updateMaterializedView(UpdateMaterializedViewRequest $request, array $callOptions = []): OperationResponse + { return $this->startApiCall('UpdateMaterializedView', $request, $callOptions)->wait(); } diff --git a/Bigtable/src/Admin/V2/Client/BigtableTableAdminClient.php b/Bigtable/src/Admin/V2/Client/BigtableTableAdminClient.php index 7b627630af9..f3f5db0b68f 100644 --- a/Bigtable/src/Admin/V2/Client/BigtableTableAdminClient.php +++ b/Bigtable/src/Admin/V2/Client/BigtableTableAdminClient.php @@ -221,10 +221,7 @@ public function getOperationsClient() */ public function resumeOperation($operationName, $methodName = null) { - $options = - $methodName && isset($this->descriptors[$methodName]['longRunning']) - ? $this->descriptors[$methodName]['longRunning'] - : []; + $options = $methodName && isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); $operation->reload(); return $operation; @@ -260,12 +257,8 @@ private function createOperationsClient(array $options) * * @return string The formatted authorized_view resource. */ - public static function authorizedViewName( - string $project, - string $instance, - string $table, - string $authorizedView - ): string { + public static function authorizedViewName(string $project, string $instance, string $table, string $authorizedView): string + { return self::getPathTemplate('authorizedView')->render([ 'project' => $project, 'instance' => $instance, @@ -326,13 +319,8 @@ public static function clusterName(string $project, string $instance, string $cl * * @return string The formatted crypto_key_version resource. */ - public static function cryptoKeyVersionName( - string $project, - string $location, - string $keyRing, - string $cryptoKey, - string $cryptoKeyVersion - ): string { + public static function cryptoKeyVersionName(string $project, string $location, string $keyRing, string $cryptoKey, string $cryptoKeyVersion): string + { return self::getPathTemplate('cryptoKeyVersion')->render([ 'project' => $project, 'location' => $location, @@ -387,12 +375,8 @@ public static function locationName(string $project, string $location): string * * @return string The formatted schema_bundle resource. */ - public static function schemaBundleName( - string $project, - string $instance, - string $table, - string $schemaBundle - ): string { + public static function schemaBundleName(string $project, string $instance, string $table, string $schemaBundle): string + { return self::getPathTemplate('schemaBundle')->render([ 'project' => $project, 'instance' => $instance, @@ -587,10 +571,8 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function checkConsistency( - CheckConsistencyRequest $request, - array $callOptions = [] - ): CheckConsistencyResponse { + public function checkConsistency(CheckConsistencyRequest $request, array $callOptions = []): CheckConsistencyResponse + { return $this->startApiCall('CheckConsistency', $request, $callOptions)->wait(); } @@ -643,10 +625,8 @@ public function copyBackup(CopyBackupRequest $request, array $callOptions = []): * * @throws ApiException Thrown if the API call fails. */ - public function createAuthorizedView( - CreateAuthorizedViewRequest $request, - array $callOptions = [] - ): OperationResponse { + public function createAuthorizedView(CreateAuthorizedViewRequest $request, array $callOptions = []): OperationResponse + { return $this->startApiCall('CreateAuthorizedView', $request, $callOptions)->wait(); } @@ -767,10 +747,8 @@ public function createTable(CreateTableRequest $request, array $callOptions = [] * * @throws ApiException Thrown if the API call fails. */ - public function createTableFromSnapshot( - CreateTableFromSnapshotRequest $request, - array $callOptions = [] - ): OperationResponse { + public function createTableFromSnapshot(CreateTableFromSnapshotRequest $request, array $callOptions = []): OperationResponse + { return $this->startApiCall('CreateTableFromSnapshot', $request, $callOptions)->wait(); } @@ -953,10 +931,8 @@ public function dropRowRange(DropRowRangeRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function generateConsistencyToken( - GenerateConsistencyTokenRequest $request, - array $callOptions = [] - ): GenerateConsistencyTokenResponse { + public function generateConsistencyToken(GenerateConsistencyTokenRequest $request, array $callOptions = []): GenerateConsistencyTokenResponse + { return $this->startApiCall('GenerateConsistencyToken', $request, $callOptions)->wait(); } @@ -1407,10 +1383,8 @@ public function snapshotTable(SnapshotTableRequest $request, array $callOptions * * @throws ApiException Thrown if the API call fails. */ - public function testIamPermissions( - TestIamPermissionsRequest $request, - array $callOptions = [] - ): TestIamPermissionsResponse { + public function testIamPermissions(TestIamPermissionsRequest $request, array $callOptions = []): TestIamPermissionsResponse + { return $this->startApiCall('TestIamPermissions', $request, $callOptions)->wait(); } @@ -1462,10 +1436,8 @@ public function undeleteTable(UndeleteTableRequest $request, array $callOptions * * @throws ApiException Thrown if the API call fails. */ - public function updateAuthorizedView( - UpdateAuthorizedViewRequest $request, - array $callOptions = [] - ): OperationResponse { + public function updateAuthorizedView(UpdateAuthorizedViewRequest $request, array $callOptions = []): OperationResponse + { return $this->startApiCall('UpdateAuthorizedView', $request, $callOptions)->wait(); } diff --git a/Bigtable/src/V2/Client/BigtableClient.php b/Bigtable/src/V2/Client/BigtableClient.php index 45ec3f1c5f3..405f7f8fd3a 100644 --- a/Bigtable/src/V2/Client/BigtableClient.php +++ b/Bigtable/src/V2/Client/BigtableClient.php @@ -152,12 +152,8 @@ private static function getClientDefaults() * * @return string The formatted authorized_view resource. */ - public static function authorizedViewName( - string $project, - string $instance, - string $table, - string $authorizedView - ): string { + public static function authorizedViewName(string $project, string $instance, string $table, string $authorizedView): string + { return self::getPathTemplate('authorizedView')->render([ 'project' => $project, 'instance' => $instance, @@ -359,10 +355,8 @@ public function __call($method, $args) * * @throws ApiException Thrown if the API call fails. */ - public function checkAndMutateRow( - CheckAndMutateRowRequest $request, - array $callOptions = [] - ): CheckAndMutateRowResponse { + public function checkAndMutateRow(CheckAndMutateRowRequest $request, array $callOptions = []): CheckAndMutateRowResponse + { return $this->startApiCall('CheckAndMutateRow', $request, $callOptions)->wait(); } @@ -408,10 +402,8 @@ public function executeQuery(ExecuteQueryRequest $request, array $callOptions = * * @throws ApiException Thrown if the API call fails. */ - public function generateInitialChangeStreamPartitions( - GenerateInitialChangeStreamPartitionsRequest $request, - array $callOptions = [] - ): ServerStream { + public function generateInitialChangeStreamPartitions(GenerateInitialChangeStreamPartitionsRequest $request, array $callOptions = []): ServerStream + { return $this->startApiCall('GenerateInitialChangeStreamPartitions', $request, $callOptions); } @@ -438,10 +430,8 @@ public function generateInitialChangeStreamPartitions( * * @throws ApiException Thrown if the API call fails. */ - public function getClientConfiguration( - GetClientConfigurationRequest $request, - array $callOptions = [] - ): ClientConfiguration { + public function getClientConfiguration(GetClientConfigurationRequest $request, array $callOptions = []): ClientConfiguration + { return $this->startApiCall('GetClientConfiguration', $request, $callOptions)->wait(); } @@ -668,10 +658,8 @@ public function readChangeStream(ReadChangeStreamRequest $request, array $callOp * * @throws ApiException Thrown if the API call fails. */ - public function readModifyWriteRow( - ReadModifyWriteRowRequest $request, - array $callOptions = [] - ): ReadModifyWriteRowResponse { + public function readModifyWriteRow(ReadModifyWriteRowRequest $request, array $callOptions = []): ReadModifyWriteRowResponse + { return $this->startApiCall('ReadModifyWriteRow', $request, $callOptions)->wait(); } diff --git a/Bigtable/tests/Unit/Admin/V2/Client/BigtableInstanceAdminClientTest.php b/Bigtable/tests/Unit/Admin/V2/Client/BigtableInstanceAdminClientTest.php index aef275f247e..9408fe83731 100644 --- a/Bigtable/tests/Unit/Admin/V2/Client/BigtableInstanceAdminClientTest.php +++ b/Bigtable/tests/Unit/Admin/V2/Client/BigtableInstanceAdminClientTest.php @@ -96,9 +96,7 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); } /** @return BigtableInstanceAdminClient */ @@ -162,15 +160,12 @@ public function createAppProfileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -299,15 +294,12 @@ public function createClusterExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -469,15 +461,12 @@ public function createInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); @@ -635,15 +624,12 @@ public function createLogicalViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -783,15 +769,12 @@ public function createMaterializedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -839,7 +822,9 @@ public function deleteAppProfileTest() // Mock request $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); $ignoreWarnings = true; - $request = (new DeleteAppProfileRequest())->setName($formattedName)->setIgnoreWarnings($ignoreWarnings); + $request = (new DeleteAppProfileRequest()) + ->setName($formattedName) + ->setIgnoreWarnings($ignoreWarnings); $gapicClient->deleteAppProfile($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -864,20 +849,19 @@ public function deleteAppProfileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); $ignoreWarnings = true; - $request = (new DeleteAppProfileRequest())->setName($formattedName)->setIgnoreWarnings($ignoreWarnings); + $request = (new DeleteAppProfileRequest()) + ->setName($formattedName) + ->setIgnoreWarnings($ignoreWarnings); try { $gapicClient->deleteAppProfile($request); // If the $gapicClient method call did not throw, fail the test @@ -904,7 +888,8 @@ public function deleteClusterTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new DeleteClusterRequest())->setName($formattedName); + $request = (new DeleteClusterRequest()) + ->setName($formattedName); $gapicClient->deleteCluster($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -927,19 +912,17 @@ public function deleteClusterExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new DeleteClusterRequest())->setName($formattedName); + $request = (new DeleteClusterRequest()) + ->setName($formattedName); try { $gapicClient->deleteCluster($request); // If the $gapicClient method call did not throw, fail the test @@ -966,7 +949,8 @@ public function deleteInstanceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest())->setName($formattedName); + $request = (new DeleteInstanceRequest()) + ->setName($formattedName); $gapicClient->deleteInstance($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -989,19 +973,17 @@ public function deleteInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new DeleteInstanceRequest())->setName($formattedName); + $request = (new DeleteInstanceRequest()) + ->setName($formattedName); try { $gapicClient->deleteInstance($request); // If the $gapicClient method call did not throw, fail the test @@ -1028,7 +1010,8 @@ public function deleteLogicalViewTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->logicalViewName('[PROJECT]', '[INSTANCE]', '[LOGICAL_VIEW]'); - $request = (new DeleteLogicalViewRequest())->setName($formattedName); + $request = (new DeleteLogicalViewRequest()) + ->setName($formattedName); $gapicClient->deleteLogicalView($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1051,19 +1034,17 @@ public function deleteLogicalViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->logicalViewName('[PROJECT]', '[INSTANCE]', '[LOGICAL_VIEW]'); - $request = (new DeleteLogicalViewRequest())->setName($formattedName); + $request = (new DeleteLogicalViewRequest()) + ->setName($formattedName); try { $gapicClient->deleteLogicalView($request); // If the $gapicClient method call did not throw, fail the test @@ -1090,7 +1071,8 @@ public function deleteMaterializedViewTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->materializedViewName('[PROJECT]', '[INSTANCE]', '[MATERIALIZED_VIEW]'); - $request = (new DeleteMaterializedViewRequest())->setName($formattedName); + $request = (new DeleteMaterializedViewRequest()) + ->setName($formattedName); $gapicClient->deleteMaterializedView($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1113,19 +1095,17 @@ public function deleteMaterializedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->materializedViewName('[PROJECT]', '[INSTANCE]', '[MATERIALIZED_VIEW]'); - $request = (new DeleteMaterializedViewRequest())->setName($formattedName); + $request = (new DeleteMaterializedViewRequest()) + ->setName($formattedName); try { $gapicClient->deleteMaterializedView($request); // If the $gapicClient method call did not throw, fail the test @@ -1158,7 +1138,8 @@ public function getAppProfileTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - $request = (new GetAppProfileRequest())->setName($formattedName); + $request = (new GetAppProfileRequest()) + ->setName($formattedName); $response = $gapicClient->getAppProfile($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1182,19 +1163,17 @@ public function getAppProfileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->appProfileName('[PROJECT]', '[INSTANCE]', '[APP_PROFILE]'); - $request = (new GetAppProfileRequest())->setName($formattedName); + $request = (new GetAppProfileRequest()) + ->setName($formattedName); try { $gapicClient->getAppProfile($request); // If the $gapicClient method call did not throw, fail the test @@ -1227,7 +1206,8 @@ public function getClusterTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new GetClusterRequest())->setName($formattedName); + $request = (new GetClusterRequest()) + ->setName($formattedName); $response = $gapicClient->getCluster($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1251,19 +1231,17 @@ public function getClusterExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new GetClusterRequest())->setName($formattedName); + $request = (new GetClusterRequest()) + ->setName($formattedName); try { $gapicClient->getCluster($request); // If the $gapicClient method call did not throw, fail the test @@ -1294,7 +1272,8 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest())->setResource($resource); + $request = (new GetIamPolicyRequest()) + ->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1318,19 +1297,17 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest())->setResource($resource); + $request = (new GetIamPolicyRequest()) + ->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1365,7 +1342,8 @@ public function getInstanceTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new GetInstanceRequest())->setName($formattedName); + $request = (new GetInstanceRequest()) + ->setName($formattedName); $response = $gapicClient->getInstance($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1389,19 +1367,17 @@ public function getInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new GetInstanceRequest())->setName($formattedName); + $request = (new GetInstanceRequest()) + ->setName($formattedName); try { $gapicClient->getInstance($request); // If the $gapicClient method call did not throw, fail the test @@ -1436,7 +1412,8 @@ public function getLogicalViewTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->logicalViewName('[PROJECT]', '[INSTANCE]', '[LOGICAL_VIEW]'); - $request = (new GetLogicalViewRequest())->setName($formattedName); + $request = (new GetLogicalViewRequest()) + ->setName($formattedName); $response = $gapicClient->getLogicalView($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1460,19 +1437,17 @@ public function getLogicalViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->logicalViewName('[PROJECT]', '[INSTANCE]', '[LOGICAL_VIEW]'); - $request = (new GetLogicalViewRequest())->setName($formattedName); + $request = (new GetLogicalViewRequest()) + ->setName($formattedName); try { $gapicClient->getLogicalView($request); // If the $gapicClient method call did not throw, fail the test @@ -1507,7 +1482,8 @@ public function getMaterializedViewTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->materializedViewName('[PROJECT]', '[INSTANCE]', '[MATERIALIZED_VIEW]'); - $request = (new GetMaterializedViewRequest())->setName($formattedName); + $request = (new GetMaterializedViewRequest()) + ->setName($formattedName); $response = $gapicClient->getMaterializedView($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1531,19 +1507,17 @@ public function getMaterializedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->materializedViewName('[PROJECT]', '[INSTANCE]', '[MATERIALIZED_VIEW]'); - $request = (new GetMaterializedViewRequest())->setName($formattedName); + $request = (new GetMaterializedViewRequest()) + ->setName($formattedName); try { $gapicClient->getMaterializedView($request); // If the $gapicClient method call did not throw, fail the test @@ -1568,14 +1542,17 @@ public function listAppProfilesTest() // Mock response $nextPageToken = ''; $appProfilesElement = new AppProfile(); - $appProfiles = [$appProfilesElement]; + $appProfiles = [ + $appProfilesElement, + ]; $expectedResponse = new ListAppProfilesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setAppProfiles($appProfiles); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListAppProfilesRequest())->setParent($formattedParent); + $request = (new ListAppProfilesRequest()) + ->setParent($formattedParent); $response = $gapicClient->listAppProfiles($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1602,19 +1579,17 @@ public function listAppProfilesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListAppProfilesRequest())->setParent($formattedParent); + $request = (new ListAppProfilesRequest()) + ->setParent($formattedParent); try { $gapicClient->listAppProfiles($request); // If the $gapicClient method call did not throw, fail the test @@ -1643,7 +1618,8 @@ public function listClustersTest() $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListClustersRequest())->setParent($formattedParent); + $request = (new ListClustersRequest()) + ->setParent($formattedParent); $response = $gapicClient->listClusters($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1667,19 +1643,17 @@ public function listClustersExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListClustersRequest())->setParent($formattedParent); + $request = (new ListClustersRequest()) + ->setParent($formattedParent); try { $gapicClient->listClusters($request); // If the $gapicClient method call did not throw, fail the test @@ -1704,14 +1678,17 @@ public function listHotTabletsTest() // Mock response $nextPageToken = ''; $hotTabletsElement = new HotTablet(); - $hotTablets = [$hotTabletsElement]; + $hotTablets = [ + $hotTabletsElement, + ]; $expectedResponse = new ListHotTabletsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setHotTablets($hotTablets); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new ListHotTabletsRequest())->setParent($formattedParent); + $request = (new ListHotTabletsRequest()) + ->setParent($formattedParent); $response = $gapicClient->listHotTablets($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1738,19 +1715,17 @@ public function listHotTabletsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new ListHotTabletsRequest())->setParent($formattedParent); + $request = (new ListHotTabletsRequest()) + ->setParent($formattedParent); try { $gapicClient->listHotTablets($request); // If the $gapicClient method call did not throw, fail the test @@ -1779,7 +1754,8 @@ public function listInstancesTest() $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListInstancesRequest())->setParent($formattedParent); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); $response = $gapicClient->listInstances($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1803,19 +1779,17 @@ public function listInstancesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->projectName('[PROJECT]'); - $request = (new ListInstancesRequest())->setParent($formattedParent); + $request = (new ListInstancesRequest()) + ->setParent($formattedParent); try { $gapicClient->listInstances($request); // If the $gapicClient method call did not throw, fail the test @@ -1840,14 +1814,17 @@ public function listLogicalViewsTest() // Mock response $nextPageToken = ''; $logicalViewsElement = new LogicalView(); - $logicalViews = [$logicalViewsElement]; + $logicalViews = [ + $logicalViewsElement, + ]; $expectedResponse = new ListLogicalViewsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setLogicalViews($logicalViews); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListLogicalViewsRequest())->setParent($formattedParent); + $request = (new ListLogicalViewsRequest()) + ->setParent($formattedParent); $response = $gapicClient->listLogicalViews($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1874,19 +1851,17 @@ public function listLogicalViewsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListLogicalViewsRequest())->setParent($formattedParent); + $request = (new ListLogicalViewsRequest()) + ->setParent($formattedParent); try { $gapicClient->listLogicalViews($request); // If the $gapicClient method call did not throw, fail the test @@ -1911,14 +1886,17 @@ public function listMaterializedViewsTest() // Mock response $nextPageToken = ''; $materializedViewsElement = new MaterializedView(); - $materializedViews = [$materializedViewsElement]; + $materializedViews = [ + $materializedViewsElement, + ]; $expectedResponse = new ListMaterializedViewsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setMaterializedViews($materializedViews); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListMaterializedViewsRequest())->setParent($formattedParent); + $request = (new ListMaterializedViewsRequest()) + ->setParent($formattedParent); $response = $gapicClient->listMaterializedViews($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1945,19 +1923,17 @@ public function listMaterializedViewsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListMaterializedViewsRequest())->setParent($formattedParent); + $request = (new ListMaterializedViewsRequest()) + ->setParent($formattedParent); try { $gapicClient->listMaterializedViews($request); // If the $gapicClient method call did not throw, fail the test @@ -2013,7 +1989,9 @@ public function partialUpdateClusterTest() $clusterServeNodes = 1434304124; $cluster->setServeNodes($clusterServeNodes); $updateMask = new FieldMask(); - $request = (new PartialUpdateClusterRequest())->setCluster($cluster)->setUpdateMask($updateMask); + $request = (new PartialUpdateClusterRequest()) + ->setCluster($cluster) + ->setUpdateMask($updateMask); $response = $gapicClient->partialUpdateCluster($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2071,15 +2049,12 @@ public function partialUpdateClusterExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $cluster = new Cluster(); @@ -2088,7 +2063,9 @@ public function partialUpdateClusterExceptionTest() $clusterServeNodes = 1434304124; $cluster->setServeNodes($clusterServeNodes); $updateMask = new FieldMask(); - $request = (new PartialUpdateClusterRequest())->setCluster($cluster)->setUpdateMask($updateMask); + $request = (new PartialUpdateClusterRequest()) + ->setCluster($cluster) + ->setUpdateMask($updateMask); $response = $gapicClient->partialUpdateCluster($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2162,7 +2139,9 @@ public function partialUpdateInstanceTest() ]; $instance->setLabels($instanceLabels); $updateMask = new FieldMask(); - $request = (new PartialUpdateInstanceRequest())->setInstance($instance)->setUpdateMask($updateMask); + $request = (new PartialUpdateInstanceRequest()) + ->setInstance($instance) + ->setUpdateMask($updateMask); $response = $gapicClient->partialUpdateInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2220,15 +2199,12 @@ public function partialUpdateInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $instance = new Instance(); @@ -2244,7 +2220,9 @@ public function partialUpdateInstanceExceptionTest() ]; $instance->setLabels($instanceLabels); $updateMask = new FieldMask(); - $request = (new PartialUpdateInstanceRequest())->setInstance($instance)->setUpdateMask($updateMask); + $request = (new PartialUpdateInstanceRequest()) + ->setInstance($instance) + ->setUpdateMask($updateMask); $response = $gapicClient->partialUpdateInstance($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2285,7 +2263,9 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2311,20 +2291,19 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2352,7 +2331,9 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2378,20 +2359,19 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -2443,7 +2423,9 @@ public function updateAppProfileTest() // Mock request $appProfile = new AppProfile(); $updateMask = new FieldMask(); - $request = (new UpdateAppProfileRequest())->setAppProfile($appProfile)->setUpdateMask($updateMask); + $request = (new UpdateAppProfileRequest()) + ->setAppProfile($appProfile) + ->setUpdateMask($updateMask); $response = $gapicClient->updateAppProfile($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2501,20 +2483,19 @@ public function updateAppProfileExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $appProfile = new AppProfile(); $updateMask = new FieldMask(); - $request = (new UpdateAppProfileRequest())->setAppProfile($appProfile)->setUpdateMask($updateMask); + $request = (new UpdateAppProfileRequest()) + ->setAppProfile($appProfile) + ->setUpdateMask($updateMask); $response = $gapicClient->updateAppProfile($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2575,7 +2556,9 @@ public function updateClusterTest() // Mock request $name = 'name3373707'; $serveNodes = 1288838783; - $request = (new Cluster())->setName($name)->setServeNodes($serveNodes); + $request = (new Cluster()) + ->setName($name) + ->setServeNodes($serveNodes); $response = $gapicClient->updateCluster($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2633,20 +2616,19 @@ public function updateClusterExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $name = 'name3373707'; $serveNodes = 1288838783; - $request = (new Cluster())->setName($name)->setServeNodes($serveNodes); + $request = (new Cluster()) + ->setName($name) + ->setServeNodes($serveNodes); $response = $gapicClient->updateCluster($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2730,15 +2712,12 @@ public function updateInstanceExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $name = 'name3373707'; @@ -2807,7 +2786,8 @@ public function updateLogicalViewTest() $logicalView = new LogicalView(); $logicalViewQuery = 'logicalViewQuery1609026330'; $logicalView->setQuery($logicalViewQuery); - $request = (new UpdateLogicalViewRequest())->setLogicalView($logicalView); + $request = (new UpdateLogicalViewRequest()) + ->setLogicalView($logicalView); $response = $gapicClient->updateLogicalView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2863,21 +2843,19 @@ public function updateLogicalViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $logicalView = new LogicalView(); $logicalViewQuery = 'logicalViewQuery1609026330'; $logicalView->setQuery($logicalViewQuery); - $request = (new UpdateLogicalViewRequest())->setLogicalView($logicalView); + $request = (new UpdateLogicalViewRequest()) + ->setLogicalView($logicalView); $response = $gapicClient->updateLogicalView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2941,7 +2919,8 @@ public function updateMaterializedViewTest() $materializedView = new MaterializedView(); $materializedViewQuery = 'materializedViewQuery1755221932'; $materializedView->setQuery($materializedViewQuery); - $request = (new UpdateMaterializedViewRequest())->setMaterializedView($materializedView); + $request = (new UpdateMaterializedViewRequest()) + ->setMaterializedView($materializedView); $response = $gapicClient->updateMaterializedView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2997,21 +2976,19 @@ public function updateMaterializedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $materializedView = new MaterializedView(); $materializedViewQuery = 'materializedViewQuery1755221932'; $materializedView->setQuery($materializedViewQuery); - $request = (new UpdateMaterializedViewRequest())->setMaterializedView($materializedView); + $request = (new UpdateMaterializedViewRequest()) + ->setMaterializedView($materializedView); $response = $gapicClient->updateMaterializedView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); diff --git a/Bigtable/tests/Unit/Admin/V2/Client/BigtableTableAdminClientTest.php b/Bigtable/tests/Unit/Admin/V2/Client/BigtableTableAdminClientTest.php index 352041089ed..9422e682198 100644 --- a/Bigtable/tests/Unit/Admin/V2/Client/BigtableTableAdminClientTest.php +++ b/Bigtable/tests/Unit/Admin/V2/Client/BigtableTableAdminClientTest.php @@ -102,9 +102,7 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); } /** @return BigtableTableAdminClient */ @@ -132,7 +130,9 @@ public function checkConsistencyTest() // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $consistencyToken = 'consistencyToken-1090516718'; - $request = (new CheckConsistencyRequest())->setName($formattedName)->setConsistencyToken($consistencyToken); + $request = (new CheckConsistencyRequest()) + ->setName($formattedName) + ->setConsistencyToken($consistencyToken); $response = $gapicClient->checkConsistency($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -158,20 +158,19 @@ public function checkConsistencyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $consistencyToken = 'consistencyToken-1090516718'; - $request = (new CheckConsistencyRequest())->setName($formattedName)->setConsistencyToken($consistencyToken); + $request = (new CheckConsistencyRequest()) + ->setName($formattedName) + ->setConsistencyToken($consistencyToken); try { $gapicClient->checkConsistency($request); // If the $gapicClient method call did not throw, fail the test @@ -293,15 +292,12 @@ public function copyBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); @@ -437,15 +433,12 @@ public function createAuthorizedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); @@ -585,15 +578,12 @@ public function createBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); @@ -729,15 +719,12 @@ public function createSchemaBundleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); @@ -819,15 +806,12 @@ public function createTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -950,15 +934,12 @@ public function createTableFromSnapshotExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -1003,7 +984,8 @@ public function deleteAuthorizedViewTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - $request = (new DeleteAuthorizedViewRequest())->setName($formattedName); + $request = (new DeleteAuthorizedViewRequest()) + ->setName($formattedName); $gapicClient->deleteAuthorizedView($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1026,19 +1008,17 @@ public function deleteAuthorizedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - $request = (new DeleteAuthorizedViewRequest())->setName($formattedName); + $request = (new DeleteAuthorizedViewRequest()) + ->setName($formattedName); try { $gapicClient->deleteAuthorizedView($request); // If the $gapicClient method call did not throw, fail the test @@ -1065,7 +1045,8 @@ public function deleteBackupTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - $request = (new DeleteBackupRequest())->setName($formattedName); + $request = (new DeleteBackupRequest()) + ->setName($formattedName); $gapicClient->deleteBackup($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1088,19 +1069,17 @@ public function deleteBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - $request = (new DeleteBackupRequest())->setName($formattedName); + $request = (new DeleteBackupRequest()) + ->setName($formattedName); try { $gapicClient->deleteBackup($request); // If the $gapicClient method call did not throw, fail the test @@ -1127,7 +1106,8 @@ public function deleteSchemaBundleTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->schemaBundleName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[SCHEMA_BUNDLE]'); - $request = (new DeleteSchemaBundleRequest())->setName($formattedName); + $request = (new DeleteSchemaBundleRequest()) + ->setName($formattedName); $gapicClient->deleteSchemaBundle($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1150,19 +1130,17 @@ public function deleteSchemaBundleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->schemaBundleName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[SCHEMA_BUNDLE]'); - $request = (new DeleteSchemaBundleRequest())->setName($formattedName); + $request = (new DeleteSchemaBundleRequest()) + ->setName($formattedName); try { $gapicClient->deleteSchemaBundle($request); // If the $gapicClient method call did not throw, fail the test @@ -1189,7 +1167,8 @@ public function deleteSnapshotTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - $request = (new DeleteSnapshotRequest())->setName($formattedName); + $request = (new DeleteSnapshotRequest()) + ->setName($formattedName); $gapicClient->deleteSnapshot($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1212,19 +1191,17 @@ public function deleteSnapshotExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - $request = (new DeleteSnapshotRequest())->setName($formattedName); + $request = (new DeleteSnapshotRequest()) + ->setName($formattedName); try { $gapicClient->deleteSnapshot($request); // If the $gapicClient method call did not throw, fail the test @@ -1251,7 +1228,8 @@ public function deleteTableTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new DeleteTableRequest())->setName($formattedName); + $request = (new DeleteTableRequest()) + ->setName($formattedName); $gapicClient->deleteTable($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1274,19 +1252,17 @@ public function deleteTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new DeleteTableRequest())->setName($formattedName); + $request = (new DeleteTableRequest()) + ->setName($formattedName); try { $gapicClient->deleteTable($request); // If the $gapicClient method call did not throw, fail the test @@ -1313,7 +1289,8 @@ public function dropRowRangeTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new DropRowRangeRequest())->setName($formattedName); + $request = (new DropRowRangeRequest()) + ->setName($formattedName); $gapicClient->dropRowRange($request); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1336,19 +1313,17 @@ public function dropRowRangeExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new DropRowRangeRequest())->setName($formattedName); + $request = (new DropRowRangeRequest()) + ->setName($formattedName); try { $gapicClient->dropRowRange($request); // If the $gapicClient method call did not throw, fail the test @@ -1377,7 +1352,8 @@ public function generateConsistencyTokenTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new GenerateConsistencyTokenRequest())->setName($formattedName); + $request = (new GenerateConsistencyTokenRequest()) + ->setName($formattedName); $response = $gapicClient->generateConsistencyToken($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1401,19 +1377,17 @@ public function generateConsistencyTokenExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new GenerateConsistencyTokenRequest())->setName($formattedName); + $request = (new GenerateConsistencyTokenRequest()) + ->setName($formattedName); try { $gapicClient->generateConsistencyToken($request); // If the $gapicClient method call did not throw, fail the test @@ -1446,7 +1420,8 @@ public function getAuthorizedViewTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - $request = (new GetAuthorizedViewRequest())->setName($formattedName); + $request = (new GetAuthorizedViewRequest()) + ->setName($formattedName); $response = $gapicClient->getAuthorizedView($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1470,19 +1445,17 @@ public function getAuthorizedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->authorizedViewName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[AUTHORIZED_VIEW]'); - $request = (new GetAuthorizedViewRequest())->setName($formattedName); + $request = (new GetAuthorizedViewRequest()) + ->setName($formattedName); try { $gapicClient->getAuthorizedView($request); // If the $gapicClient method call did not throw, fail the test @@ -1517,7 +1490,8 @@ public function getBackupTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - $request = (new GetBackupRequest())->setName($formattedName); + $request = (new GetBackupRequest()) + ->setName($formattedName); $response = $gapicClient->getBackup($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1541,19 +1515,17 @@ public function getBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->backupName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[BACKUP]'); - $request = (new GetBackupRequest())->setName($formattedName); + $request = (new GetBackupRequest()) + ->setName($formattedName); try { $gapicClient->getBackup($request); // If the $gapicClient method call did not throw, fail the test @@ -1584,7 +1556,8 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest())->setResource($resource); + $request = (new GetIamPolicyRequest()) + ->setResource($resource); $response = $gapicClient->getIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1608,19 +1581,17 @@ public function getIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; - $request = (new GetIamPolicyRequest())->setResource($resource); + $request = (new GetIamPolicyRequest()) + ->setResource($resource); try { $gapicClient->getIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -1651,7 +1622,8 @@ public function getSchemaBundleTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->schemaBundleName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[SCHEMA_BUNDLE]'); - $request = (new GetSchemaBundleRequest())->setName($formattedName); + $request = (new GetSchemaBundleRequest()) + ->setName($formattedName); $response = $gapicClient->getSchemaBundle($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1675,19 +1647,17 @@ public function getSchemaBundleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->schemaBundleName('[PROJECT]', '[INSTANCE]', '[TABLE]', '[SCHEMA_BUNDLE]'); - $request = (new GetSchemaBundleRequest())->setName($formattedName); + $request = (new GetSchemaBundleRequest()) + ->setName($formattedName); try { $gapicClient->getSchemaBundle($request); // If the $gapicClient method call did not throw, fail the test @@ -1720,7 +1690,8 @@ public function getSnapshotTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - $request = (new GetSnapshotRequest())->setName($formattedName); + $request = (new GetSnapshotRequest()) + ->setName($formattedName); $response = $gapicClient->getSnapshot($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1744,19 +1715,17 @@ public function getSnapshotExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->snapshotName('[PROJECT]', '[INSTANCE]', '[CLUSTER]', '[SNAPSHOT]'); - $request = (new GetSnapshotRequest())->setName($formattedName); + $request = (new GetSnapshotRequest()) + ->setName($formattedName); try { $gapicClient->getSnapshot($request); // If the $gapicClient method call did not throw, fail the test @@ -1787,7 +1756,8 @@ public function getTableTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new GetTableRequest())->setName($formattedName); + $request = (new GetTableRequest()) + ->setName($formattedName); $response = $gapicClient->getTable($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -1811,19 +1781,17 @@ public function getTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new GetTableRequest())->setName($formattedName); + $request = (new GetTableRequest()) + ->setName($formattedName); try { $gapicClient->getTable($request); // If the $gapicClient method call did not throw, fail the test @@ -1848,14 +1816,17 @@ public function listAuthorizedViewsTest() // Mock response $nextPageToken = ''; $authorizedViewsElement = new AuthorizedView(); - $authorizedViews = [$authorizedViewsElement]; + $authorizedViews = [ + $authorizedViewsElement, + ]; $expectedResponse = new ListAuthorizedViewsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setAuthorizedViews($authorizedViews); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ListAuthorizedViewsRequest())->setParent($formattedParent); + $request = (new ListAuthorizedViewsRequest()) + ->setParent($formattedParent); $response = $gapicClient->listAuthorizedViews($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1882,19 +1853,17 @@ public function listAuthorizedViewsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ListAuthorizedViewsRequest())->setParent($formattedParent); + $request = (new ListAuthorizedViewsRequest()) + ->setParent($formattedParent); try { $gapicClient->listAuthorizedViews($request); // If the $gapicClient method call did not throw, fail the test @@ -1919,14 +1888,17 @@ public function listBackupsTest() // Mock response $nextPageToken = ''; $backupsElement = new Backup(); - $backups = [$backupsElement]; + $backups = [ + $backupsElement, + ]; $expectedResponse = new ListBackupsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setBackups($backups); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new ListBackupsRequest())->setParent($formattedParent); + $request = (new ListBackupsRequest()) + ->setParent($formattedParent); $response = $gapicClient->listBackups($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -1953,19 +1925,17 @@ public function listBackupsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new ListBackupsRequest())->setParent($formattedParent); + $request = (new ListBackupsRequest()) + ->setParent($formattedParent); try { $gapicClient->listBackups($request); // If the $gapicClient method call did not throw, fail the test @@ -1990,14 +1960,17 @@ public function listSchemaBundlesTest() // Mock response $nextPageToken = ''; $schemaBundlesElement = new SchemaBundle(); - $schemaBundles = [$schemaBundlesElement]; + $schemaBundles = [ + $schemaBundlesElement, + ]; $expectedResponse = new ListSchemaBundlesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setSchemaBundles($schemaBundles); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ListSchemaBundlesRequest())->setParent($formattedParent); + $request = (new ListSchemaBundlesRequest()) + ->setParent($formattedParent); $response = $gapicClient->listSchemaBundles($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2024,19 +1997,17 @@ public function listSchemaBundlesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ListSchemaBundlesRequest())->setParent($formattedParent); + $request = (new ListSchemaBundlesRequest()) + ->setParent($formattedParent); try { $gapicClient->listSchemaBundles($request); // If the $gapicClient method call did not throw, fail the test @@ -2061,14 +2032,17 @@ public function listSnapshotsTest() // Mock response $nextPageToken = ''; $snapshotsElement = new Snapshot(); - $snapshots = [$snapshotsElement]; + $snapshots = [ + $snapshotsElement, + ]; $expectedResponse = new ListSnapshotsResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setSnapshots($snapshots); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new ListSnapshotsRequest())->setParent($formattedParent); + $request = (new ListSnapshotsRequest()) + ->setParent($formattedParent); $response = $gapicClient->listSnapshots($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2095,19 +2069,17 @@ public function listSnapshotsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->clusterName('[PROJECT]', '[INSTANCE]', '[CLUSTER]'); - $request = (new ListSnapshotsRequest())->setParent($formattedParent); + $request = (new ListSnapshotsRequest()) + ->setParent($formattedParent); try { $gapicClient->listSnapshots($request); // If the $gapicClient method call did not throw, fail the test @@ -2132,14 +2104,17 @@ public function listTablesTest() // Mock response $nextPageToken = ''; $tablesElement = new Table(); - $tables = [$tablesElement]; + $tables = [ + $tablesElement, + ]; $expectedResponse = new ListTablesResponse(); $expectedResponse->setNextPageToken($nextPageToken); $expectedResponse->setTables($tables); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListTablesRequest())->setParent($formattedParent); + $request = (new ListTablesRequest()) + ->setParent($formattedParent); $response = $gapicClient->listTables($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); @@ -2166,19 +2141,17 @@ public function listTablesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new ListTablesRequest())->setParent($formattedParent); + $request = (new ListTablesRequest()) + ->setParent($formattedParent); try { $gapicClient->listTables($request); // If the $gapicClient method call did not throw, fail the test @@ -2210,7 +2183,9 @@ public function modifyColumnFamiliesTest() // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $modifications = []; - $request = (new ModifyColumnFamiliesRequest())->setName($formattedName)->setModifications($modifications); + $request = (new ModifyColumnFamiliesRequest()) + ->setName($formattedName) + ->setModifications($modifications); $response = $gapicClient->modifyColumnFamilies($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2236,20 +2211,19 @@ public function modifyColumnFamiliesExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $modifications = []; - $request = (new ModifyColumnFamiliesRequest())->setName($formattedName)->setModifications($modifications); + $request = (new ModifyColumnFamiliesRequest()) + ->setName($formattedName) + ->setModifications($modifications); try { $gapicClient->modifyColumnFamilies($request); // If the $gapicClient method call did not throw, fail the test @@ -2299,7 +2273,9 @@ public function restoreTableTest() // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); $tableId = 'tableId-895419604'; - $request = (new RestoreTableRequest())->setParent($formattedParent)->setTableId($tableId); + $request = (new RestoreTableRequest()) + ->setParent($formattedParent) + ->setTableId($tableId); $response = $gapicClient->restoreTable($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2357,20 +2333,19 @@ public function restoreTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); $tableId = 'tableId-895419604'; - $request = (new RestoreTableRequest())->setParent($formattedParent)->setTableId($tableId); + $request = (new RestoreTableRequest()) + ->setParent($formattedParent) + ->setTableId($tableId); $response = $gapicClient->restoreTable($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2411,7 +2386,9 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); $response = $gapicClient->setIamPolicy($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2437,20 +2414,19 @@ public function setIamPolicyExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $request = (new SetIamPolicyRequest())->setResource($resource)->setPolicy($policy); + $request = (new SetIamPolicyRequest()) + ->setResource($resource) + ->setPolicy($policy); try { $gapicClient->setIamPolicy($request); // If the $gapicClient method call did not throw, fail the test @@ -2566,15 +2542,12 @@ public function snapshotTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); @@ -2620,7 +2593,9 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); $response = $gapicClient->testIamPermissions($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2646,20 +2621,19 @@ public function testIamPermissionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $resource = 'resource-341064690'; $permissions = []; - $request = (new TestIamPermissionsRequest())->setResource($resource)->setPermissions($permissions); + $request = (new TestIamPermissionsRequest()) + ->setResource($resource) + ->setPermissions($permissions); try { $gapicClient->testIamPermissions($request); // If the $gapicClient method call did not throw, fail the test @@ -2708,7 +2682,8 @@ public function undeleteTableTest() $operationsTransport->addResponse($completeOperation); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new UndeleteTableRequest())->setName($formattedName); + $request = (new UndeleteTableRequest()) + ->setName($formattedName); $response = $gapicClient->undeleteTable($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2764,19 +2739,17 @@ public function undeleteTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new UndeleteTableRequest())->setName($formattedName); + $request = (new UndeleteTableRequest()) + ->setName($formattedName); $response = $gapicClient->undeleteTable($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2836,7 +2809,8 @@ public function updateAuthorizedViewTest() $operationsTransport->addResponse($completeOperation); // Mock request $authorizedView = new AuthorizedView(); - $request = (new UpdateAuthorizedViewRequest())->setAuthorizedView($authorizedView); + $request = (new UpdateAuthorizedViewRequest()) + ->setAuthorizedView($authorizedView); $response = $gapicClient->updateAuthorizedView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2892,19 +2866,17 @@ public function updateAuthorizedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $authorizedView = new AuthorizedView(); - $request = (new UpdateAuthorizedViewRequest())->setAuthorizedView($authorizedView); + $request = (new UpdateAuthorizedViewRequest()) + ->setAuthorizedView($authorizedView); $response = $gapicClient->updateAuthorizedView($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -2953,7 +2925,9 @@ public function updateBackupTest() $backupExpireTime = new Timestamp(); $backup->setExpireTime($backupExpireTime); $updateMask = new FieldMask(); - $request = (new UpdateBackupRequest())->setBackup($backup)->setUpdateMask($updateMask); + $request = (new UpdateBackupRequest()) + ->setBackup($backup) + ->setUpdateMask($updateMask); $response = $gapicClient->updateBackup($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -2979,15 +2953,12 @@ public function updateBackupExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $backup = new Backup(); @@ -2996,7 +2967,9 @@ public function updateBackupExceptionTest() $backupExpireTime = new Timestamp(); $backup->setExpireTime($backupExpireTime); $updateMask = new FieldMask(); - $request = (new UpdateBackupRequest())->setBackup($backup)->setUpdateMask($updateMask); + $request = (new UpdateBackupRequest()) + ->setBackup($backup) + ->setUpdateMask($updateMask); try { $gapicClient->updateBackup($request); // If the $gapicClient method call did not throw, fail the test @@ -3045,7 +3018,8 @@ public function updateSchemaBundleTest() $operationsTransport->addResponse($completeOperation); // Mock request $schemaBundle = new SchemaBundle(); - $request = (new UpdateSchemaBundleRequest())->setSchemaBundle($schemaBundle); + $request = (new UpdateSchemaBundleRequest()) + ->setSchemaBundle($schemaBundle); $response = $gapicClient->updateSchemaBundle($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3101,19 +3075,17 @@ public function updateSchemaBundleExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $schemaBundle = new SchemaBundle(); - $request = (new UpdateSchemaBundleRequest())->setSchemaBundle($schemaBundle); + $request = (new UpdateSchemaBundleRequest()) + ->setSchemaBundle($schemaBundle); $response = $gapicClient->updateSchemaBundle($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3172,7 +3144,9 @@ public function updateTableTest() // Mock request $table = new Table(); $updateMask = new FieldMask(); - $request = (new UpdateTableRequest())->setTable($table)->setUpdateMask($updateMask); + $request = (new UpdateTableRequest()) + ->setTable($table) + ->setUpdateMask($updateMask); $response = $gapicClient->updateTable($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3230,20 +3204,19 @@ public function updateTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $operationsTransport->addResponse(null, $status); // Mock request $table = new Table(); $updateMask = new FieldMask(); - $request = (new UpdateTableRequest())->setTable($table)->setUpdateMask($updateMask); + $request = (new UpdateTableRequest()) + ->setTable($table) + ->setUpdateMask($updateMask); $response = $gapicClient->updateTable($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); @@ -3282,7 +3255,9 @@ public function checkConsistencyAsyncTest() // Mock request $formattedName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $consistencyToken = 'consistencyToken-1090516718'; - $request = (new CheckConsistencyRequest())->setName($formattedName)->setConsistencyToken($consistencyToken); + $request = (new CheckConsistencyRequest()) + ->setName($formattedName) + ->setConsistencyToken($consistencyToken); $response = $gapicClient->checkConsistencyAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); diff --git a/Bigtable/tests/Unit/V2/Client/BigtableClientTest.php b/Bigtable/tests/Unit/V2/Client/BigtableClientTest.php index 8d120bc5ae2..ab9a89d987e 100644 --- a/Bigtable/tests/Unit/V2/Client/BigtableClientTest.php +++ b/Bigtable/tests/Unit/V2/Client/BigtableClientTest.php @@ -76,9 +76,7 @@ private function createTransport($deserialize = null) /** @return CredentialsWrapper */ private function createCredentials() { - return $this->getMockBuilder(CredentialsWrapper::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); } /** @return BigtableClient */ @@ -106,7 +104,9 @@ public function checkAndMutateRowTest() // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $rowKey = '122'; - $request = (new CheckAndMutateRowRequest())->setTableName($formattedTableName)->setRowKey($rowKey); + $request = (new CheckAndMutateRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey); $response = $gapicClient->checkAndMutateRow($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -132,20 +132,19 @@ public function checkAndMutateRowExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $rowKey = '122'; - $request = (new CheckAndMutateRowRequest())->setTableName($formattedTableName)->setRowKey($rowKey); + $request = (new CheckAndMutateRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey); try { $gapicClient->checkAndMutateRow($request); // If the $gapicClient method call did not throw, fail the test @@ -217,15 +216,12 @@ public function executeQueryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request @@ -271,7 +267,8 @@ public function generateInitialChangeStreamPartitionsTest() $transport->addResponse($expectedResponse3); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new GenerateInitialChangeStreamPartitionsRequest())->setTableName($formattedTableName); + $request = (new GenerateInitialChangeStreamPartitionsRequest()) + ->setTableName($formattedTableName); $serverStream = $gapicClient->generateInitialChangeStreamPartitions($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -300,20 +297,18 @@ public function generateInitialChangeStreamPartitionsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new GenerateInitialChangeStreamPartitionsRequest())->setTableName($formattedTableName); + $request = (new GenerateInitialChangeStreamPartitionsRequest()) + ->setTableName($formattedTableName); $serverStream = $gapicClient->generateInitialChangeStreamPartitions($request); $results = $serverStream->readAll(); try { @@ -344,7 +339,8 @@ public function getClientConfigurationTest() $transport->addResponse($expectedResponse); // Mock request $formattedInstanceName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new GetClientConfigurationRequest())->setInstanceName($formattedInstanceName); + $request = (new GetClientConfigurationRequest()) + ->setInstanceName($formattedInstanceName); $response = $gapicClient->getClientConfiguration($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -368,19 +364,17 @@ public function getClientConfigurationExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedInstanceName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new GetClientConfigurationRequest())->setInstanceName($formattedInstanceName); + $request = (new GetClientConfigurationRequest()) + ->setInstanceName($formattedInstanceName); try { $gapicClient->getClientConfiguration($request); // If the $gapicClient method call did not throw, fail the test @@ -440,15 +434,12 @@ public function mutateRowExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); @@ -489,7 +480,9 @@ public function mutateRowsTest() // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $entries = []; - $request = (new MutateRowsRequest())->setTableName($formattedTableName)->setEntries($entries); + $request = (new MutateRowsRequest()) + ->setTableName($formattedTableName) + ->setEntries($entries); $serverStream = $gapicClient->mutateRows($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -520,21 +513,20 @@ public function mutateRowsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $entries = []; - $request = (new MutateRowsRequest())->setTableName($formattedTableName)->setEntries($entries); + $request = (new MutateRowsRequest()) + ->setTableName($formattedTableName) + ->setEntries($entries); $serverStream = $gapicClient->mutateRows($request); $results = $serverStream->readAll(); try { @@ -574,7 +566,10 @@ public function openAuthorizedViewTest() $bidi->write($request); $responses = []; $responses[] = $bidi->read(); - $bidi->writeAll([$request2, $request3]); + $bidi->writeAll([ + $request2, + $request3, + ]); foreach ($bidi->closeWriteAndReadAll() as $response) { $responses[] = $response; } @@ -612,15 +607,12 @@ public function openAuthorizedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); $bidi = $gapicClient->openAuthorizedView(); @@ -662,7 +654,10 @@ public function openMaterializedViewTest() $bidi->write($request); $responses = []; $responses[] = $bidi->read(); - $bidi->writeAll([$request2, $request3]); + $bidi->writeAll([ + $request2, + $request3, + ]); foreach ($bidi->closeWriteAndReadAll() as $response) { $responses[] = $response; } @@ -700,15 +695,12 @@ public function openMaterializedViewExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); $bidi = $gapicClient->openMaterializedView(); @@ -750,7 +742,10 @@ public function openTableTest() $bidi->write($request); $responses = []; $responses[] = $bidi->read(); - $bidi->writeAll([$request2, $request3]); + $bidi->writeAll([ + $request2, + $request3, + ]); foreach ($bidi->closeWriteAndReadAll() as $response) { $responses[] = $response; } @@ -788,15 +783,12 @@ public function openTableExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); $bidi = $gapicClient->openTable(); @@ -827,7 +819,8 @@ public function pingAndWarmTest() $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new PingAndWarmRequest())->setName($formattedName); + $request = (new PingAndWarmRequest()) + ->setName($formattedName); $response = $gapicClient->pingAndWarm($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); @@ -851,19 +844,17 @@ public function pingAndWarmExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); - $request = (new PingAndWarmRequest())->setName($formattedName); + $request = (new PingAndWarmRequest()) + ->setName($formattedName); try { $gapicClient->pingAndWarm($request); // If the $gapicClient method call did not throw, fail the test @@ -928,15 +919,12 @@ public function prepareQueryExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedInstanceName = $gapicClient->instanceName('[PROJECT]', '[INSTANCE]'); @@ -979,7 +967,8 @@ public function readChangeStreamTest() $transport->addResponse($expectedResponse3); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ReadChangeStreamRequest())->setTableName($formattedTableName); + $request = (new ReadChangeStreamRequest()) + ->setTableName($formattedTableName); $serverStream = $gapicClient->readChangeStream($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -1008,20 +997,18 @@ public function readChangeStreamExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ReadChangeStreamRequest())->setTableName($formattedTableName); + $request = (new ReadChangeStreamRequest()) + ->setTableName($formattedTableName); $serverStream = $gapicClient->readChangeStream($request); $results = $serverStream->readAll(); try { @@ -1083,15 +1070,12 @@ public function readModifyWriteRowExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); @@ -1137,7 +1121,8 @@ public function readRowsTest() $transport->addResponse($expectedResponse3); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ReadRowsRequest())->setTableName($formattedTableName); + $request = (new ReadRowsRequest()) + ->setTableName($formattedTableName); $serverStream = $gapicClient->readRows($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -1166,20 +1151,18 @@ public function readRowsExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new ReadRowsRequest())->setTableName($formattedTableName); + $request = (new ReadRowsRequest()) + ->setTableName($formattedTableName); $serverStream = $gapicClient->readRows($request); $results = $serverStream->readAll(); try { @@ -1224,7 +1207,8 @@ public function sampleRowKeysTest() $transport->addResponse($expectedResponse3); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new SampleRowKeysRequest())->setTableName($formattedTableName); + $request = (new SampleRowKeysRequest()) + ->setTableName($formattedTableName); $serverStream = $gapicClient->sampleRowKeys($request); $this->assertInstanceOf(ServerStream::class, $serverStream); $responses = iterator_to_array($serverStream->readAll()); @@ -1253,20 +1237,18 @@ public function sampleRowKeysExceptionTest() $status = new stdClass(); $status->code = Code::DATA_LOSS; $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); $transport->setStreamingStatus($status); $this->assertTrue($transport->isExhausted()); // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); - $request = (new SampleRowKeysRequest())->setTableName($formattedTableName); + $request = (new SampleRowKeysRequest()) + ->setTableName($formattedTableName); $serverStream = $gapicClient->sampleRowKeys($request); $results = $serverStream->readAll(); try { @@ -1298,7 +1280,9 @@ public function checkAndMutateRowAsyncTest() // Mock request $formattedTableName = $gapicClient->tableName('[PROJECT]', '[INSTANCE]', '[TABLE]'); $rowKey = '122'; - $request = (new CheckAndMutateRowRequest())->setTableName($formattedTableName)->setRowKey($rowKey); + $request = (new CheckAndMutateRowRequest()) + ->setTableName($formattedTableName) + ->setRowKey($rowKey); $response = $gapicClient->checkAndMutateRowAsync($request)->wait(); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls();