From fb03807ae8cd89f01a9eef314ec1d2609e0625f8 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 11 Oct 2024 22:01:12 +0000 Subject: [PATCH 1/2] feat: Add FindNearest API to the stable branch PiperOrigin-RevId: 684905940 Source-Link: https://github.com/googleapis/googleapis/commit/2196d4843a22befdc7bc3b7b676eeb392c31b3cf Source-Link: https://github.com/googleapis/googleapis-gen/commit/05df6fa16ab93bd9da17b56edd379b43963de167 Copy-Tag: eyJwIjoiRGF0YXN0b3JlLy5Pd2xCb3QueWFtbCIsImgiOiIwNWRmNmZhMTZhYjkzYmQ5ZGExN2I1NmVkZDM3OWI0Mzk2M2RlMTY3In0= --- .../Google/Datastore/V1/AggregationResult.php | 39 + .../Google/Datastore/V1/Datastore.php | Bin 0 -> 8218 bytes .../Google/Datastore/V1/Entity.php | Bin 0 -> 2034 bytes .../GPBMetadata/Google/Datastore/V1/Query.php | Bin 0 -> 4897 bytes .../Google/Datastore/V1/QueryProfile.php | 42 + .../Cloud/Datastore/V1/AggregationQuery.php | 122 +++ .../V1/AggregationQuery/Aggregation.php | 290 +++++++ .../V1/AggregationQuery/Aggregation/Avg.php | 86 ++ .../V1/AggregationQuery/Aggregation/Count.php | 181 +++++ .../V1/AggregationQuery/Aggregation/Sum.php | 95 +++ .../Cloud/Datastore/V1/AggregationResult.php | 86 ++ .../Datastore/V1/AggregationResultBatch.php | 165 ++++ .../Cloud/Datastore/V1/AllocateIdsRequest.php | 164 ++++ .../Datastore/V1/AllocateIdsResponse.php | 72 ++ .../Google/Cloud/Datastore/V1/ArrayValue.php | 75 ++ .../Datastore/V1/BeginTransactionRequest.php | 167 ++++ .../Datastore/V1/BeginTransactionResponse.php | 68 ++ .../Cloud/Datastore/V1/CommitRequest.php | 367 +++++++++ .../Cloud/Datastore/V1/CommitRequest/Mode.php | 66 ++ .../Cloud/Datastore/V1/CommitResponse.php | 153 ++++ .../Cloud/Datastore/V1/CompositeFilter.php | 109 +++ .../Datastore/V1/CompositeFilter/Operator.php | 68 ++ .../src/Google/Cloud/Datastore/V1/Entity.php | 148 ++++ .../Cloud/Datastore/V1/EntityResult.php | 285 +++++++ .../Datastore/V1/EntityResult/ResultType.php | 75 ++ .../Cloud/Datastore/V1/ExecutionStats.php | 237 ++++++ .../Cloud/Datastore/V1/ExplainMetrics.php | 129 +++ .../Cloud/Datastore/V1/ExplainOptions.php | 83 ++ .../src/Google/Cloud/Datastore/V1/Filter.php | 108 +++ .../Google/Cloud/Datastore/V1/FindNearest.php | 390 +++++++++ .../V1/FindNearest/DistanceMeasure.php | 82 ++ .../Google/Cloud/Datastore/V1/GqlQuery.php | 210 +++++ .../Cloud/Datastore/V1/GqlQueryParameter.php | 111 +++ .../src/Google/Cloud/Datastore/V1/Key.php | 174 +++++ .../Cloud/Datastore/V1/Key/PathElement.php | 195 +++++ .../Cloud/Datastore/V1/KindExpression.php | 67 ++ .../Cloud/Datastore/V1/LookupRequest.php | 260 ++++++ .../Cloud/Datastore/V1/LookupResponse.php | 257 ++++++ .../Google/Cloud/Datastore/V1/Mutation.php | 429 ++++++++++ .../Mutation/ConflictResolutionStrategy.php | 64 ++ .../Cloud/Datastore/V1/MutationResult.php | 311 ++++++++ .../Google/Cloud/Datastore/V1/PartitionId.php | 154 ++++ .../Google/Cloud/Datastore/V1/PlanSummary.php | 83 ++ .../Google/Cloud/Datastore/V1/Projection.php | 77 ++ .../Cloud/Datastore/V1/PropertyFilter.php | 155 ++++ .../Datastore/V1/PropertyFilter/Operator.php | 135 ++++ .../Cloud/Datastore/V1/PropertyMask.php | 96 +++ .../Cloud/Datastore/V1/PropertyOrder.php | 111 +++ .../Datastore/V1/PropertyOrder/Direction.php | 64 ++ .../Cloud/Datastore/V1/PropertyReference.php | 83 ++ .../Cloud/Datastore/V1/PropertyTransform.php | 432 ++++++++++ .../V1/PropertyTransform/ServerValue.php | 59 ++ .../src/Google/Cloud/Datastore/V1/Query.php | 516 ++++++++++++ .../Cloud/Datastore/V1/QueryResultBatch.php | 379 +++++++++ .../V1/QueryResultBatch/MoreResultsType.php | 79 ++ .../Google/Cloud/Datastore/V1/ReadOptions.php | 207 +++++ .../V1/ReadOptions/ReadConsistency.php | 64 ++ .../Cloud/Datastore/V1/ReserveIdsRequest.php | 164 ++++ .../Cloud/Datastore/V1/ReserveIdsResponse.php | 34 + .../Cloud/Datastore/V1/RollbackRequest.php | 163 ++++ .../Cloud/Datastore/V1/RollbackResponse.php | 35 + .../V1/RunAggregationQueryRequest.php | 333 ++++++++ .../V1/RunAggregationQueryResponse.php | 228 ++++++ .../Cloud/Datastore/V1/RunQueryRequest.php | 388 +++++++++ .../Cloud/Datastore/V1/RunQueryResponse.php | 228 ++++++ .../Cloud/Datastore/V1/TransactionOptions.php | 113 +++ .../V1/TransactionOptions/PBReadOnly.php | 95 +++ .../V1/TransactionOptions/ReadOnly.php | 9 + .../V1/TransactionOptions/ReadWrite.php | 70 ++ .../src/Google/Cloud/Datastore/V1/Value.php | 517 ++++++++++++ .../V1/DatastoreClient/allocate_ids.php | 74 ++ .../V1/DatastoreClient/begin_transaction.php | 70 ++ .../v1/samples/V1/DatastoreClient/commit.php | 78 ++ .../v1/samples/V1/DatastoreClient/lookup.php | 73 ++ .../V1/DatastoreClient/reserve_ids.php | 74 ++ .../samples/V1/DatastoreClient/rollback.php | 74 ++ .../DatastoreClient/run_aggregation_query.php | 70 ++ .../samples/V1/DatastoreClient/run_query.php | 73 ++ .../v1/src/V1/Client/DatastoreClient.php | 403 ++++++++++ .../Datastore/v1/src/V1/DatastoreClient.php | 34 + .../v1/src/V1/Gapic/DatastoreGapicClient.php | 739 ++++++++++++++++++ .../Datastore/v1/src/V1/gapic_metadata.json | 58 ++ .../V1/resources/datastore_client_config.json | 95 +++ .../resources/datastore_descriptor_config.php | 172 ++++ .../datastore_rest_client_config.php | 171 ++++ .../Unit/V1/Client/DatastoreClientTest.php | 657 ++++++++++++++++ .../v1/tests/Unit/V1/DatastoreClientTest.php | 572 ++++++++++++++ 87 files changed, 14588 insertions(+) create mode 100644 owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/AggregationResult.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Datastore.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Entity.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Query.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/QueryProfile.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Avg.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Count.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Sum.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResult.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResultBatch.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsRequest.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsResponse.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ArrayValue.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionRequest.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionResponse.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest/Mode.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitResponse.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter/Operator.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Entity.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult/ResultType.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExecutionStats.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainMetrics.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainOptions.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Filter.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/FindNearest.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/FindNearest/DistanceMeasure.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQuery.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQueryParameter.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key/PathElement.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/KindExpression.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupRequest.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupResponse.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation/ConflictResolutionStrategy.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/MutationResult.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PartitionId.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PlanSummary.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Projection.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter/Operator.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyMask.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder/Direction.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyReference.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform/ServerValue.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Query.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch/MoreResultsType.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions/ReadConsistency.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsRequest.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsResponse.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackRequest.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackResponse.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryRequest.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryResponse.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryRequest.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryResponse.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/PBReadOnly.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/ReadOnly.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/ReadWrite.php create mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Value.php create mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/allocate_ids.php create mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/begin_transaction.php create mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/commit.php create mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/lookup.php create mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/reserve_ids.php create mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/rollback.php create mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_aggregation_query.php create mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_query.php create mode 100644 owl-bot-staging/Datastore/v1/src/V1/Client/DatastoreClient.php create mode 100644 owl-bot-staging/Datastore/v1/src/V1/DatastoreClient.php create mode 100644 owl-bot-staging/Datastore/v1/src/V1/Gapic/DatastoreGapicClient.php create mode 100644 owl-bot-staging/Datastore/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/Datastore/v1/src/V1/resources/datastore_client_config.json create mode 100644 owl-bot-staging/Datastore/v1/src/V1/resources/datastore_descriptor_config.php create mode 100644 owl-bot-staging/Datastore/v1/src/V1/resources/datastore_rest_client_config.php create mode 100644 owl-bot-staging/Datastore/v1/tests/Unit/V1/Client/DatastoreClientTest.php create mode 100644 owl-bot-staging/Datastore/v1/tests/Unit/V1/DatastoreClientTest.php diff --git a/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/AggregationResult.php b/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/AggregationResult.php new file mode 100644 index 000000000000..ca7de2ad9eef --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/AggregationResult.php @@ -0,0 +1,39 @@ +internalAddGeneratedFile( + ' +€ +,google/datastore/v1/aggregation_result.protogoogle.datastore.v1google/datastore/v1/query.protogoogle/protobuf/timestamp.proto"Ê +AggregationResult] +aggregate_properties ( 2?.google.datastore.v1.AggregationResult.AggregatePropertiesEntryV +AggregatePropertiesEntry +key ( ) +value ( 2.google.datastore.v1.Value:8"Ù +AggregationResultBatchC +aggregation_results ( 2&.google.datastore.v1.AggregationResultK + more_results (25.google.datastore.v1.QueryResultBatch.MoreResultsType- + read_time ( 2.google.protobuf.TimestampBÇ +com.google.datastore.v1BAggregationResultProtoPZ;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepbªGoogle.Cloud.Datastore.V1ÊGoogle\\Cloud\\Datastore\\V1êGoogle::Cloud::Datastore::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Datastore.php b/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Datastore.php new file mode 100644 index 0000000000000000000000000000000000000000..5fd0a98c20b1eccf60b4003d2554ea7d8db9aa71 GIT binary patch literal 8218 zcmcgx%X1rP5s&0Y?3Vl*=b<=B?d&AkI9XeY1q+L^0VG>-RK$Py-$m&`hr%rNm%d%Pq$uu-ib3Mx;nZvd2f6`1IfT^{KYio5PZ|)Yhh^JBV>Lz2Y zZuqR#{k8i5bwhJqIrtGi0U7_;otmN7W!KX@{OhLfs=BFrx@PF#N9`ZTP0er#au3or zJ7(R}EmNipJ7%3M-;udYN_*3`(Ao#GugorW02*H{nI3UW&8Th=x9;dR+O~_Nxm=5Q zf!pXW%Xh@FRGi+Fm${C)+<=k~WY6i4@aeMb5U=By_nF>Qz^mY2)d*MRZM~W|O^bTL zGTmIRYg1RmFvfL5C#LsiJP&nZGz#QEJJc=b%~;D;$J5Q$=uAP#5eLmyr z#`8nL36wv_VCJ!9J?q$If&yGmx(tBS-y?NT)f=fPIkr4q82d{;E-gZWYE;u)LcdJY zFVdGF=@6}u=(8Zc?M7eBcevi!yI{O8=7tgxK1+O80;l1YpXl z-jPj|-^5_P8yx|}FTzAk^Xdm8XKqExX2x(F7AUcF2ZY;rd`@s%G_F4C+SVqXqt{)Q z$%*WVwqct?NtGXt!4eu0y3mAzXzW>P$LET;0xX29GK-HuU$pc4%{(IzBjA*HD>(fv z23I4aAdr>oMb`U~$O;)3#uuWJJBH(HG{^iup!VY!TrQB7ZdSUr@obfC0~SN|HArb* z4yv~!y%RcAb)44RCXgO64sMIG}l4- zR~%;6t#(`Y&UV@dFy6Krgxx>0*&%-EIUv1-^wPx$EiqF{aEV@-22nfMFoXh-dPB#f zta~us?ua=dHOcPa=<>fMsFa5=&Xl_V^IJO`MfK_S-fnTd^srRim_H{iz)Yo_-`>lw zS4unE`N#7yv|?d`2AcfBp$@8CanDPUHz1O6Ut)k`CZ`9XrLySAj#VEL*lsD#`_cwg9O)*gNWZgLF+IGB4qh4T&r7V6ZaGzMYCn#0E~^Hi`n3j))7nM+3bgrp79-- zUKbM3;X=Tk;FkuvGdfQUYsbSqz4QncQDZ(0u-t4~PTNf-Sy^~5QX!weLa!1^&YCo( z3`-|yn1Ty?SPm-1&5!%a$2=tWisk)cS>4Y+epF4d!%8&e+s9f%Hh#sVC$Q)etO6DmAxsuWJ=Ba2VQuNhRE$&s+N@)v`P?(3=0F=D>|1Vw@enwy-;QB|p1!Fk<3YQN}XlV}4 z`*)WX$WkC^o%mIbrf zdy&x(@v;R2CbZ9o2=D7nXiuBOp9?T&k{3Nq37alg1-d5RrN zynsDm$VnV)pT=orBEGtKX!IXme3)B`ni85*vc(undv2 zgM5$9E!}}>>Io(lGwg!x5ZuXj+@6TAc6aG3FhxlzWA9FcTM-~{(Bp+k-q2?MIs?-i z{t{67Weg_yN=Q;7UEuGF*hsq+-MjfTqI+l`=dYmxVrjO*d~NYf*9u*8{owci_(}Yh zBGbj7pmQ^ybU9w-47P*I#qR!yl3vG9hqiE-GvU>n^s^W`MJ#)yn~_HNpGE(-6g|gv zse~cBOw;OZMH#NDBTgPs*+0Z!5zh&Yn@{K}Q_2j}yPwiGAsT2AqOr)bRiE-5W=&RE zJ<*u{^G3AmkGRw6p9iItNTd46e2Z2`q!#9o<9rAd%(jejcerh}zUg^H!*FLh$w!+Z z3F6N^CnbnaBUJx1cAUS}#rp~!G*`UtV87D#$GhYFm43S5+v#b7$idTmo(%G3z7KnTaJWZ4`CO1b0K?z zl6F_QH5`7}fcaDCh^G8H27t*cWsm+unzb_}sNOepMV9OonLxTD-0Zif?SG@2Pp zhp+RgZX?8BLh!xGO(Qygm;cs*=h<#9lX>ytg$RKEF{5?71ALaUI*nCaKYMgiSvie7 zIH~Xp+?e4JQBf_-1{dHiZTfa&-@ebz@rjWy)3Umc-5Jy={P=Cx?gt0iwV%hYY_j+6 z^g2~G9SBeFuf6uaRjce{HS{KqkD>pLU*oK~9Q&Nh1f&q5RD|;u|}$m(nh1I0kU;nM9v3QC1?=Pb%UsK9ivVxAchYC0bxn5WF{1s zST2pIh5t}*J@rzc_x_aL`VTt0OHyj1w9!T6%)FU5vu`=yJV`DR_<|g~&czLpif`GJu#)S(;Fvk)vV%Ig?byxKV5Ek!^BCZ%5Oj7 zV|V_l!Ky)hg||72qLGHS8rbv399f)={Q^UDJQBJAA9;9H7>#p~8q~URDA`Py$Q|k^ zR12R#GvIjVS#DRSQ9=9Huvs2@?gDfzP%jCTQb*W*sJ~&e9I&bZt);!<)J^qNiZGt! zh>sCbNBcH_7jZAQT4-&e)rQRpn%13DeO&4PR)HJ1zLqiQHw*P>Q4B=Mx#lHORX%Ec>4>_KUY6J(yPq=PA3@@3(Y?7{ZaT_S3BK>b%*=z&+1JB obsX(>oD%Ff=RI#t3;N;h@+*4JtdWJS^WKf4Bh6;Gf-8W(0fv}&dH?_b literal 0 HcmV?d00001 diff --git a/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Query.php b/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Query.php new file mode 100644 index 0000000000000000000000000000000000000000..a42f6011f29891340783c73ac1e44cf2d3b47cc8 GIT binary patch literal 4897 zcmbVQPjlPW5jRPZ7MB#oJSQ=&I0=lnjojK$B-gD&)p7X;l2}tDO;YZ-!x;=jK2nGw z00BUyYR4a;hu+$mUVG^!(_3eH$UV1AzCaE+$7AYBL;KhqpX9H$94)=VixJ zYv>!cB{7AzHKglzBw>@u-ga!<Y!-3JfVIR zF7{^qPOvO9XN;wF;bXac&dEoT?@sCb>XPJAf9hJ>+;3*!W%S=5CQKE_80;9-998L& zeqz{exjfs|%t)N-e1r$8nlf5=^L0tUq5y(q5B6{cO2?^@v1x#_dYX%uvbQ- zD9SsCy!9w9EJ`24KPC9^6_6v>gn$xZQaRaNiv=p>@eoK|3+-~;A`~|KaMOXn2f@OT zz?Z?!#CQ2`Nyv)`cd0iueez4lh!si+DY2g0dQXY*Oc5$%6|SCOln}9{C6rE)4af~$ ziq)wxM@kuPVl6ZgI-x|VVG2_RHytRXU#U=l%y8;@wp&V}Y+il}AUyA%I+VNz*Sl)( zpxM{@&pWDi(CT&6T4Sf7){9rjGA!*JG@Hc)DFAf3?cb}lexuzgCP^NapQz8ZcB}ck zn3BIrL7LYyxetIoe@=N(mXcBm1M*?GoB32Jok)yq!qN-F8lito{G(X$Cn%u)$#JR2 zg2#eBHcTvH9>$*vI${e&(0M<|=-3&^nxpg)LT|Fq2{$u{IhhUXi|E*j=4!xevi zp<b8gj_ZCeI+6Pumr`*Wa82ZQm$=@ zjD9h5FSM z$cc4D>i?5~)rCdKr;xNAp8CSpz1ML|X$QC>cj2nA?gd>XzRe16Z@ByiDV%y z^wKPTjaD&3a2Y&31m?2L++L-pRa!N*htV(QumxtA01B_j-yzq}^(AEJ)e|f!+torC zz8Q}(HcXNSkQe+TYz2gWK?sFf8;Y#o>)5`vW2$>oS46+C^+_yF=N!kf7K-~qPZ&fR z7oD7qc^7wbq3|;(MIK;3$H{UQ2R7u1K0zJLUA^% zAJqCd3jQkz%e!Bgd^})-kVuB-yM{Fpq>tz;=%#6ZshP-CE*|Z8l9sXA7g%c;X@@wi zptu*zYw;Nf7g1VFry8i>nC+gD8eHQ{h?9+O&de=cFvW%DI=YMY(66<@07#7O9Hd^* z(_kwP!b%lP8Q*cwnJywL#?zdl$eK3A=c9u;05B zF1j32Rox#Rk?XMPy)f{&Hqr#rJPx2V%S`xT{>XrtA>xP=$aC8PkHinternalAddGeneratedFile( + ' +ã +\'google/datastore/v1/query_profile.protogoogle.datastore.v1google/protobuf/duration.protogoogle/protobuf/struct.proto"& +ExplainOptions +analyze (BàA"† +ExplainMetrics6 + plan_summary ( 2 .google.datastore.v1.PlanSummary< +execution_stats ( 2#.google.datastore.v1.ExecutionStats"< + PlanSummary- + indexes_used ( 2.google.protobuf.Struct"¨ +ExecutionStats +results_returned (5 +execution_duration ( 2.google.protobuf.Duration +read_operations (, + debug_stats ( 2.google.protobuf.StructBÂ +com.google.datastore.v1BQueryProfileProtoPZ;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepbªGoogle.Cloud.Datastore.V1ÊGoogle\\Cloud\\Datastore\\V1êGoogle::Cloud::Datastore::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery.php new file mode 100644 index 000000000000..7417e426db56 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery.php @@ -0,0 +1,122 @@ +google.datastore.v1.AggregationQuery + */ +class AggregationQuery extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Series of aggregations to apply over the results of the + * `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + * + * Generated from protobuf field repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $aggregations; + protected $query_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\Query $nested_query + * Nested query for aggregation + * @type array<\Google\Cloud\Datastore\V1\AggregationQuery\Aggregation>|\Google\Protobuf\Internal\RepeatedField $aggregations + * Optional. Series of aggregations to apply over the results of the + * `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * Nested query for aggregation + * + * Generated from protobuf field .google.datastore.v1.Query nested_query = 1; + * @return \Google\Cloud\Datastore\V1\Query|null + */ + public function getNestedQuery() + { + return $this->readOneof(1); + } + + public function hasNestedQuery() + { + return $this->hasOneof(1); + } + + /** + * Nested query for aggregation + * + * Generated from protobuf field .google.datastore.v1.Query nested_query = 1; + * @param \Google\Cloud\Datastore\V1\Query $var + * @return $this + */ + public function setNestedQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Query::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Optional. Series of aggregations to apply over the results of the + * `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + * + * Generated from protobuf field repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAggregations() + { + return $this->aggregations; + } + + /** + * Optional. Series of aggregations to apply over the results of the + * `nested_query`. + * Requires: + * * A minimum of one and maximum of five aggregations per query. + * + * Generated from protobuf field repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Datastore\V1\AggregationQuery\Aggregation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAggregations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation::class); + $this->aggregations = $arr; + + return $this; + } + + /** + * @return string + */ + public function getQueryType() + { + return $this->whichOneof("query_type"); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation.php new file mode 100644 index 000000000000..e8c7cc0360ae --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation.php @@ -0,0 +1,290 @@ +google.datastore.v1.AggregationQuery.Aggregation + */ +class Aggregation extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Optional name of the property to store the result of the + * aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property + * name][google.datastore.v1.Entity.properties] limitations. + * + * Generated from protobuf field string alias = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $alias = ''; + protected $operator; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Count $count + * Count aggregator. + * @type \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Sum $sum + * Sum aggregator. + * @type \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Avg $avg + * Average aggregator. + * @type string $alias + * Optional. Optional name of the property to store the result of the + * aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property + * name][google.datastore.v1.Entity.properties] limitations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * Count aggregator. + * + * Generated from protobuf field .google.datastore.v1.AggregationQuery.Aggregation.Count count = 1; + * @return \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Count|null + */ + public function getCount() + { + return $this->readOneof(1); + } + + public function hasCount() + { + return $this->hasOneof(1); + } + + /** + * Count aggregator. + * + * Generated from protobuf field .google.datastore.v1.AggregationQuery.Aggregation.Count count = 1; + * @param \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Count $var + * @return $this + */ + public function setCount($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Count::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Sum aggregator. + * + * Generated from protobuf field .google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2; + * @return \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Sum|null + */ + public function getSum() + { + return $this->readOneof(2); + } + + public function hasSum() + { + return $this->hasOneof(2); + } + + /** + * Sum aggregator. + * + * Generated from protobuf field .google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2; + * @param \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Sum $var + * @return $this + */ + public function setSum($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Sum::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Average aggregator. + * + * Generated from protobuf field .google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3; + * @return \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Avg|null + */ + public function getAvg() + { + return $this->readOneof(3); + } + + public function hasAvg() + { + return $this->hasOneof(3); + } + + /** + * Average aggregator. + * + * Generated from protobuf field .google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3; + * @param \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Avg $var + * @return $this + */ + public function setAvg($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Avg::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Optional name of the property to store the result of the + * aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property + * name][google.datastore.v1.Entity.properties] limitations. + * + * Generated from protobuf field string alias = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getAlias() + { + return $this->alias; + } + + /** + * Optional. Optional name of the property to store the result of the + * aggregation. + * If not provided, Datastore will pick a default name following the format + * `property_`. For example: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2), + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) + * OVER ( + * ... + * ); + * ``` + * becomes: + * ``` + * AGGREGATE + * COUNT_UP_TO(1) AS count_up_to_1, + * COUNT_UP_TO(2) AS property_1, + * COUNT_UP_TO(3) AS count_up_to_3, + * COUNT(*) AS property_2 + * OVER ( + * ... + * ); + * ``` + * Requires: + * * Must be unique across all aggregation aliases. + * * Conform to [entity property + * name][google.datastore.v1.Entity.properties] limitations. + * + * Generated from protobuf field string alias = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setAlias($var) + { + GPBUtil::checkString($var, True); + $this->alias = $var; + + return $this; + } + + /** + * @return string + */ + public function getOperator() + { + return $this->whichOneof("operator"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Aggregation::class, \Google\Cloud\Datastore\V1\AggregationQuery_Aggregation::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Avg.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Avg.php new file mode 100644 index 000000000000..3cc34c0639bc --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Avg.php @@ -0,0 +1,86 @@ +google.datastore.v1.AggregationQuery.Aggregation.Avg + */ +class Avg extends \Google\Protobuf\Internal\Message +{ + /** + * The property to aggregate on. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + */ + protected $property = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\PropertyReference $property + * The property to aggregate on. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The property to aggregate on. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + * @return \Google\Cloud\Datastore\V1\PropertyReference|null + */ + public function getProperty() + { + return $this->property; + } + + public function hasProperty() + { + return isset($this->property); + } + + public function clearProperty() + { + unset($this->property); + } + + /** + * The property to aggregate on. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + * @param \Google\Cloud\Datastore\V1\PropertyReference $var + * @return $this + */ + public function setProperty($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyReference::class); + $this->property = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Avg::class, \Google\Cloud\Datastore\V1\AggregationQuery_Aggregation_Avg::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Count.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Count.php new file mode 100644 index 000000000000..209b170896c9 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Count.php @@ -0,0 +1,181 @@ +google.datastore.v1.AggregationQuery.Aggregation.Count + */ +class Count extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Optional constraint on the maximum number of entities to + * count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency, and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + * + * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $up_to = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Int64Value $up_to + * Optional. Optional constraint on the maximum number of entities to + * count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency, and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Optional constraint on the maximum number of entities to + * count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency, and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + * + * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Int64Value|null + */ + public function getUpTo() + { + return $this->up_to; + } + + public function hasUpTo() + { + return isset($this->up_to); + } + + public function clearUpTo() + { + unset($this->up_to); + } + + /** + * Returns the unboxed value from getUpTo() + + * Optional. Optional constraint on the maximum number of entities to + * count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency, and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + * + * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int|string|null + */ + public function getUpToUnwrapped() + { + return $this->readWrapperValue("up_to"); + } + + /** + * Optional. Optional constraint on the maximum number of entities to + * count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency, and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + * + * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\Int64Value $var + * @return $this + */ + public function setUpTo($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); + $this->up_to = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. + + * Optional. Optional constraint on the maximum number of entities to + * count. + * This provides a way to set an upper bound on the number of entities + * to scan, limiting latency, and cost. + * Unspecified is interpreted as no bound. + * If a zero value is provided, a count result of zero should always be + * expected. + * High-Level Example: + * ``` + * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); + * ``` + * Requires: + * * Must be non-negative when present. + * + * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int|string|null $var + * @return $this + */ + public function setUpToUnwrapped($var) + { + $this->writeWrapperValue("up_to", $var); + return $this;} + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Count::class, \Google\Cloud\Datastore\V1\AggregationQuery_Aggregation_Count::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Sum.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Sum.php new file mode 100644 index 000000000000..1743020e7294 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Sum.php @@ -0,0 +1,95 @@ +google.datastore.v1.AggregationQuery.Aggregation.Sum + */ +class Sum extends \Google\Protobuf\Internal\Message +{ + /** + * The property to aggregate on. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + */ + protected $property = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\PropertyReference $property + * The property to aggregate on. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The property to aggregate on. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + * @return \Google\Cloud\Datastore\V1\PropertyReference|null + */ + public function getProperty() + { + return $this->property; + } + + public function hasProperty() + { + return isset($this->property); + } + + public function clearProperty() + { + unset($this->property); + } + + /** + * The property to aggregate on. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + * @param \Google\Cloud\Datastore\V1\PropertyReference $var + * @return $this + */ + public function setProperty($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyReference::class); + $this->property = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Sum::class, \Google\Cloud\Datastore\V1\AggregationQuery_Aggregation_Sum::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResult.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResult.php new file mode 100644 index 000000000000..a88234102734 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResult.php @@ -0,0 +1,86 @@ +google.datastore.v1.AggregationResult + */ +class AggregationResult extends \Google\Protobuf\Internal\Message +{ + /** + * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the + * [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] assigned to + * the aggregation function on input and the size of this map equals the + * number of aggregation functions in the query. + * + * Generated from protobuf field map aggregate_properties = 2; + */ + private $aggregate_properties; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $aggregate_properties + * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the + * [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] assigned to + * the aggregation function on input and the size of this map equals the + * number of aggregation functions in the query. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\AggregationResult::initOnce(); + parent::__construct($data); + } + + /** + * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the + * [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] assigned to + * the aggregation function on input and the size of this map equals the + * number of aggregation functions in the query. + * + * Generated from protobuf field map aggregate_properties = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAggregateProperties() + { + return $this->aggregate_properties; + } + + /** + * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + * The key is the + * [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] assigned to + * the aggregation function on input and the size of this map equals the + * number of aggregation functions in the query. + * + * Generated from protobuf field map aggregate_properties = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAggregateProperties($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Value::class); + $this->aggregate_properties = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResultBatch.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResultBatch.php new file mode 100644 index 000000000000..5dd97e690dc6 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResultBatch.php @@ -0,0 +1,165 @@ +google.datastore.v1.AggregationResultBatch + */ +class AggregationResultBatch extends \Google\Protobuf\Internal\Message +{ + /** + * The aggregation results for this batch. + * + * Generated from protobuf field repeated .google.datastore.v1.AggregationResult aggregation_results = 1; + */ + private $aggregation_results; + /** + * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + * + * Generated from protobuf field .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2; + */ + protected $more_results = 0; + /** + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; + */ + protected $read_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Datastore\V1\AggregationResult>|\Google\Protobuf\Internal\RepeatedField $aggregation_results + * The aggregation results for this batch. + * @type int $more_results + * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + * @type \Google\Protobuf\Timestamp $read_time + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\AggregationResult::initOnce(); + parent::__construct($data); + } + + /** + * The aggregation results for this batch. + * + * Generated from protobuf field repeated .google.datastore.v1.AggregationResult aggregation_results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAggregationResults() + { + return $this->aggregation_results; + } + + /** + * The aggregation results for this batch. + * + * Generated from protobuf field repeated .google.datastore.v1.AggregationResult aggregation_results = 1; + * @param array<\Google\Cloud\Datastore\V1\AggregationResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAggregationResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\AggregationResult::class); + $this->aggregation_results = $arr; + + return $this; + } + + /** + * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + * + * Generated from protobuf field .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2; + * @return int + */ + public function getMoreResults() + { + return $this->more_results; + } + + /** + * The state of the query after the current batch. + * Only COUNT(*) aggregations are supported in the initial launch. Therefore, + * expected result type is limited to `NO_MORE_RESULTS`. + * + * Generated from protobuf field .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2; + * @param int $var + * @return $this + */ + public function setMoreResults($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\QueryResultBatch\MoreResultsType::class); + $this->more_results = $var; + + return $this; + } + + /** + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * Read timestamp this batch was returned from. + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsRequest.php new file mode 100644 index 000000000000..df1f2e88eb08 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsRequest.php @@ -0,0 +1,164 @@ +google.datastore.v1.AllocateIdsRequest + */ +class AllocateIdsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + */ + protected $database_id = ''; + /** + * Required. A list of keys with incomplete key paths for which to allocate + * IDs. No key may be reserved/read-only. + * + * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $keys; + + /** + * @param string $projectId Required. The ID of the project against which to make the request. + * @param \Google\Cloud\Datastore\V1\Key[] $keys Required. A list of keys with incomplete key paths for which to allocate + * IDs. No key may be reserved/read-only. + * + * @return \Google\Cloud\Datastore\V1\AllocateIdsRequest + * + * @experimental + */ + public static function build(string $projectId, array $keys): self + { + return (new self()) + ->setProjectId($projectId) + ->setKeys($keys); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. The ID of the project against which to make the request. + * @type string $database_id + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $keys + * Required. A list of keys with incomplete key paths for which to allocate + * IDs. No key may be reserved/read-only. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @return string + */ + public function getDatabaseId() + { + return $this->database_id; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @param string $var + * @return $this + */ + public function setDatabaseId($var) + { + GPBUtil::checkString($var, True); + $this->database_id = $var; + + return $this; + } + + /** + * Required. A list of keys with incomplete key paths for which to allocate + * IDs. No key may be reserved/read-only. + * + * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKeys() + { + return $this->keys; + } + + /** + * Required. A list of keys with incomplete key paths for which to allocate + * IDs. No key may be reserved/read-only. + * + * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Key::class); + $this->keys = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsResponse.php new file mode 100644 index 000000000000..e0b747b6a67d --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsResponse.php @@ -0,0 +1,72 @@ +google.datastore.v1.AllocateIdsResponse + */ +class AllocateIdsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The keys specified in the request (in the same order), each with + * its key path completed with a newly allocated ID. + * + * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1; + */ + private $keys; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $keys + * The keys specified in the request (in the same order), each with + * its key path completed with a newly allocated ID. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * The keys specified in the request (in the same order), each with + * its key path completed with a newly allocated ID. + * + * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKeys() + { + return $this->keys; + } + + /** + * The keys specified in the request (in the same order), each with + * its key path completed with a newly allocated ID. + * + * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1; + * @param array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Key::class); + $this->keys = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ArrayValue.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ArrayValue.php new file mode 100644 index 000000000000..54d0bbf39feb --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ArrayValue.php @@ -0,0 +1,75 @@ +google.datastore.v1.ArrayValue + */ +class ArrayValue extends \Google\Protobuf\Internal\Message +{ + /** + * Values in the array. + * The order of values in an array is preserved as long as all values have + * identical settings for 'exclude_from_indexes'. + * + * Generated from protobuf field repeated .google.datastore.v1.Value values = 1; + */ + private $values; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Datastore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $values + * Values in the array. + * The order of values in an array is preserved as long as all values have + * identical settings for 'exclude_from_indexes'. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Entity::initOnce(); + parent::__construct($data); + } + + /** + * Values in the array. + * The order of values in an array is preserved as long as all values have + * identical settings for 'exclude_from_indexes'. + * + * Generated from protobuf field repeated .google.datastore.v1.Value values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Values in the array. + * The order of values in an array is preserved as long as all values have + * identical settings for 'exclude_from_indexes'. + * + * Generated from protobuf field repeated .google.datastore.v1.Value values = 1; + * @param array<\Google\Cloud\Datastore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Value::class); + $this->values = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionRequest.php new file mode 100644 index 000000000000..03c7ca69e5e0 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionRequest.php @@ -0,0 +1,167 @@ +google.datastore.v1.BeginTransactionRequest + */ +class BeginTransactionRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + */ + protected $database_id = ''; + /** + * Options for a new transaction. + * + * Generated from protobuf field .google.datastore.v1.TransactionOptions transaction_options = 10; + */ + protected $transaction_options = null; + + /** + * @param string $projectId Required. The ID of the project against which to make the request. + * + * @return \Google\Cloud\Datastore\V1\BeginTransactionRequest + * + * @experimental + */ + public static function build(string $projectId): self + { + return (new self()) + ->setProjectId($projectId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. The ID of the project against which to make the request. + * @type string $database_id + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type \Google\Cloud\Datastore\V1\TransactionOptions $transaction_options + * Options for a new transaction. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @return string + */ + public function getDatabaseId() + { + return $this->database_id; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @param string $var + * @return $this + */ + public function setDatabaseId($var) + { + GPBUtil::checkString($var, True); + $this->database_id = $var; + + return $this; + } + + /** + * Options for a new transaction. + * + * Generated from protobuf field .google.datastore.v1.TransactionOptions transaction_options = 10; + * @return \Google\Cloud\Datastore\V1\TransactionOptions|null + */ + public function getTransactionOptions() + { + return $this->transaction_options; + } + + public function hasTransactionOptions() + { + return isset($this->transaction_options); + } + + public function clearTransactionOptions() + { + unset($this->transaction_options); + } + + /** + * Options for a new transaction. + * + * Generated from protobuf field .google.datastore.v1.TransactionOptions transaction_options = 10; + * @param \Google\Cloud\Datastore\V1\TransactionOptions $var + * @return $this + */ + public function setTransactionOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\TransactionOptions::class); + $this->transaction_options = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionResponse.php new file mode 100644 index 000000000000..09b15c04119b --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionResponse.php @@ -0,0 +1,68 @@ +google.datastore.v1.BeginTransactionResponse + */ +class BeginTransactionResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The transaction identifier (always present). + * + * Generated from protobuf field bytes transaction = 1; + */ + protected $transaction = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $transaction + * The transaction identifier (always present). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * The transaction identifier (always present). + * + * Generated from protobuf field bytes transaction = 1; + * @return string + */ + public function getTransaction() + { + return $this->transaction; + } + + /** + * The transaction identifier (always present). + * + * Generated from protobuf field bytes transaction = 1; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->transaction = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest.php new file mode 100644 index 000000000000..3d25a236d48b --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest.php @@ -0,0 +1,367 @@ +google.datastore.v1.CommitRequest + */ +class CommitRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + */ + protected $database_id = ''; + /** + * The type of commit to perform. Defaults to `TRANSACTIONAL`. + * + * Generated from protobuf field .google.datastore.v1.CommitRequest.Mode mode = 5; + */ + protected $mode = 0; + /** + * The mutations to perform. + * When mode is `TRANSACTIONAL`, mutations affecting a single entity are + * applied in order. The following sequences of mutations affecting a single + * entity are not permitted in a single `Commit` request: + * - `insert` followed by `insert` + * - `update` followed by `insert` + * - `upsert` followed by `insert` + * - `delete` followed by `update` + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + * + * Generated from protobuf field repeated .google.datastore.v1.Mutation mutations = 6; + */ + private $mutations; + protected $transaction_selector; + + /** + * @param string $projectId Required. The ID of the project against which to make the request. + * @param int $mode The type of commit to perform. Defaults to `TRANSACTIONAL`. + * For allowed values, use constants defined on {@see \Google\Cloud\Datastore\V1\CommitRequest\Mode} + * @param string $transaction The identifier of the transaction associated with the commit. A + * transaction identifier is returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * @param \Google\Cloud\Datastore\V1\Mutation[] $mutations The mutations to perform. + * + * When mode is `TRANSACTIONAL`, mutations affecting a single entity are + * applied in order. The following sequences of mutations affecting a single + * entity are not permitted in a single `Commit` request: + * + * - `insert` followed by `insert` + * - `update` followed by `insert` + * - `upsert` followed by `insert` + * - `delete` followed by `update` + * + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + * + * @return \Google\Cloud\Datastore\V1\CommitRequest + * + * @experimental + */ + public static function build(string $projectId, int $mode, string $transaction, array $mutations): self + { + return (new self()) + ->setProjectId($projectId) + ->setMode($mode) + ->setTransaction($transaction) + ->setMutations($mutations); + } + + /** + * @param string $projectId Required. The ID of the project against which to make the request. + * @param int $mode The type of commit to perform. Defaults to `TRANSACTIONAL`. + * For allowed values, use constants defined on {@see \Google\Cloud\Datastore\V1\CommitRequest\Mode} + * @param \Google\Cloud\Datastore\V1\Mutation[] $mutations The mutations to perform. + * + * When mode is `TRANSACTIONAL`, mutations affecting a single entity are + * applied in order. The following sequences of mutations affecting a single + * entity are not permitted in a single `Commit` request: + * + * - `insert` followed by `insert` + * - `update` followed by `insert` + * - `upsert` followed by `insert` + * - `delete` followed by `update` + * + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + * + * @return \Google\Cloud\Datastore\V1\CommitRequest + * + * @experimental + */ + public static function buildFromProjectIdModeMutations(string $projectId, int $mode, array $mutations): self + { + return (new self()) + ->setProjectId($projectId) + ->setMode($mode) + ->setMutations($mutations); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. The ID of the project against which to make the request. + * @type string $database_id + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type int $mode + * The type of commit to perform. Defaults to `TRANSACTIONAL`. + * @type string $transaction + * The identifier of the transaction associated with the commit. A + * transaction identifier is returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * @type \Google\Cloud\Datastore\V1\TransactionOptions $single_use_transaction + * Options for beginning a new transaction for this request. + * The transaction is committed when the request completes. If specified, + * [TransactionOptions.mode][google.datastore.v1.TransactionOptions] must be + * [TransactionOptions.ReadWrite][google.datastore.v1.TransactionOptions.ReadWrite]. + * @type array<\Google\Cloud\Datastore\V1\Mutation>|\Google\Protobuf\Internal\RepeatedField $mutations + * The mutations to perform. + * When mode is `TRANSACTIONAL`, mutations affecting a single entity are + * applied in order. The following sequences of mutations affecting a single + * entity are not permitted in a single `Commit` request: + * - `insert` followed by `insert` + * - `update` followed by `insert` + * - `upsert` followed by `insert` + * - `delete` followed by `update` + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @return string + */ + public function getDatabaseId() + { + return $this->database_id; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @param string $var + * @return $this + */ + public function setDatabaseId($var) + { + GPBUtil::checkString($var, True); + $this->database_id = $var; + + return $this; + } + + /** + * The type of commit to perform. Defaults to `TRANSACTIONAL`. + * + * Generated from protobuf field .google.datastore.v1.CommitRequest.Mode mode = 5; + * @return int + */ + public function getMode() + { + return $this->mode; + } + + /** + * The type of commit to perform. Defaults to `TRANSACTIONAL`. + * + * Generated from protobuf field .google.datastore.v1.CommitRequest.Mode mode = 5; + * @param int $var + * @return $this + */ + public function setMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\CommitRequest\Mode::class); + $this->mode = $var; + + return $this; + } + + /** + * The identifier of the transaction associated with the commit. A + * transaction identifier is returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * + * Generated from protobuf field bytes transaction = 1; + * @return string + */ + public function getTransaction() + { + return $this->readOneof(1); + } + + public function hasTransaction() + { + return $this->hasOneof(1); + } + + /** + * The identifier of the transaction associated with the commit. A + * transaction identifier is returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * + * Generated from protobuf field bytes transaction = 1; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Options for beginning a new transaction for this request. + * The transaction is committed when the request completes. If specified, + * [TransactionOptions.mode][google.datastore.v1.TransactionOptions] must be + * [TransactionOptions.ReadWrite][google.datastore.v1.TransactionOptions.ReadWrite]. + * + * Generated from protobuf field .google.datastore.v1.TransactionOptions single_use_transaction = 10; + * @return \Google\Cloud\Datastore\V1\TransactionOptions|null + */ + public function getSingleUseTransaction() + { + return $this->readOneof(10); + } + + public function hasSingleUseTransaction() + { + return $this->hasOneof(10); + } + + /** + * Options for beginning a new transaction for this request. + * The transaction is committed when the request completes. If specified, + * [TransactionOptions.mode][google.datastore.v1.TransactionOptions] must be + * [TransactionOptions.ReadWrite][google.datastore.v1.TransactionOptions.ReadWrite]. + * + * Generated from protobuf field .google.datastore.v1.TransactionOptions single_use_transaction = 10; + * @param \Google\Cloud\Datastore\V1\TransactionOptions $var + * @return $this + */ + public function setSingleUseTransaction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\TransactionOptions::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * The mutations to perform. + * When mode is `TRANSACTIONAL`, mutations affecting a single entity are + * applied in order. The following sequences of mutations affecting a single + * entity are not permitted in a single `Commit` request: + * - `insert` followed by `insert` + * - `update` followed by `insert` + * - `upsert` followed by `insert` + * - `delete` followed by `update` + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + * + * Generated from protobuf field repeated .google.datastore.v1.Mutation mutations = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMutations() + { + return $this->mutations; + } + + /** + * The mutations to perform. + * When mode is `TRANSACTIONAL`, mutations affecting a single entity are + * applied in order. The following sequences of mutations affecting a single + * entity are not permitted in a single `Commit` request: + * - `insert` followed by `insert` + * - `update` followed by `insert` + * - `upsert` followed by `insert` + * - `delete` followed by `update` + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + * + * Generated from protobuf field repeated .google.datastore.v1.Mutation mutations = 6; + * @param array<\Google\Cloud\Datastore\V1\Mutation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMutations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Mutation::class); + $this->mutations = $arr; + + return $this; + } + + /** + * @return string + */ + public function getTransactionSelector() + { + return $this->whichOneof("transaction_selector"); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest/Mode.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest/Mode.php new file mode 100644 index 000000000000..b4e9acbd6eb8 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest/Mode.php @@ -0,0 +1,66 @@ +google.datastore.v1.CommitRequest.Mode + */ +class Mode +{ + /** + * Unspecified. This value must not be used. + * + * Generated from protobuf enum MODE_UNSPECIFIED = 0; + */ + const MODE_UNSPECIFIED = 0; + /** + * Transactional: The mutations are either all applied, or none are applied. + * Learn about transactions + * [here](https://cloud.google.com/datastore/docs/concepts/transactions). + * + * Generated from protobuf enum TRANSACTIONAL = 1; + */ + const TRANSACTIONAL = 1; + /** + * Non-transactional: The mutations may not apply as all or none. + * + * Generated from protobuf enum NON_TRANSACTIONAL = 2; + */ + const NON_TRANSACTIONAL = 2; + + private static $valueToName = [ + self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', + self::TRANSACTIONAL => 'TRANSACTIONAL', + self::NON_TRANSACTIONAL => 'NON_TRANSACTIONAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Mode::class, \Google\Cloud\Datastore\V1\CommitRequest_Mode::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitResponse.php new file mode 100644 index 000000000000..9c468d874e9e --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitResponse.php @@ -0,0 +1,153 @@ +google.datastore.v1.CommitResponse + */ +class CommitResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The result of performing the mutations. + * The i-th mutation result corresponds to the i-th mutation in the request. + * + * Generated from protobuf field repeated .google.datastore.v1.MutationResult mutation_results = 3; + */ + private $mutation_results; + /** + * The number of index entries updated during the commit, or zero if none were + * updated. + * + * Generated from protobuf field int32 index_updates = 4; + */ + protected $index_updates = 0; + /** + * The transaction commit timestamp. Not set for non-transactional commits. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 8; + */ + protected $commit_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Datastore\V1\MutationResult>|\Google\Protobuf\Internal\RepeatedField $mutation_results + * The result of performing the mutations. + * The i-th mutation result corresponds to the i-th mutation in the request. + * @type int $index_updates + * The number of index entries updated during the commit, or zero if none were + * updated. + * @type \Google\Protobuf\Timestamp $commit_time + * The transaction commit timestamp. Not set for non-transactional commits. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * The result of performing the mutations. + * The i-th mutation result corresponds to the i-th mutation in the request. + * + * Generated from protobuf field repeated .google.datastore.v1.MutationResult mutation_results = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMutationResults() + { + return $this->mutation_results; + } + + /** + * The result of performing the mutations. + * The i-th mutation result corresponds to the i-th mutation in the request. + * + * Generated from protobuf field repeated .google.datastore.v1.MutationResult mutation_results = 3; + * @param array<\Google\Cloud\Datastore\V1\MutationResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMutationResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\MutationResult::class); + $this->mutation_results = $arr; + + return $this; + } + + /** + * The number of index entries updated during the commit, or zero if none were + * updated. + * + * Generated from protobuf field int32 index_updates = 4; + * @return int + */ + public function getIndexUpdates() + { + return $this->index_updates; + } + + /** + * The number of index entries updated during the commit, or zero if none were + * updated. + * + * Generated from protobuf field int32 index_updates = 4; + * @param int $var + * @return $this + */ + public function setIndexUpdates($var) + { + GPBUtil::checkInt32($var); + $this->index_updates = $var; + + return $this; + } + + /** + * The transaction commit timestamp. Not set for non-transactional commits. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 8; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCommitTime() + { + return $this->commit_time; + } + + public function hasCommitTime() + { + return isset($this->commit_time); + } + + public function clearCommitTime() + { + unset($this->commit_time); + } + + /** + * The transaction commit timestamp. Not set for non-transactional commits. + * + * Generated from protobuf field .google.protobuf.Timestamp commit_time = 8; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCommitTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->commit_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter.php new file mode 100644 index 000000000000..8426fe7cea32 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter.php @@ -0,0 +1,109 @@ +google.datastore.v1.CompositeFilter + */ +class CompositeFilter extends \Google\Protobuf\Internal\Message +{ + /** + * The operator for combining multiple filters. + * + * Generated from protobuf field .google.datastore.v1.CompositeFilter.Operator op = 1; + */ + protected $op = 0; + /** + * The list of filters to combine. + * Requires: + * * At least one filter is present. + * + * Generated from protobuf field repeated .google.datastore.v1.Filter filters = 2; + */ + private $filters; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $op + * The operator for combining multiple filters. + * @type array<\Google\Cloud\Datastore\V1\Filter>|\Google\Protobuf\Internal\RepeatedField $filters + * The list of filters to combine. + * Requires: + * * At least one filter is present. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The operator for combining multiple filters. + * + * Generated from protobuf field .google.datastore.v1.CompositeFilter.Operator op = 1; + * @return int + */ + public function getOp() + { + return $this->op; + } + + /** + * The operator for combining multiple filters. + * + * Generated from protobuf field .google.datastore.v1.CompositeFilter.Operator op = 1; + * @param int $var + * @return $this + */ + public function setOp($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\CompositeFilter\Operator::class); + $this->op = $var; + + return $this; + } + + /** + * The list of filters to combine. + * Requires: + * * At least one filter is present. + * + * Generated from protobuf field repeated .google.datastore.v1.Filter filters = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFilters() + { + return $this->filters; + } + + /** + * The list of filters to combine. + * Requires: + * * At least one filter is present. + * + * Generated from protobuf field repeated .google.datastore.v1.Filter filters = 2; + * @param array<\Google\Cloud\Datastore\V1\Filter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFilters($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Filter::class); + $this->filters = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter/Operator.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter/Operator.php new file mode 100644 index 000000000000..4cd871b7ed94 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter/Operator.php @@ -0,0 +1,68 @@ +google.datastore.v1.CompositeFilter.Operator + */ +class Operator +{ + /** + * Unspecified. This value must not be used. + * + * Generated from protobuf enum OPERATOR_UNSPECIFIED = 0; + */ + const OPERATOR_UNSPECIFIED = 0; + /** + * The results are required to satisfy each of the combined filters. + * + * Generated from protobuf enum AND = 1; + */ + const PBAND = 1; + /** + * Documents are required to satisfy at least one of the combined filters. + * + * Generated from protobuf enum OR = 2; + */ + const PBOR = 2; + + private static $valueToName = [ + self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', + self::PBAND => 'AND', + self::PBOR => 'OR', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + $pbconst = __CLASS__. '::PB' . strtoupper($name); + if (!defined($pbconst)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($pbconst); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Operator::class, \Google\Cloud\Datastore\V1\CompositeFilter_Operator::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Entity.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Entity.php new file mode 100644 index 000000000000..53b46087f3a6 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Entity.php @@ -0,0 +1,148 @@ +google.datastore.v1.Entity + */ +class Entity extends \Google\Protobuf\Internal\Message +{ + /** + * The entity's key. + * An entity must have a key, unless otherwise documented (for example, + * an entity in `Value.entity_value` may have no key). + * An entity's kind is its key path's last element's kind, + * or null if it has no key. + * + * Generated from protobuf field .google.datastore.v1.Key key = 1; + */ + protected $key = null; + /** + * The entity's properties. + * The map's keys are property names. + * A property name matching regex `__.*__` is reserved. + * A reserved property name is forbidden in certain documented contexts. + * The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot + * be empty. + * + * Generated from protobuf field map properties = 3; + */ + private $properties; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\Key $key + * The entity's key. + * An entity must have a key, unless otherwise documented (for example, + * an entity in `Value.entity_value` may have no key). + * An entity's kind is its key path's last element's kind, + * or null if it has no key. + * @type array|\Google\Protobuf\Internal\MapField $properties + * The entity's properties. + * The map's keys are property names. + * A property name matching regex `__.*__` is reserved. + * A reserved property name is forbidden in certain documented contexts. + * The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot + * be empty. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Entity::initOnce(); + parent::__construct($data); + } + + /** + * The entity's key. + * An entity must have a key, unless otherwise documented (for example, + * an entity in `Value.entity_value` may have no key). + * An entity's kind is its key path's last element's kind, + * or null if it has no key. + * + * Generated from protobuf field .google.datastore.v1.Key key = 1; + * @return \Google\Cloud\Datastore\V1\Key|null + */ + public function getKey() + { + return $this->key; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * The entity's key. + * An entity must have a key, unless otherwise documented (for example, + * an entity in `Value.entity_value` may have no key). + * An entity's kind is its key path's last element's kind, + * or null if it has no key. + * + * Generated from protobuf field .google.datastore.v1.Key key = 1; + * @param \Google\Cloud\Datastore\V1\Key $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Key::class); + $this->key = $var; + + return $this; + } + + /** + * The entity's properties. + * The map's keys are property names. + * A property name matching regex `__.*__` is reserved. + * A reserved property name is forbidden in certain documented contexts. + * The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot + * be empty. + * + * Generated from protobuf field map properties = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getProperties() + { + return $this->properties; + } + + /** + * The entity's properties. + * The map's keys are property names. + * A property name matching regex `__.*__` is reserved. + * A reserved property name is forbidden in certain documented contexts. + * The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot + * be empty. + * + * Generated from protobuf field map properties = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setProperties($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Value::class); + $this->properties = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult.php new file mode 100644 index 000000000000..2fb16860fbd9 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult.php @@ -0,0 +1,285 @@ +google.datastore.v1.EntityResult + */ +class EntityResult extends \Google\Protobuf\Internal\Message +{ + /** + * The resulting entity. + * + * Generated from protobuf field .google.datastore.v1.Entity entity = 1; + */ + protected $entity = null; + /** + * The version of the entity, a strictly positive number that monotonically + * increases with changes to the entity. + * This field is set for + * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. + * For [missing][google.datastore.v1.LookupResponse.missing] entities in + * `LookupResponse`, this is the version of the snapshot that was used to look + * up the entity, and it is always set except for eventually consistent reads. + * + * Generated from protobuf field int64 version = 4; + */ + protected $version = 0; + /** + * The time at which the entity was created. + * This field is set for + * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. + * If this entity is missing, this field will not be set. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; + */ + protected $create_time = null; + /** + * The time at which the entity was last changed. + * This field is set for + * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. + * If this entity is missing, this field will not be set. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5; + */ + protected $update_time = null; + /** + * A cursor that points to the position after the result entity. + * Set only when the `EntityResult` is part of a `QueryResultBatch` message. + * + * Generated from protobuf field bytes cursor = 3; + */ + protected $cursor = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\Entity $entity + * The resulting entity. + * @type int|string $version + * The version of the entity, a strictly positive number that monotonically + * increases with changes to the entity. + * This field is set for + * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. + * For [missing][google.datastore.v1.LookupResponse.missing] entities in + * `LookupResponse`, this is the version of the snapshot that was used to look + * up the entity, and it is always set except for eventually consistent reads. + * @type \Google\Protobuf\Timestamp $create_time + * The time at which the entity was created. + * This field is set for + * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. + * If this entity is missing, this field will not be set. + * @type \Google\Protobuf\Timestamp $update_time + * The time at which the entity was last changed. + * This field is set for + * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. + * If this entity is missing, this field will not be set. + * @type string $cursor + * A cursor that points to the position after the result entity. + * Set only when the `EntityResult` is part of a `QueryResultBatch` message. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The resulting entity. + * + * Generated from protobuf field .google.datastore.v1.Entity entity = 1; + * @return \Google\Cloud\Datastore\V1\Entity|null + */ + public function getEntity() + { + return $this->entity; + } + + public function hasEntity() + { + return isset($this->entity); + } + + public function clearEntity() + { + unset($this->entity); + } + + /** + * The resulting entity. + * + * Generated from protobuf field .google.datastore.v1.Entity entity = 1; + * @param \Google\Cloud\Datastore\V1\Entity $var + * @return $this + */ + public function setEntity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Entity::class); + $this->entity = $var; + + return $this; + } + + /** + * The version of the entity, a strictly positive number that monotonically + * increases with changes to the entity. + * This field is set for + * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. + * For [missing][google.datastore.v1.LookupResponse.missing] entities in + * `LookupResponse`, this is the version of the snapshot that was used to look + * up the entity, and it is always set except for eventually consistent reads. + * + * Generated from protobuf field int64 version = 4; + * @return int|string + */ + public function getVersion() + { + return $this->version; + } + + /** + * The version of the entity, a strictly positive number that monotonically + * increases with changes to the entity. + * This field is set for + * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. + * For [missing][google.datastore.v1.LookupResponse.missing] entities in + * `LookupResponse`, this is the version of the snapshot that was used to look + * up the entity, and it is always set except for eventually consistent reads. + * + * Generated from protobuf field int64 version = 4; + * @param int|string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkInt64($var); + $this->version = $var; + + return $this; + } + + /** + * The time at which the entity was created. + * This field is set for + * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. + * If this entity is missing, this field will not be set. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The time at which the entity was created. + * This field is set for + * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. + * If this entity is missing, this field will not be set. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The time at which the entity was last changed. + * This field is set for + * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. + * If this entity is missing, this field will not be set. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * The time at which the entity was last changed. + * This field is set for + * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. + * If this entity is missing, this field will not be set. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * A cursor that points to the position after the result entity. + * Set only when the `EntityResult` is part of a `QueryResultBatch` message. + * + * Generated from protobuf field bytes cursor = 3; + * @return string + */ + public function getCursor() + { + return $this->cursor; + } + + /** + * A cursor that points to the position after the result entity. + * Set only when the `EntityResult` is part of a `QueryResultBatch` message. + * + * Generated from protobuf field bytes cursor = 3; + * @param string $var + * @return $this + */ + public function setCursor($var) + { + GPBUtil::checkString($var, False); + $this->cursor = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult/ResultType.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult/ResultType.php new file mode 100644 index 000000000000..2e2471e78e19 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult/ResultType.php @@ -0,0 +1,75 @@ +google.datastore.v1.EntityResult.ResultType + */ +class ResultType +{ + /** + * Unspecified. This value is never used. + * + * Generated from protobuf enum RESULT_TYPE_UNSPECIFIED = 0; + */ + const RESULT_TYPE_UNSPECIFIED = 0; + /** + * The key and properties. + * + * Generated from protobuf enum FULL = 1; + */ + const FULL = 1; + /** + * A projected subset of properties. The entity may have no key. + * + * Generated from protobuf enum PROJECTION = 2; + */ + const PROJECTION = 2; + /** + * Only the key. + * + * Generated from protobuf enum KEY_ONLY = 3; + */ + const KEY_ONLY = 3; + + private static $valueToName = [ + self::RESULT_TYPE_UNSPECIFIED => 'RESULT_TYPE_UNSPECIFIED', + self::FULL => 'FULL', + self::PROJECTION => 'PROJECTION', + self::KEY_ONLY => 'KEY_ONLY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ResultType::class, \Google\Cloud\Datastore\V1\EntityResult_ResultType::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExecutionStats.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExecutionStats.php new file mode 100644 index 000000000000..4de843f075e3 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExecutionStats.php @@ -0,0 +1,237 @@ +google.datastore.v1.ExecutionStats + */ +class ExecutionStats extends \Google\Protobuf\Internal\Message +{ + /** + * Total number of results returned, including documents, projections, + * aggregation results, keys. + * + * Generated from protobuf field int64 results_returned = 1; + */ + protected $results_returned = 0; + /** + * Total time to execute the query in the backend. + * + * Generated from protobuf field .google.protobuf.Duration execution_duration = 3; + */ + protected $execution_duration = null; + /** + * Total billable read operations. + * + * Generated from protobuf field int64 read_operations = 4; + */ + protected $read_operations = 0; + /** + * Debugging statistics from the execution of the query. Note that the + * debugging stats are subject to change as Firestore evolves. It could + * include: + * { + * "indexes_entries_scanned": "1000", + * "documents_scanned": "20", + * "billing_details" : { + * "documents_billable": "20", + * "index_entries_billable": "1000", + * "min_query_cost": "0" + * } + * } + * + * Generated from protobuf field .google.protobuf.Struct debug_stats = 5; + */ + protected $debug_stats = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $results_returned + * Total number of results returned, including documents, projections, + * aggregation results, keys. + * @type \Google\Protobuf\Duration $execution_duration + * Total time to execute the query in the backend. + * @type int|string $read_operations + * Total billable read operations. + * @type \Google\Protobuf\Struct $debug_stats + * Debugging statistics from the execution of the query. Note that the + * debugging stats are subject to change as Firestore evolves. It could + * include: + * { + * "indexes_entries_scanned": "1000", + * "documents_scanned": "20", + * "billing_details" : { + * "documents_billable": "20", + * "index_entries_billable": "1000", + * "min_query_cost": "0" + * } + * } + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\QueryProfile::initOnce(); + parent::__construct($data); + } + + /** + * Total number of results returned, including documents, projections, + * aggregation results, keys. + * + * Generated from protobuf field int64 results_returned = 1; + * @return int|string + */ + public function getResultsReturned() + { + return $this->results_returned; + } + + /** + * Total number of results returned, including documents, projections, + * aggregation results, keys. + * + * Generated from protobuf field int64 results_returned = 1; + * @param int|string $var + * @return $this + */ + public function setResultsReturned($var) + { + GPBUtil::checkInt64($var); + $this->results_returned = $var; + + return $this; + } + + /** + * Total time to execute the query in the backend. + * + * Generated from protobuf field .google.protobuf.Duration execution_duration = 3; + * @return \Google\Protobuf\Duration|null + */ + public function getExecutionDuration() + { + return $this->execution_duration; + } + + public function hasExecutionDuration() + { + return isset($this->execution_duration); + } + + public function clearExecutionDuration() + { + unset($this->execution_duration); + } + + /** + * Total time to execute the query in the backend. + * + * Generated from protobuf field .google.protobuf.Duration execution_duration = 3; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setExecutionDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->execution_duration = $var; + + return $this; + } + + /** + * Total billable read operations. + * + * Generated from protobuf field int64 read_operations = 4; + * @return int|string + */ + public function getReadOperations() + { + return $this->read_operations; + } + + /** + * Total billable read operations. + * + * Generated from protobuf field int64 read_operations = 4; + * @param int|string $var + * @return $this + */ + public function setReadOperations($var) + { + GPBUtil::checkInt64($var); + $this->read_operations = $var; + + return $this; + } + + /** + * Debugging statistics from the execution of the query. Note that the + * debugging stats are subject to change as Firestore evolves. It could + * include: + * { + * "indexes_entries_scanned": "1000", + * "documents_scanned": "20", + * "billing_details" : { + * "documents_billable": "20", + * "index_entries_billable": "1000", + * "min_query_cost": "0" + * } + * } + * + * Generated from protobuf field .google.protobuf.Struct debug_stats = 5; + * @return \Google\Protobuf\Struct|null + */ + public function getDebugStats() + { + return $this->debug_stats; + } + + public function hasDebugStats() + { + return isset($this->debug_stats); + } + + public function clearDebugStats() + { + unset($this->debug_stats); + } + + /** + * Debugging statistics from the execution of the query. Note that the + * debugging stats are subject to change as Firestore evolves. It could + * include: + * { + * "indexes_entries_scanned": "1000", + * "documents_scanned": "20", + * "billing_details" : { + * "documents_billable": "20", + * "index_entries_billable": "1000", + * "min_query_cost": "0" + * } + * } + * + * Generated from protobuf field .google.protobuf.Struct debug_stats = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setDebugStats($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->debug_stats = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainMetrics.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainMetrics.php new file mode 100644 index 000000000000..99decd220a7d --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainMetrics.php @@ -0,0 +1,129 @@ +google.datastore.v1.ExplainMetrics + */ +class ExplainMetrics extends \Google\Protobuf\Internal\Message +{ + /** + * Planning phase information for the query. + * + * Generated from protobuf field .google.datastore.v1.PlanSummary plan_summary = 1; + */ + protected $plan_summary = null; + /** + * Aggregated stats from the execution of the query. Only present when + * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set + * to true. + * + * Generated from protobuf field .google.datastore.v1.ExecutionStats execution_stats = 2; + */ + protected $execution_stats = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\PlanSummary $plan_summary + * Planning phase information for the query. + * @type \Google\Cloud\Datastore\V1\ExecutionStats $execution_stats + * Aggregated stats from the execution of the query. Only present when + * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set + * to true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\QueryProfile::initOnce(); + parent::__construct($data); + } + + /** + * Planning phase information for the query. + * + * Generated from protobuf field .google.datastore.v1.PlanSummary plan_summary = 1; + * @return \Google\Cloud\Datastore\V1\PlanSummary|null + */ + public function getPlanSummary() + { + return $this->plan_summary; + } + + public function hasPlanSummary() + { + return isset($this->plan_summary); + } + + public function clearPlanSummary() + { + unset($this->plan_summary); + } + + /** + * Planning phase information for the query. + * + * Generated from protobuf field .google.datastore.v1.PlanSummary plan_summary = 1; + * @param \Google\Cloud\Datastore\V1\PlanSummary $var + * @return $this + */ + public function setPlanSummary($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PlanSummary::class); + $this->plan_summary = $var; + + return $this; + } + + /** + * Aggregated stats from the execution of the query. Only present when + * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set + * to true. + * + * Generated from protobuf field .google.datastore.v1.ExecutionStats execution_stats = 2; + * @return \Google\Cloud\Datastore\V1\ExecutionStats|null + */ + public function getExecutionStats() + { + return $this->execution_stats; + } + + public function hasExecutionStats() + { + return isset($this->execution_stats); + } + + public function clearExecutionStats() + { + unset($this->execution_stats); + } + + /** + * Aggregated stats from the execution of the query. Only present when + * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set + * to true. + * + * Generated from protobuf field .google.datastore.v1.ExecutionStats execution_stats = 2; + * @param \Google\Cloud\Datastore\V1\ExecutionStats $var + * @return $this + */ + public function setExecutionStats($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ExecutionStats::class); + $this->execution_stats = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainOptions.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainOptions.php new file mode 100644 index 000000000000..d903d204f9ea --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainOptions.php @@ -0,0 +1,83 @@ +google.datastore.v1.ExplainOptions + */ +class ExplainOptions extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Whether to execute this query. + * When false (the default), the query will be planned, returning only + * metrics from the planning stages. + * When true, the query will be planned and executed, returning the full + * query results along with both planning and execution stage metrics. + * + * Generated from protobuf field bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $analyze = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $analyze + * Optional. Whether to execute this query. + * When false (the default), the query will be planned, returning only + * metrics from the planning stages. + * When true, the query will be planned and executed, returning the full + * query results along with both planning and execution stage metrics. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\QueryProfile::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Whether to execute this query. + * When false (the default), the query will be planned, returning only + * metrics from the planning stages. + * When true, the query will be planned and executed, returning the full + * query results along with both planning and execution stage metrics. + * + * Generated from protobuf field bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getAnalyze() + { + return $this->analyze; + } + + /** + * Optional. Whether to execute this query. + * When false (the default), the query will be planned, returning only + * metrics from the planning stages. + * When true, the query will be planned and executed, returning the full + * query results along with both planning and execution stage metrics. + * + * Generated from protobuf field bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setAnalyze($var) + { + GPBUtil::checkBool($var); + $this->analyze = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Filter.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Filter.php new file mode 100644 index 000000000000..a4d1b4c8b575 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Filter.php @@ -0,0 +1,108 @@ +google.datastore.v1.Filter + */ +class Filter extends \Google\Protobuf\Internal\Message +{ + protected $filter_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\CompositeFilter $composite_filter + * A composite filter. + * @type \Google\Cloud\Datastore\V1\PropertyFilter $property_filter + * A filter on a property. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * A composite filter. + * + * Generated from protobuf field .google.datastore.v1.CompositeFilter composite_filter = 1; + * @return \Google\Cloud\Datastore\V1\CompositeFilter|null + */ + public function getCompositeFilter() + { + return $this->readOneof(1); + } + + public function hasCompositeFilter() + { + return $this->hasOneof(1); + } + + /** + * A composite filter. + * + * Generated from protobuf field .google.datastore.v1.CompositeFilter composite_filter = 1; + * @param \Google\Cloud\Datastore\V1\CompositeFilter $var + * @return $this + */ + public function setCompositeFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\CompositeFilter::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * A filter on a property. + * + * Generated from protobuf field .google.datastore.v1.PropertyFilter property_filter = 2; + * @return \Google\Cloud\Datastore\V1\PropertyFilter|null + */ + public function getPropertyFilter() + { + return $this->readOneof(2); + } + + public function hasPropertyFilter() + { + return $this->hasOneof(2); + } + + /** + * A filter on a property. + * + * Generated from protobuf field .google.datastore.v1.PropertyFilter property_filter = 2; + * @param \Google\Cloud\Datastore\V1\PropertyFilter $var + * @return $this + */ + public function setPropertyFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyFilter::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getFilterType() + { + return $this->whichOneof("filter_type"); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/FindNearest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/FindNearest.php new file mode 100644 index 000000000000..93efe15d4d17 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/FindNearest.php @@ -0,0 +1,390 @@ +google.datastore.v1.FindNearest + */ +class FindNearest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. An indexed vector property to search upon. Only documents which + * contain vectors whose dimensionality match the query_vector can be + * returned. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vector_property = null; + /** + * Required. The query vector that we are searching on. Must be a vector of no + * more than 2048 dimensions. + * + * Generated from protobuf field .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $query_vector = null; + /** + * Required. The Distance Measure to use, required. + * + * Generated from protobuf field .google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $distance_measure = 0; + /** + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 100. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $limit = null; + /** + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [entity + * property][google.datastore.v1.Entity.properties] limitations. + * + * Generated from protobuf field string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $distance_result_property = ''; + /** + * Optional. Option to specify a threshold for which no less similar documents + * will be returned. The behavior of the specified `distance_measure` will + * affect the meaning of the distance threshold. Since DOT_PRODUCT distances + * increase when the vectors are more similar, the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $distance_threshold = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\PropertyReference $vector_property + * Required. An indexed vector property to search upon. Only documents which + * contain vectors whose dimensionality match the query_vector can be + * returned. + * @type \Google\Cloud\Datastore\V1\Value $query_vector + * Required. The query vector that we are searching on. Must be a vector of no + * more than 2048 dimensions. + * @type int $distance_measure + * Required. The Distance Measure to use, required. + * @type \Google\Protobuf\Int32Value $limit + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 100. + * @type string $distance_result_property + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [entity + * property][google.datastore.v1.Entity.properties] limitations. + * @type \Google\Protobuf\DoubleValue $distance_threshold + * Optional. Option to specify a threshold for which no less similar documents + * will be returned. The behavior of the specified `distance_measure` will + * affect the meaning of the distance threshold. Since DOT_PRODUCT distances + * increase when the vectors are more similar, the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * Required. An indexed vector property to search upon. Only documents which + * contain vectors whose dimensionality match the query_vector can be + * returned. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Datastore\V1\PropertyReference|null + */ + public function getVectorProperty() + { + return $this->vector_property; + } + + public function hasVectorProperty() + { + return isset($this->vector_property); + } + + public function clearVectorProperty() + { + unset($this->vector_property); + } + + /** + * Required. An indexed vector property to search upon. Only documents which + * contain vectors whose dimensionality match the query_vector can be + * returned. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Datastore\V1\PropertyReference $var + * @return $this + */ + public function setVectorProperty($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyReference::class); + $this->vector_property = $var; + + return $this; + } + + /** + * Required. The query vector that we are searching on. Must be a vector of no + * more than 2048 dimensions. + * + * Generated from protobuf field .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\Datastore\V1\Value|null + */ + public function getQueryVector() + { + return $this->query_vector; + } + + public function hasQueryVector() + { + return isset($this->query_vector); + } + + public function clearQueryVector() + { + unset($this->query_vector); + } + + /** + * Required. The query vector that we are searching on. Must be a vector of no + * more than 2048 dimensions. + * + * Generated from protobuf field .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\Datastore\V1\Value $var + * @return $this + */ + public function setQueryVector($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); + $this->query_vector = $var; + + return $this; + } + + /** + * Required. The Distance Measure to use, required. + * + * Generated from protobuf field .google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDistanceMeasure() + { + return $this->distance_measure; + } + + /** + * Required. The Distance Measure to use, required. + * + * Generated from protobuf field .google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDistanceMeasure($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\FindNearest\DistanceMeasure::class); + $this->distance_measure = $var; + + return $this; + } + + /** + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 100. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Int32Value|null + */ + public function getLimit() + { + return $this->limit; + } + + public function hasLimit() + { + return isset($this->limit); + } + + public function clearLimit() + { + unset($this->limit); + } + + /** + * Returns the unboxed value from getLimit() + + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 100. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return int|null + */ + public function getLimitUnwrapped() + { + return $this->readWrapperValue("limit"); + } + + /** + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 100. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setLimit($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->limit = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Required. The number of nearest neighbors to return. Must be a positive + * integer of no more than 100. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int|null $var + * @return $this + */ + public function setLimitUnwrapped($var) + { + $this->writeWrapperValue("limit", $var); + return $this;} + + /** + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [entity + * property][google.datastore.v1.Entity.properties] limitations. + * + * Generated from protobuf field string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDistanceResultProperty() + { + return $this->distance_result_property; + } + + /** + * Optional. Optional name of the field to output the result of the vector + * distance calculation. Must conform to [entity + * property][google.datastore.v1.Entity.properties] limitations. + * + * Generated from protobuf field string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDistanceResultProperty($var) + { + GPBUtil::checkString($var, True); + $this->distance_result_property = $var; + + return $this; + } + + /** + * Optional. Option to specify a threshold for which no less similar documents + * will be returned. The behavior of the specified `distance_measure` will + * affect the meaning of the distance threshold. Since DOT_PRODUCT distances + * increase when the vectors are more similar, the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\DoubleValue|null + */ + public function getDistanceThreshold() + { + return $this->distance_threshold; + } + + public function hasDistanceThreshold() + { + return isset($this->distance_threshold); + } + + public function clearDistanceThreshold() + { + unset($this->distance_threshold); + } + + /** + * Returns the unboxed value from getDistanceThreshold() + + * Optional. Option to specify a threshold for which no less similar documents + * will be returned. The behavior of the specified `distance_measure` will + * affect the meaning of the distance threshold. Since DOT_PRODUCT distances + * increase when the vectors are more similar, the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return float|null + */ + public function getDistanceThresholdUnwrapped() + { + return $this->readWrapperValue("distance_threshold"); + } + + /** + * Optional. Option to specify a threshold for which no less similar documents + * will be returned. The behavior of the specified `distance_measure` will + * affect the meaning of the distance threshold. Since DOT_PRODUCT distances + * increase when the vectors are more similar, the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\DoubleValue $var + * @return $this + */ + public function setDistanceThreshold($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\DoubleValue::class); + $this->distance_threshold = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\DoubleValue object. + + * Optional. Option to specify a threshold for which no less similar documents + * will be returned. The behavior of the specified `distance_measure` will + * affect the meaning of the distance threshold. Since DOT_PRODUCT distances + * increase when the vectors are more similar, the comparison is inverted. + * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold + * For DOT_PRODUCT: WHERE distance >= distance_threshold + * + * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param float|null $var + * @return $this + */ + public function setDistanceThresholdUnwrapped($var) + { + $this->writeWrapperValue("distance_threshold", $var); + return $this;} + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/FindNearest/DistanceMeasure.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/FindNearest/DistanceMeasure.php new file mode 100644 index 000000000000..5eb0ccc00196 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/FindNearest/DistanceMeasure.php @@ -0,0 +1,82 @@ +google.datastore.v1.FindNearest.DistanceMeasure + */ +class DistanceMeasure +{ + /** + * Should not be set. + * + * Generated from protobuf enum DISTANCE_MEASURE_UNSPECIFIED = 0; + */ + const DISTANCE_MEASURE_UNSPECIFIED = 0; + /** + * Measures the EUCLIDEAN distance between the vectors. See + * [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn + * more. The resulting distance decreases the more similar two vectors are. + * + * Generated from protobuf enum EUCLIDEAN = 1; + */ + const EUCLIDEAN = 1; + /** + * COSINE distance compares vectors based on the angle between them, which + * allows you to measure similarity that isn't based on the vectors + * magnitude. We recommend using DOT_PRODUCT with unit normalized vectors + * instead of COSINE distance, which is mathematically equivalent with + * better performance. See [Cosine + * Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) to learn + * more about COSINE similarity and COSINE distance. The resulting COSINE + * distance decreases the more similar two vectors are. + * + * Generated from protobuf enum COSINE = 2; + */ + const COSINE = 2; + /** + * Similar to cosine but is affected by the magnitude of the vectors. See + * [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to learn more. + * The resulting distance increases the more similar two vectors are. + * + * Generated from protobuf enum DOT_PRODUCT = 3; + */ + const DOT_PRODUCT = 3; + + private static $valueToName = [ + self::DISTANCE_MEASURE_UNSPECIFIED => 'DISTANCE_MEASURE_UNSPECIFIED', + self::EUCLIDEAN => 'EUCLIDEAN', + self::COSINE => 'COSINE', + self::DOT_PRODUCT => 'DOT_PRODUCT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DistanceMeasure::class, \Google\Cloud\Datastore\V1\FindNearest_DistanceMeasure::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQuery.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQuery.php new file mode 100644 index 000000000000..ba0e57d29944 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQuery.php @@ -0,0 +1,210 @@ +google.datastore.v1.GqlQuery + */ +class GqlQuery extends \Google\Protobuf\Internal\Message +{ + /** + * A string of the format described + * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + * + * Generated from protobuf field string query_string = 1; + */ + protected $query_string = ''; + /** + * When false, the query string must not contain any literals and instead must + * bind all values. For example, + * `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while + * `SELECT * FROM Kind WHERE a = @value` is. + * + * Generated from protobuf field bool allow_literals = 2; + */ + protected $allow_literals = false; + /** + * For each non-reserved named binding site in the query string, there must be + * a named parameter with that name, but not necessarily the inverse. + * Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex + * `__.*__`, and must not be `""`. + * + * Generated from protobuf field map named_bindings = 5; + */ + private $named_bindings; + /** + * Numbered binding site @1 references the first numbered parameter, + * effectively using 1-based indexing, rather than the usual 0. + * For each binding site numbered i in `query_string`, there must be an i-th + * numbered parameter. The inverse must also be true. + * + * Generated from protobuf field repeated .google.datastore.v1.GqlQueryParameter positional_bindings = 4; + */ + private $positional_bindings; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $query_string + * A string of the format described + * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + * @type bool $allow_literals + * When false, the query string must not contain any literals and instead must + * bind all values. For example, + * `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while + * `SELECT * FROM Kind WHERE a = @value` is. + * @type array|\Google\Protobuf\Internal\MapField $named_bindings + * For each non-reserved named binding site in the query string, there must be + * a named parameter with that name, but not necessarily the inverse. + * Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex + * `__.*__`, and must not be `""`. + * @type array<\Google\Cloud\Datastore\V1\GqlQueryParameter>|\Google\Protobuf\Internal\RepeatedField $positional_bindings + * Numbered binding site @1 references the first numbered parameter, + * effectively using 1-based indexing, rather than the usual 0. + * For each binding site numbered i in `query_string`, there must be an i-th + * numbered parameter. The inverse must also be true. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * A string of the format described + * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + * + * Generated from protobuf field string query_string = 1; + * @return string + */ + public function getQueryString() + { + return $this->query_string; + } + + /** + * A string of the format described + * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + * + * Generated from protobuf field string query_string = 1; + * @param string $var + * @return $this + */ + public function setQueryString($var) + { + GPBUtil::checkString($var, True); + $this->query_string = $var; + + return $this; + } + + /** + * When false, the query string must not contain any literals and instead must + * bind all values. For example, + * `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while + * `SELECT * FROM Kind WHERE a = @value` is. + * + * Generated from protobuf field bool allow_literals = 2; + * @return bool + */ + public function getAllowLiterals() + { + return $this->allow_literals; + } + + /** + * When false, the query string must not contain any literals and instead must + * bind all values. For example, + * `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while + * `SELECT * FROM Kind WHERE a = @value` is. + * + * Generated from protobuf field bool allow_literals = 2; + * @param bool $var + * @return $this + */ + public function setAllowLiterals($var) + { + GPBUtil::checkBool($var); + $this->allow_literals = $var; + + return $this; + } + + /** + * For each non-reserved named binding site in the query string, there must be + * a named parameter with that name, but not necessarily the inverse. + * Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex + * `__.*__`, and must not be `""`. + * + * Generated from protobuf field map named_bindings = 5; + * @return \Google\Protobuf\Internal\MapField + */ + public function getNamedBindings() + { + return $this->named_bindings; + } + + /** + * For each non-reserved named binding site in the query string, there must be + * a named parameter with that name, but not necessarily the inverse. + * Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex + * `__.*__`, and must not be `""`. + * + * Generated from protobuf field map named_bindings = 5; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setNamedBindings($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\GqlQueryParameter::class); + $this->named_bindings = $arr; + + return $this; + } + + /** + * Numbered binding site @1 references the first numbered parameter, + * effectively using 1-based indexing, rather than the usual 0. + * For each binding site numbered i in `query_string`, there must be an i-th + * numbered parameter. The inverse must also be true. + * + * Generated from protobuf field repeated .google.datastore.v1.GqlQueryParameter positional_bindings = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPositionalBindings() + { + return $this->positional_bindings; + } + + /** + * Numbered binding site @1 references the first numbered parameter, + * effectively using 1-based indexing, rather than the usual 0. + * For each binding site numbered i in `query_string`, there must be an i-th + * numbered parameter. The inverse must also be true. + * + * Generated from protobuf field repeated .google.datastore.v1.GqlQueryParameter positional_bindings = 4; + * @param array<\Google\Cloud\Datastore\V1\GqlQueryParameter>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPositionalBindings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\GqlQueryParameter::class); + $this->positional_bindings = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQueryParameter.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQueryParameter.php new file mode 100644 index 000000000000..c180d0429d80 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQueryParameter.php @@ -0,0 +1,111 @@ +google.datastore.v1.GqlQueryParameter + */ +class GqlQueryParameter extends \Google\Protobuf\Internal\Message +{ + protected $parameter_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\Value $value + * A value parameter. + * @type string $cursor + * A query cursor. Query cursors are returned in query + * result batches. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * A value parameter. + * + * Generated from protobuf field .google.datastore.v1.Value value = 2; + * @return \Google\Cloud\Datastore\V1\Value|null + */ + public function getValue() + { + return $this->readOneof(2); + } + + public function hasValue() + { + return $this->hasOneof(2); + } + + /** + * A value parameter. + * + * Generated from protobuf field .google.datastore.v1.Value value = 2; + * @param \Google\Cloud\Datastore\V1\Value $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A query cursor. Query cursors are returned in query + * result batches. + * + * Generated from protobuf field bytes cursor = 3; + * @return string + */ + public function getCursor() + { + return $this->readOneof(3); + } + + public function hasCursor() + { + return $this->hasOneof(3); + } + + /** + * A query cursor. Query cursors are returned in query + * result batches. + * + * Generated from protobuf field bytes cursor = 3; + * @param string $var + * @return $this + */ + public function setCursor($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getParameterType() + { + return $this->whichOneof("parameter_type"); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key.php new file mode 100644 index 000000000000..a399e216a16d --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key.php @@ -0,0 +1,174 @@ +google.datastore.v1.Key + */ +class Key extends \Google\Protobuf\Internal\Message +{ + /** + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. + * Queries are scoped to a single partition. + * + * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 1; + */ + protected $partition_id = null; + /** + * The entity path. + * An entity path consists of one or more elements composed of a kind and a + * string or numerical identifier, which identify entities. The first + * element identifies a _root entity_, the second element identifies + * a _child_ of the root entity, the third element identifies a child of the + * second entity, and so forth. The entities identified by all prefixes of + * the path are called the element's _ancestors_. + * An entity path is always fully complete: *all* of the entity's ancestors + * are required to be in the path along with the entity identifier itself. + * The only exception is that in some documented cases, the identifier in the + * last path element (for the entity) itself may be omitted. For example, + * the last path element of the key of `Mutation.insert` may have no + * identifier. + * A path can never be empty, and a path can have at most 100 elements. + * + * Generated from protobuf field repeated .google.datastore.v1.Key.PathElement path = 2; + */ + private $path; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\PartitionId $partition_id + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. + * Queries are scoped to a single partition. + * @type array<\Google\Cloud\Datastore\V1\Key\PathElement>|\Google\Protobuf\Internal\RepeatedField $path + * The entity path. + * An entity path consists of one or more elements composed of a kind and a + * string or numerical identifier, which identify entities. The first + * element identifies a _root entity_, the second element identifies + * a _child_ of the root entity, the third element identifies a child of the + * second entity, and so forth. The entities identified by all prefixes of + * the path are called the element's _ancestors_. + * An entity path is always fully complete: *all* of the entity's ancestors + * are required to be in the path along with the entity identifier itself. + * The only exception is that in some documented cases, the identifier in the + * last path element (for the entity) itself may be omitted. For example, + * the last path element of the key of `Mutation.insert` may have no + * identifier. + * A path can never be empty, and a path can have at most 100 elements. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Entity::initOnce(); + parent::__construct($data); + } + + /** + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. + * Queries are scoped to a single partition. + * + * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 1; + * @return \Google\Cloud\Datastore\V1\PartitionId|null + */ + public function getPartitionId() + { + return $this->partition_id; + } + + public function hasPartitionId() + { + return isset($this->partition_id); + } + + public function clearPartitionId() + { + unset($this->partition_id); + } + + /** + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. + * Queries are scoped to a single partition. + * + * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 1; + * @param \Google\Cloud\Datastore\V1\PartitionId $var + * @return $this + */ + public function setPartitionId($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PartitionId::class); + $this->partition_id = $var; + + return $this; + } + + /** + * The entity path. + * An entity path consists of one or more elements composed of a kind and a + * string or numerical identifier, which identify entities. The first + * element identifies a _root entity_, the second element identifies + * a _child_ of the root entity, the third element identifies a child of the + * second entity, and so forth. The entities identified by all prefixes of + * the path are called the element's _ancestors_. + * An entity path is always fully complete: *all* of the entity's ancestors + * are required to be in the path along with the entity identifier itself. + * The only exception is that in some documented cases, the identifier in the + * last path element (for the entity) itself may be omitted. For example, + * the last path element of the key of `Mutation.insert` may have no + * identifier. + * A path can never be empty, and a path can have at most 100 elements. + * + * Generated from protobuf field repeated .google.datastore.v1.Key.PathElement path = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPath() + { + return $this->path; + } + + /** + * The entity path. + * An entity path consists of one or more elements composed of a kind and a + * string or numerical identifier, which identify entities. The first + * element identifies a _root entity_, the second element identifies + * a _child_ of the root entity, the third element identifies a child of the + * second entity, and so forth. The entities identified by all prefixes of + * the path are called the element's _ancestors_. + * An entity path is always fully complete: *all* of the entity's ancestors + * are required to be in the path along with the entity identifier itself. + * The only exception is that in some documented cases, the identifier in the + * last path element (for the entity) itself may be omitted. For example, + * the last path element of the key of `Mutation.insert` may have no + * identifier. + * A path can never be empty, and a path can have at most 100 elements. + * + * Generated from protobuf field repeated .google.datastore.v1.Key.PathElement path = 2; + * @param array<\Google\Cloud\Datastore\V1\Key\PathElement>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPath($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Key\PathElement::class); + $this->path = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key/PathElement.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key/PathElement.php new file mode 100644 index 000000000000..df942e9128e1 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key/PathElement.php @@ -0,0 +1,195 @@ +google.datastore.v1.Key.PathElement + */ +class PathElement extends \Google\Protobuf\Internal\Message +{ + /** + * The kind of the entity. + * A kind matching regex `__.*__` is reserved/read-only. + * A kind must not contain more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes__` where `` is the base-64 encoding of the + * bytes. + * + * Generated from protobuf field string kind = 1; + */ + protected $kind = ''; + protected $id_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kind + * The kind of the entity. + * A kind matching regex `__.*__` is reserved/read-only. + * A kind must not contain more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes__` where `` is the base-64 encoding of the + * bytes. + * @type int|string $id + * The auto-allocated ID of the entity. + * Never equal to zero. Values less than zero are discouraged and may not + * be supported in the future. + * @type string $name + * The name of the entity. + * A name matching regex `__.*__` is reserved/read-only. + * A name must not be more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes__` where `` is the base-64 encoding of the + * bytes. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Entity::initOnce(); + parent::__construct($data); + } + + /** + * The kind of the entity. + * A kind matching regex `__.*__` is reserved/read-only. + * A kind must not contain more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes__` where `` is the base-64 encoding of the + * bytes. + * + * Generated from protobuf field string kind = 1; + * @return string + */ + public function getKind() + { + return $this->kind; + } + + /** + * The kind of the entity. + * A kind matching regex `__.*__` is reserved/read-only. + * A kind must not contain more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes__` where `` is the base-64 encoding of the + * bytes. + * + * Generated from protobuf field string kind = 1; + * @param string $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkString($var, True); + $this->kind = $var; + + return $this; + } + + /** + * The auto-allocated ID of the entity. + * Never equal to zero. Values less than zero are discouraged and may not + * be supported in the future. + * + * Generated from protobuf field int64 id = 2; + * @return int|string + */ + public function getId() + { + return $this->readOneof(2); + } + + public function hasId() + { + return $this->hasOneof(2); + } + + /** + * The auto-allocated ID of the entity. + * Never equal to zero. Values less than zero are discouraged and may not + * be supported in the future. + * + * Generated from protobuf field int64 id = 2; + * @param int|string $var + * @return $this + */ + public function setId($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * The name of the entity. + * A name matching regex `__.*__` is reserved/read-only. + * A name must not be more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes__` where `` is the base-64 encoding of the + * bytes. + * + * Generated from protobuf field string name = 3; + * @return string + */ + public function getName() + { + return $this->readOneof(3); + } + + public function hasName() + { + return $this->hasOneof(3); + } + + /** + * The name of the entity. + * A name matching regex `__.*__` is reserved/read-only. + * A name must not be more than 1500 bytes when UTF-8 encoded. + * Cannot be `""`. + * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are + * encoded as `__bytes__` where `` is the base-64 encoding of the + * bytes. + * + * Generated from protobuf field string name = 3; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getIdType() + { + return $this->whichOneof("id_type"); + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PathElement::class, \Google\Cloud\Datastore\V1\Key_PathElement::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/KindExpression.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/KindExpression.php new file mode 100644 index 000000000000..be49b78b627c --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/KindExpression.php @@ -0,0 +1,67 @@ +google.datastore.v1.KindExpression + */ +class KindExpression extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the kind. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the kind. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The name of the kind. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the kind. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupRequest.php new file mode 100644 index 000000000000..de73e6c97ef1 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupRequest.php @@ -0,0 +1,260 @@ +google.datastore.v1.LookupRequest + */ +class LookupRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + */ + protected $database_id = ''; + /** + * The options for this lookup request. + * + * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; + */ + protected $read_options = null; + /** + * Required. Keys of entities to look up. + * + * Generated from protobuf field repeated .google.datastore.v1.Key keys = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + private $keys; + /** + * The properties to return. Defaults to returning all properties. + * If this field is set and an entity has a property not referenced in the + * mask, it will be absent from [LookupResponse.found.entity.properties][]. + * The entity's key is always returned. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 5; + */ + protected $property_mask = null; + + /** + * @param string $projectId Required. The ID of the project against which to make the request. + * @param \Google\Cloud\Datastore\V1\ReadOptions $readOptions The options for this lookup request. + * @param \Google\Cloud\Datastore\V1\Key[] $keys Required. Keys of entities to look up. + * + * @return \Google\Cloud\Datastore\V1\LookupRequest + * + * @experimental + */ + public static function build(string $projectId, \Google\Cloud\Datastore\V1\ReadOptions $readOptions, array $keys): self + { + return (new self()) + ->setProjectId($projectId) + ->setReadOptions($readOptions) + ->setKeys($keys); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. The ID of the project against which to make the request. + * @type string $database_id + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type \Google\Cloud\Datastore\V1\ReadOptions $read_options + * The options for this lookup request. + * @type array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $keys + * Required. Keys of entities to look up. + * @type \Google\Cloud\Datastore\V1\PropertyMask $property_mask + * The properties to return. Defaults to returning all properties. + * If this field is set and an entity has a property not referenced in the + * mask, it will be absent from [LookupResponse.found.entity.properties][]. + * The entity's key is always returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @return string + */ + public function getDatabaseId() + { + return $this->database_id; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @param string $var + * @return $this + */ + public function setDatabaseId($var) + { + GPBUtil::checkString($var, True); + $this->database_id = $var; + + return $this; + } + + /** + * The options for this lookup request. + * + * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; + * @return \Google\Cloud\Datastore\V1\ReadOptions|null + */ + public function getReadOptions() + { + return $this->read_options; + } + + public function hasReadOptions() + { + return isset($this->read_options); + } + + public function clearReadOptions() + { + unset($this->read_options); + } + + /** + * The options for this lookup request. + * + * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; + * @param \Google\Cloud\Datastore\V1\ReadOptions $var + * @return $this + */ + public function setReadOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ReadOptions::class); + $this->read_options = $var; + + return $this; + } + + /** + * Required. Keys of entities to look up. + * + * Generated from protobuf field repeated .google.datastore.v1.Key keys = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKeys() + { + return $this->keys; + } + + /** + * Required. Keys of entities to look up. + * + * Generated from protobuf field repeated .google.datastore.v1.Key keys = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Key::class); + $this->keys = $arr; + + return $this; + } + + /** + * The properties to return. Defaults to returning all properties. + * If this field is set and an entity has a property not referenced in the + * mask, it will be absent from [LookupResponse.found.entity.properties][]. + * The entity's key is always returned. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 5; + * @return \Google\Cloud\Datastore\V1\PropertyMask|null + */ + public function getPropertyMask() + { + return $this->property_mask; + } + + public function hasPropertyMask() + { + return isset($this->property_mask); + } + + public function clearPropertyMask() + { + unset($this->property_mask); + } + + /** + * The properties to return. Defaults to returning all properties. + * If this field is set and an entity has a property not referenced in the + * mask, it will be absent from [LookupResponse.found.entity.properties][]. + * The entity's key is always returned. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 5; + * @param \Google\Cloud\Datastore\V1\PropertyMask $var + * @return $this + */ + public function setPropertyMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyMask::class); + $this->property_mask = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupResponse.php new file mode 100644 index 000000000000..e33d8a7f8742 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupResponse.php @@ -0,0 +1,257 @@ +google.datastore.v1.LookupResponse + */ +class LookupResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Entities found as `ResultType.FULL` entities. The order of results in this + * field is undefined and has no relation to the order of the keys in the + * input. + * + * Generated from protobuf field repeated .google.datastore.v1.EntityResult found = 1; + */ + private $found; + /** + * Entities not found as `ResultType.KEY_ONLY` entities. The order of results + * in this field is undefined and has no relation to the order of the keys + * in the input. + * + * Generated from protobuf field repeated .google.datastore.v1.EntityResult missing = 2; + */ + private $missing; + /** + * A list of keys that were not looked up due to resource constraints. The + * order of results in this field is undefined and has no relation to the + * order of the keys in the input. + * + * Generated from protobuf field repeated .google.datastore.v1.Key deferred = 3; + */ + private $deferred; + /** + * The identifier of the transaction that was started as part of this Lookup + * request. + * Set only when + * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] + * was set in + * [LookupRequest.read_options][google.datastore.v1.LookupRequest.read_options]. + * + * Generated from protobuf field bytes transaction = 5; + */ + protected $transaction = ''; + /** + * The time at which these entities were read or found missing. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; + */ + protected $read_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Datastore\V1\EntityResult>|\Google\Protobuf\Internal\RepeatedField $found + * Entities found as `ResultType.FULL` entities. The order of results in this + * field is undefined and has no relation to the order of the keys in the + * input. + * @type array<\Google\Cloud\Datastore\V1\EntityResult>|\Google\Protobuf\Internal\RepeatedField $missing + * Entities not found as `ResultType.KEY_ONLY` entities. The order of results + * in this field is undefined and has no relation to the order of the keys + * in the input. + * @type array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $deferred + * A list of keys that were not looked up due to resource constraints. The + * order of results in this field is undefined and has no relation to the + * order of the keys in the input. + * @type string $transaction + * The identifier of the transaction that was started as part of this Lookup + * request. + * Set only when + * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] + * was set in + * [LookupRequest.read_options][google.datastore.v1.LookupRequest.read_options]. + * @type \Google\Protobuf\Timestamp $read_time + * The time at which these entities were read or found missing. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * Entities found as `ResultType.FULL` entities. The order of results in this + * field is undefined and has no relation to the order of the keys in the + * input. + * + * Generated from protobuf field repeated .google.datastore.v1.EntityResult found = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFound() + { + return $this->found; + } + + /** + * Entities found as `ResultType.FULL` entities. The order of results in this + * field is undefined and has no relation to the order of the keys in the + * input. + * + * Generated from protobuf field repeated .google.datastore.v1.EntityResult found = 1; + * @param array<\Google\Cloud\Datastore\V1\EntityResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFound($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\EntityResult::class); + $this->found = $arr; + + return $this; + } + + /** + * Entities not found as `ResultType.KEY_ONLY` entities. The order of results + * in this field is undefined and has no relation to the order of the keys + * in the input. + * + * Generated from protobuf field repeated .google.datastore.v1.EntityResult missing = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMissing() + { + return $this->missing; + } + + /** + * Entities not found as `ResultType.KEY_ONLY` entities. The order of results + * in this field is undefined and has no relation to the order of the keys + * in the input. + * + * Generated from protobuf field repeated .google.datastore.v1.EntityResult missing = 2; + * @param array<\Google\Cloud\Datastore\V1\EntityResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMissing($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\EntityResult::class); + $this->missing = $arr; + + return $this; + } + + /** + * A list of keys that were not looked up due to resource constraints. The + * order of results in this field is undefined and has no relation to the + * order of the keys in the input. + * + * Generated from protobuf field repeated .google.datastore.v1.Key deferred = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDeferred() + { + return $this->deferred; + } + + /** + * A list of keys that were not looked up due to resource constraints. The + * order of results in this field is undefined and has no relation to the + * order of the keys in the input. + * + * Generated from protobuf field repeated .google.datastore.v1.Key deferred = 3; + * @param array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDeferred($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Key::class); + $this->deferred = $arr; + + return $this; + } + + /** + * The identifier of the transaction that was started as part of this Lookup + * request. + * Set only when + * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] + * was set in + * [LookupRequest.read_options][google.datastore.v1.LookupRequest.read_options]. + * + * Generated from protobuf field bytes transaction = 5; + * @return string + */ + public function getTransaction() + { + return $this->transaction; + } + + /** + * The identifier of the transaction that was started as part of this Lookup + * request. + * Set only when + * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] + * was set in + * [LookupRequest.read_options][google.datastore.v1.LookupRequest.read_options]. + * + * Generated from protobuf field bytes transaction = 5; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->transaction = $var; + + return $this; + } + + /** + * The time at which these entities were read or found missing. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * The time at which these entities were read or found missing. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation.php new file mode 100644 index 000000000000..8721321c562a --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation.php @@ -0,0 +1,429 @@ +google.datastore.v1.Mutation + */ +class Mutation extends \Google\Protobuf\Internal\Message +{ + /** + * The strategy to use when a conflict is detected. Defaults to + * `SERVER_VALUE`. + * If this is set, then `conflict_detection_strategy` must also be set. + * + * Generated from protobuf field .google.datastore.v1.Mutation.ConflictResolutionStrategy conflict_resolution_strategy = 10; + */ + protected $conflict_resolution_strategy = 0; + /** + * The properties to write in this mutation. + * None of the properties in the mask may have a reserved name, except for + * `__key__`. + * This field is ignored for `delete`. + * If the entity already exists, only properties referenced in the mask are + * updated, others are left untouched. + * Properties referenced in the mask but not in the entity are deleted. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 9; + */ + protected $property_mask = null; + /** + * Optional. The transforms to perform on the entity. + * This field can be set only when the operation is `insert`, `update`, + * or `upsert`. If present, the transforms are be applied to the entity + * regardless of the property mask, in order, after the operation. + * + * Generated from protobuf field repeated .google.datastore.v1.PropertyTransform property_transforms = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $property_transforms; + protected $operation; + protected $conflict_detection_strategy; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\Entity $insert + * The entity to insert. The entity must not already exist. + * The entity key's final path element may be incomplete. + * @type \Google\Cloud\Datastore\V1\Entity $update + * The entity to update. The entity must already exist. + * Must have a complete key path. + * @type \Google\Cloud\Datastore\V1\Entity $upsert + * The entity to upsert. The entity may or may not already exist. + * The entity key's final path element may be incomplete. + * @type \Google\Cloud\Datastore\V1\Key $delete + * The key of the entity to delete. The entity may or may not already exist. + * Must have a complete key path and must not be reserved/read-only. + * @type int|string $base_version + * The version of the entity that this mutation is being applied + * to. If this does not match the current version on the server, the + * mutation conflicts. + * @type \Google\Protobuf\Timestamp $update_time + * The update time of the entity that this mutation is being applied + * to. If this does not match the current update time on the server, the + * mutation conflicts. + * @type int $conflict_resolution_strategy + * The strategy to use when a conflict is detected. Defaults to + * `SERVER_VALUE`. + * If this is set, then `conflict_detection_strategy` must also be set. + * @type \Google\Cloud\Datastore\V1\PropertyMask $property_mask + * The properties to write in this mutation. + * None of the properties in the mask may have a reserved name, except for + * `__key__`. + * This field is ignored for `delete`. + * If the entity already exists, only properties referenced in the mask are + * updated, others are left untouched. + * Properties referenced in the mask but not in the entity are deleted. + * @type array<\Google\Cloud\Datastore\V1\PropertyTransform>|\Google\Protobuf\Internal\RepeatedField $property_transforms + * Optional. The transforms to perform on the entity. + * This field can be set only when the operation is `insert`, `update`, + * or `upsert`. If present, the transforms are be applied to the entity + * regardless of the property mask, in order, after the operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * The entity to insert. The entity must not already exist. + * The entity key's final path element may be incomplete. + * + * Generated from protobuf field .google.datastore.v1.Entity insert = 4; + * @return \Google\Cloud\Datastore\V1\Entity|null + */ + public function getInsert() + { + return $this->readOneof(4); + } + + public function hasInsert() + { + return $this->hasOneof(4); + } + + /** + * The entity to insert. The entity must not already exist. + * The entity key's final path element may be incomplete. + * + * Generated from protobuf field .google.datastore.v1.Entity insert = 4; + * @param \Google\Cloud\Datastore\V1\Entity $var + * @return $this + */ + public function setInsert($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Entity::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * The entity to update. The entity must already exist. + * Must have a complete key path. + * + * Generated from protobuf field .google.datastore.v1.Entity update = 5; + * @return \Google\Cloud\Datastore\V1\Entity|null + */ + public function getUpdate() + { + return $this->readOneof(5); + } + + public function hasUpdate() + { + return $this->hasOneof(5); + } + + /** + * The entity to update. The entity must already exist. + * Must have a complete key path. + * + * Generated from protobuf field .google.datastore.v1.Entity update = 5; + * @param \Google\Cloud\Datastore\V1\Entity $var + * @return $this + */ + public function setUpdate($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Entity::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * The entity to upsert. The entity may or may not already exist. + * The entity key's final path element may be incomplete. + * + * Generated from protobuf field .google.datastore.v1.Entity upsert = 6; + * @return \Google\Cloud\Datastore\V1\Entity|null + */ + public function getUpsert() + { + return $this->readOneof(6); + } + + public function hasUpsert() + { + return $this->hasOneof(6); + } + + /** + * The entity to upsert. The entity may or may not already exist. + * The entity key's final path element may be incomplete. + * + * Generated from protobuf field .google.datastore.v1.Entity upsert = 6; + * @param \Google\Cloud\Datastore\V1\Entity $var + * @return $this + */ + public function setUpsert($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Entity::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The key of the entity to delete. The entity may or may not already exist. + * Must have a complete key path and must not be reserved/read-only. + * + * Generated from protobuf field .google.datastore.v1.Key delete = 7; + * @return \Google\Cloud\Datastore\V1\Key|null + */ + public function getDelete() + { + return $this->readOneof(7); + } + + public function hasDelete() + { + return $this->hasOneof(7); + } + + /** + * The key of the entity to delete. The entity may or may not already exist. + * Must have a complete key path and must not be reserved/read-only. + * + * Generated from protobuf field .google.datastore.v1.Key delete = 7; + * @param \Google\Cloud\Datastore\V1\Key $var + * @return $this + */ + public function setDelete($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Key::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * The version of the entity that this mutation is being applied + * to. If this does not match the current version on the server, the + * mutation conflicts. + * + * Generated from protobuf field int64 base_version = 8; + * @return int|string + */ + public function getBaseVersion() + { + return $this->readOneof(8); + } + + public function hasBaseVersion() + { + return $this->hasOneof(8); + } + + /** + * The version of the entity that this mutation is being applied + * to. If this does not match the current version on the server, the + * mutation conflicts. + * + * Generated from protobuf field int64 base_version = 8; + * @param int|string $var + * @return $this + */ + public function setBaseVersion($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * The update time of the entity that this mutation is being applied + * to. If this does not match the current update time on the server, the + * mutation conflicts. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->readOneof(11); + } + + public function hasUpdateTime() + { + return $this->hasOneof(11); + } + + /** + * The update time of the entity that this mutation is being applied + * to. If this does not match the current update time on the server, the + * mutation conflicts. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * The strategy to use when a conflict is detected. Defaults to + * `SERVER_VALUE`. + * If this is set, then `conflict_detection_strategy` must also be set. + * + * Generated from protobuf field .google.datastore.v1.Mutation.ConflictResolutionStrategy conflict_resolution_strategy = 10; + * @return int + */ + public function getConflictResolutionStrategy() + { + return $this->conflict_resolution_strategy; + } + + /** + * The strategy to use when a conflict is detected. Defaults to + * `SERVER_VALUE`. + * If this is set, then `conflict_detection_strategy` must also be set. + * + * Generated from protobuf field .google.datastore.v1.Mutation.ConflictResolutionStrategy conflict_resolution_strategy = 10; + * @param int $var + * @return $this + */ + public function setConflictResolutionStrategy($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\Mutation\ConflictResolutionStrategy::class); + $this->conflict_resolution_strategy = $var; + + return $this; + } + + /** + * The properties to write in this mutation. + * None of the properties in the mask may have a reserved name, except for + * `__key__`. + * This field is ignored for `delete`. + * If the entity already exists, only properties referenced in the mask are + * updated, others are left untouched. + * Properties referenced in the mask but not in the entity are deleted. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 9; + * @return \Google\Cloud\Datastore\V1\PropertyMask|null + */ + public function getPropertyMask() + { + return $this->property_mask; + } + + public function hasPropertyMask() + { + return isset($this->property_mask); + } + + public function clearPropertyMask() + { + unset($this->property_mask); + } + + /** + * The properties to write in this mutation. + * None of the properties in the mask may have a reserved name, except for + * `__key__`. + * This field is ignored for `delete`. + * If the entity already exists, only properties referenced in the mask are + * updated, others are left untouched. + * Properties referenced in the mask but not in the entity are deleted. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 9; + * @param \Google\Cloud\Datastore\V1\PropertyMask $var + * @return $this + */ + public function setPropertyMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyMask::class); + $this->property_mask = $var; + + return $this; + } + + /** + * Optional. The transforms to perform on the entity. + * This field can be set only when the operation is `insert`, `update`, + * or `upsert`. If present, the transforms are be applied to the entity + * regardless of the property mask, in order, after the operation. + * + * Generated from protobuf field repeated .google.datastore.v1.PropertyTransform property_transforms = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPropertyTransforms() + { + return $this->property_transforms; + } + + /** + * Optional. The transforms to perform on the entity. + * This field can be set only when the operation is `insert`, `update`, + * or `upsert`. If present, the transforms are be applied to the entity + * regardless of the property mask, in order, after the operation. + * + * Generated from protobuf field repeated .google.datastore.v1.PropertyTransform property_transforms = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\Datastore\V1\PropertyTransform>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPropertyTransforms($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\PropertyTransform::class); + $this->property_transforms = $arr; + + return $this; + } + + /** + * @return string + */ + public function getOperation() + { + return $this->whichOneof("operation"); + } + + /** + * @return string + */ + public function getConflictDetectionStrategy() + { + return $this->whichOneof("conflict_detection_strategy"); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation/ConflictResolutionStrategy.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation/ConflictResolutionStrategy.php new file mode 100644 index 000000000000..f2809890ebe1 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation/ConflictResolutionStrategy.php @@ -0,0 +1,64 @@ +google.datastore.v1.Mutation.ConflictResolutionStrategy + */ +class ConflictResolutionStrategy +{ + /** + * Unspecified. Defaults to `SERVER_VALUE`. + * + * Generated from protobuf enum STRATEGY_UNSPECIFIED = 0; + */ + const STRATEGY_UNSPECIFIED = 0; + /** + * The server entity is kept. + * + * Generated from protobuf enum SERVER_VALUE = 1; + */ + const SERVER_VALUE = 1; + /** + * The whole commit request fails. + * + * Generated from protobuf enum FAIL = 3; + */ + const FAIL = 3; + + private static $valueToName = [ + self::STRATEGY_UNSPECIFIED => 'STRATEGY_UNSPECIFIED', + self::SERVER_VALUE => 'SERVER_VALUE', + self::FAIL => 'FAIL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ConflictResolutionStrategy::class, \Google\Cloud\Datastore\V1\Mutation_ConflictResolutionStrategy::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/MutationResult.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/MutationResult.php new file mode 100644 index 000000000000..8dad8eba89fa --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/MutationResult.php @@ -0,0 +1,311 @@ +google.datastore.v1.MutationResult + */ +class MutationResult extends \Google\Protobuf\Internal\Message +{ + /** + * The automatically allocated key. + * Set only when the mutation allocated a key. + * + * Generated from protobuf field .google.datastore.v1.Key key = 3; + */ + protected $key = null; + /** + * The version of the entity on the server after processing the mutation. If + * the mutation doesn't change anything on the server, then the version will + * be the version of the current entity or, if no entity is present, a version + * that is strictly greater than the version of any previous entity and less + * than the version of any possible future entity. + * + * Generated from protobuf field int64 version = 4; + */ + protected $version = 0; + /** + * The create time of the entity. This field will not be set after a 'delete'. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + */ + protected $create_time = null; + /** + * The update time of the entity on the server after processing the mutation. + * If the mutation doesn't change anything on the server, then the timestamp + * will be the update timestamp of the current entity. This field will not be + * set after a 'delete'. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; + */ + protected $update_time = null; + /** + * Whether a conflict was detected for this mutation. Always false when a + * conflict detection strategy field is not set in the mutation. + * + * Generated from protobuf field bool conflict_detected = 5; + */ + protected $conflict_detected = false; + /** + * The results of applying each + * [PropertyTransform][google.datastore.v1.PropertyTransform], in the same + * order of the request. + * + * Generated from protobuf field repeated .google.datastore.v1.Value transform_results = 8; + */ + private $transform_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\Key $key + * The automatically allocated key. + * Set only when the mutation allocated a key. + * @type int|string $version + * The version of the entity on the server after processing the mutation. If + * the mutation doesn't change anything on the server, then the version will + * be the version of the current entity or, if no entity is present, a version + * that is strictly greater than the version of any previous entity and less + * than the version of any possible future entity. + * @type \Google\Protobuf\Timestamp $create_time + * The create time of the entity. This field will not be set after a 'delete'. + * @type \Google\Protobuf\Timestamp $update_time + * The update time of the entity on the server after processing the mutation. + * If the mutation doesn't change anything on the server, then the timestamp + * will be the update timestamp of the current entity. This field will not be + * set after a 'delete'. + * @type bool $conflict_detected + * Whether a conflict was detected for this mutation. Always false when a + * conflict detection strategy field is not set in the mutation. + * @type array<\Google\Cloud\Datastore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $transform_results + * The results of applying each + * [PropertyTransform][google.datastore.v1.PropertyTransform], in the same + * order of the request. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * The automatically allocated key. + * Set only when the mutation allocated a key. + * + * Generated from protobuf field .google.datastore.v1.Key key = 3; + * @return \Google\Cloud\Datastore\V1\Key|null + */ + public function getKey() + { + return $this->key; + } + + public function hasKey() + { + return isset($this->key); + } + + public function clearKey() + { + unset($this->key); + } + + /** + * The automatically allocated key. + * Set only when the mutation allocated a key. + * + * Generated from protobuf field .google.datastore.v1.Key key = 3; + * @param \Google\Cloud\Datastore\V1\Key $var + * @return $this + */ + public function setKey($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Key::class); + $this->key = $var; + + return $this; + } + + /** + * The version of the entity on the server after processing the mutation. If + * the mutation doesn't change anything on the server, then the version will + * be the version of the current entity or, if no entity is present, a version + * that is strictly greater than the version of any previous entity and less + * than the version of any possible future entity. + * + * Generated from protobuf field int64 version = 4; + * @return int|string + */ + public function getVersion() + { + return $this->version; + } + + /** + * The version of the entity on the server after processing the mutation. If + * the mutation doesn't change anything on the server, then the version will + * be the version of the current entity or, if no entity is present, a version + * that is strictly greater than the version of any previous entity and less + * than the version of any possible future entity. + * + * Generated from protobuf field int64 version = 4; + * @param int|string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkInt64($var); + $this->version = $var; + + return $this; + } + + /** + * The create time of the entity. This field will not be set after a 'delete'. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * The create time of the entity. This field will not be set after a 'delete'. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * The update time of the entity on the server after processing the mutation. + * If the mutation doesn't change anything on the server, then the timestamp + * will be the update timestamp of the current entity. This field will not be + * set after a 'delete'. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * The update time of the entity on the server after processing the mutation. + * If the mutation doesn't change anything on the server, then the timestamp + * will be the update timestamp of the current entity. This field will not be + * set after a 'delete'. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Whether a conflict was detected for this mutation. Always false when a + * conflict detection strategy field is not set in the mutation. + * + * Generated from protobuf field bool conflict_detected = 5; + * @return bool + */ + public function getConflictDetected() + { + return $this->conflict_detected; + } + + /** + * Whether a conflict was detected for this mutation. Always false when a + * conflict detection strategy field is not set in the mutation. + * + * Generated from protobuf field bool conflict_detected = 5; + * @param bool $var + * @return $this + */ + public function setConflictDetected($var) + { + GPBUtil::checkBool($var); + $this->conflict_detected = $var; + + return $this; + } + + /** + * The results of applying each + * [PropertyTransform][google.datastore.v1.PropertyTransform], in the same + * order of the request. + * + * Generated from protobuf field repeated .google.datastore.v1.Value transform_results = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTransformResults() + { + return $this->transform_results; + } + + /** + * The results of applying each + * [PropertyTransform][google.datastore.v1.PropertyTransform], in the same + * order of the request. + * + * Generated from protobuf field repeated .google.datastore.v1.Value transform_results = 8; + * @param array<\Google\Cloud\Datastore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTransformResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Value::class); + $this->transform_results = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PartitionId.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PartitionId.php new file mode 100644 index 000000000000..c2f4e7864f4b --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PartitionId.php @@ -0,0 +1,154 @@ +google.datastore.v1.PartitionId + */ +class PartitionId extends \Google\Protobuf\Internal\Message +{ + /** + * The ID of the project to which the entities belong. + * + * Generated from protobuf field string project_id = 2; + */ + protected $project_id = ''; + /** + * If not empty, the ID of the database to which the entities + * belong. + * + * Generated from protobuf field string database_id = 3; + */ + protected $database_id = ''; + /** + * If not empty, the ID of the namespace to which the entities belong. + * + * Generated from protobuf field string namespace_id = 4; + */ + protected $namespace_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * The ID of the project to which the entities belong. + * @type string $database_id + * If not empty, the ID of the database to which the entities + * belong. + * @type string $namespace_id + * If not empty, the ID of the namespace to which the entities belong. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Entity::initOnce(); + parent::__construct($data); + } + + /** + * The ID of the project to which the entities belong. + * + * Generated from protobuf field string project_id = 2; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * The ID of the project to which the entities belong. + * + * Generated from protobuf field string project_id = 2; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * If not empty, the ID of the database to which the entities + * belong. + * + * Generated from protobuf field string database_id = 3; + * @return string + */ + public function getDatabaseId() + { + return $this->database_id; + } + + /** + * If not empty, the ID of the database to which the entities + * belong. + * + * Generated from protobuf field string database_id = 3; + * @param string $var + * @return $this + */ + public function setDatabaseId($var) + { + GPBUtil::checkString($var, True); + $this->database_id = $var; + + return $this; + } + + /** + * If not empty, the ID of the namespace to which the entities belong. + * + * Generated from protobuf field string namespace_id = 4; + * @return string + */ + public function getNamespaceId() + { + return $this->namespace_id; + } + + /** + * If not empty, the ID of the namespace to which the entities belong. + * + * Generated from protobuf field string namespace_id = 4; + * @param string $var + * @return $this + */ + public function setNamespaceId($var) + { + GPBUtil::checkString($var, True); + $this->namespace_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PlanSummary.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PlanSummary.php new file mode 100644 index 000000000000..92b12043c889 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PlanSummary.php @@ -0,0 +1,83 @@ +google.datastore.v1.PlanSummary + */ +class PlanSummary extends \Google\Protobuf\Internal\Message +{ + /** + * The indexes selected for the query. For example: + * [ + * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + * ] + * + * Generated from protobuf field repeated .google.protobuf.Struct indexes_used = 1; + */ + private $indexes_used; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Protobuf\Struct>|\Google\Protobuf\Internal\RepeatedField $indexes_used + * The indexes selected for the query. For example: + * [ + * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + * ] + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\QueryProfile::initOnce(); + parent::__construct($data); + } + + /** + * The indexes selected for the query. For example: + * [ + * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + * ] + * + * Generated from protobuf field repeated .google.protobuf.Struct indexes_used = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIndexesUsed() + { + return $this->indexes_used; + } + + /** + * The indexes selected for the query. For example: + * [ + * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, + * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} + * ] + * + * Generated from protobuf field repeated .google.protobuf.Struct indexes_used = 1; + * @param array<\Google\Protobuf\Struct>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIndexesUsed($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Struct::class); + $this->indexes_used = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Projection.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Projection.php new file mode 100644 index 000000000000..614ebde6d27f --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Projection.php @@ -0,0 +1,77 @@ +google.datastore.v1.Projection + */ +class Projection extends \Google\Protobuf\Internal\Message +{ + /** + * The property to project. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + */ + protected $property = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\PropertyReference $property + * The property to project. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The property to project. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + * @return \Google\Cloud\Datastore\V1\PropertyReference|null + */ + public function getProperty() + { + return $this->property; + } + + public function hasProperty() + { + return isset($this->property); + } + + public function clearProperty() + { + unset($this->property); + } + + /** + * The property to project. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + * @param \Google\Cloud\Datastore\V1\PropertyReference $var + * @return $this + */ + public function setProperty($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyReference::class); + $this->property = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter.php new file mode 100644 index 000000000000..9e303711f8aa --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter.php @@ -0,0 +1,155 @@ +google.datastore.v1.PropertyFilter + */ +class PropertyFilter extends \Google\Protobuf\Internal\Message +{ + /** + * The property to filter by. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + */ + protected $property = null; + /** + * The operator to filter by. + * + * Generated from protobuf field .google.datastore.v1.PropertyFilter.Operator op = 2; + */ + protected $op = 0; + /** + * The value to compare the property to. + * + * Generated from protobuf field .google.datastore.v1.Value value = 3; + */ + protected $value = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\PropertyReference $property + * The property to filter by. + * @type int $op + * The operator to filter by. + * @type \Google\Cloud\Datastore\V1\Value $value + * The value to compare the property to. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The property to filter by. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + * @return \Google\Cloud\Datastore\V1\PropertyReference|null + */ + public function getProperty() + { + return $this->property; + } + + public function hasProperty() + { + return isset($this->property); + } + + public function clearProperty() + { + unset($this->property); + } + + /** + * The property to filter by. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + * @param \Google\Cloud\Datastore\V1\PropertyReference $var + * @return $this + */ + public function setProperty($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyReference::class); + $this->property = $var; + + return $this; + } + + /** + * The operator to filter by. + * + * Generated from protobuf field .google.datastore.v1.PropertyFilter.Operator op = 2; + * @return int + */ + public function getOp() + { + return $this->op; + } + + /** + * The operator to filter by. + * + * Generated from protobuf field .google.datastore.v1.PropertyFilter.Operator op = 2; + * @param int $var + * @return $this + */ + public function setOp($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\PropertyFilter\Operator::class); + $this->op = $var; + + return $this; + } + + /** + * The value to compare the property to. + * + * Generated from protobuf field .google.datastore.v1.Value value = 3; + * @return \Google\Cloud\Datastore\V1\Value|null + */ + public function getValue() + { + return $this->value; + } + + public function hasValue() + { + return isset($this->value); + } + + public function clearValue() + { + unset($this->value); + } + + /** + * The value to compare the property to. + * + * Generated from protobuf field .google.datastore.v1.Value value = 3; + * @param \Google\Cloud\Datastore\V1\Value $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter/Operator.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter/Operator.php new file mode 100644 index 000000000000..b1188ff2d39a --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter/Operator.php @@ -0,0 +1,135 @@ +google.datastore.v1.PropertyFilter.Operator + */ +class Operator +{ + /** + * Unspecified. This value must not be used. + * + * Generated from protobuf enum OPERATOR_UNSPECIFIED = 0; + */ + const OPERATOR_UNSPECIFIED = 0; + /** + * The given `property` is less than the given `value`. + * Requires: + * * That `property` comes first in `order_by`. + * + * Generated from protobuf enum LESS_THAN = 1; + */ + const LESS_THAN = 1; + /** + * The given `property` is less than or equal to the given `value`. + * Requires: + * * That `property` comes first in `order_by`. + * + * Generated from protobuf enum LESS_THAN_OR_EQUAL = 2; + */ + const LESS_THAN_OR_EQUAL = 2; + /** + * The given `property` is greater than the given `value`. + * Requires: + * * That `property` comes first in `order_by`. + * + * Generated from protobuf enum GREATER_THAN = 3; + */ + const GREATER_THAN = 3; + /** + * The given `property` is greater than or equal to the given `value`. + * Requires: + * * That `property` comes first in `order_by`. + * + * Generated from protobuf enum GREATER_THAN_OR_EQUAL = 4; + */ + const GREATER_THAN_OR_EQUAL = 4; + /** + * The given `property` is equal to the given `value`. + * + * Generated from protobuf enum EQUAL = 5; + */ + const EQUAL = 5; + /** + * The given `property` is equal to at least one value in the given array. + * Requires: + * * That `value` is a non-empty `ArrayValue`, subject to disjunction + * limits. + * * No `NOT_IN` is in the same query. + * + * Generated from protobuf enum IN = 6; + */ + const IN = 6; + /** + * The given `property` is not equal to the given `value`. + * Requires: + * * No other `NOT_EQUAL` or `NOT_IN` is in the same query. + * * That `property` comes first in the `order_by`. + * + * Generated from protobuf enum NOT_EQUAL = 9; + */ + const NOT_EQUAL = 9; + /** + * Limit the result set to the given entity and its descendants. + * Requires: + * * That `value` is an entity key. + * * All evaluated disjunctions must have the same `HAS_ANCESTOR` filter. + * + * Generated from protobuf enum HAS_ANCESTOR = 11; + */ + const HAS_ANCESTOR = 11; + /** + * The value of the `property` is not in the given array. + * Requires: + * * That `value` is a non-empty `ArrayValue` with at most 10 values. + * * No other `OR`, `IN`, `NOT_IN`, `NOT_EQUAL` is in the same query. + * * That `field` comes first in the `order_by`. + * + * Generated from protobuf enum NOT_IN = 13; + */ + const NOT_IN = 13; + + private static $valueToName = [ + self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', + self::LESS_THAN => 'LESS_THAN', + self::LESS_THAN_OR_EQUAL => 'LESS_THAN_OR_EQUAL', + self::GREATER_THAN => 'GREATER_THAN', + self::GREATER_THAN_OR_EQUAL => 'GREATER_THAN_OR_EQUAL', + self::EQUAL => 'EQUAL', + self::IN => 'IN', + self::NOT_EQUAL => 'NOT_EQUAL', + self::HAS_ANCESTOR => 'HAS_ANCESTOR', + self::NOT_IN => 'NOT_IN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Operator::class, \Google\Cloud\Datastore\V1\PropertyFilter_Operator::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyMask.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyMask.php new file mode 100644 index 000000000000..1768924cdfb4 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyMask.php @@ -0,0 +1,96 @@ +google.datastore.v1.PropertyMask + */ +class PropertyMask extends \Google\Protobuf\Internal\Message +{ + /** + * The paths to the properties covered by this mask. + * A path is a list of property names separated by dots (`.`), for example + * `foo.bar` means the property `bar` inside the entity property `foo` inside + * the entity associated with this path. + * If a property name contains a dot `.` or a backslash `\`, then that + * name must be escaped. + * A path must not be empty, and may not reference a value inside an + * [array value][google.datastore.v1.Value.array_value]. + * + * Generated from protobuf field repeated string paths = 1; + */ + private $paths; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $paths + * The paths to the properties covered by this mask. + * A path is a list of property names separated by dots (`.`), for example + * `foo.bar` means the property `bar` inside the entity property `foo` inside + * the entity associated with this path. + * If a property name contains a dot `.` or a backslash `\`, then that + * name must be escaped. + * A path must not be empty, and may not reference a value inside an + * [array value][google.datastore.v1.Value.array_value]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * The paths to the properties covered by this mask. + * A path is a list of property names separated by dots (`.`), for example + * `foo.bar` means the property `bar` inside the entity property `foo` inside + * the entity associated with this path. + * If a property name contains a dot `.` or a backslash `\`, then that + * name must be escaped. + * A path must not be empty, and may not reference a value inside an + * [array value][google.datastore.v1.Value.array_value]. + * + * Generated from protobuf field repeated string paths = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPaths() + { + return $this->paths; + } + + /** + * The paths to the properties covered by this mask. + * A path is a list of property names separated by dots (`.`), for example + * `foo.bar` means the property `bar` inside the entity property `foo` inside + * the entity associated with this path. + * If a property name contains a dot `.` or a backslash `\`, then that + * name must be escaped. + * A path must not be empty, and may not reference a value inside an + * [array value][google.datastore.v1.Value.array_value]. + * + * Generated from protobuf field repeated string paths = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPaths($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->paths = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder.php new file mode 100644 index 000000000000..836cc807daf0 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder.php @@ -0,0 +1,111 @@ +google.datastore.v1.PropertyOrder + */ +class PropertyOrder extends \Google\Protobuf\Internal\Message +{ + /** + * The property to order by. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + */ + protected $property = null; + /** + * The direction to order by. Defaults to `ASCENDING`. + * + * Generated from protobuf field .google.datastore.v1.PropertyOrder.Direction direction = 2; + */ + protected $direction = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\PropertyReference $property + * The property to order by. + * @type int $direction + * The direction to order by. Defaults to `ASCENDING`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The property to order by. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + * @return \Google\Cloud\Datastore\V1\PropertyReference|null + */ + public function getProperty() + { + return $this->property; + } + + public function hasProperty() + { + return isset($this->property); + } + + public function clearProperty() + { + unset($this->property); + } + + /** + * The property to order by. + * + * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; + * @param \Google\Cloud\Datastore\V1\PropertyReference $var + * @return $this + */ + public function setProperty($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyReference::class); + $this->property = $var; + + return $this; + } + + /** + * The direction to order by. Defaults to `ASCENDING`. + * + * Generated from protobuf field .google.datastore.v1.PropertyOrder.Direction direction = 2; + * @return int + */ + public function getDirection() + { + return $this->direction; + } + + /** + * The direction to order by. Defaults to `ASCENDING`. + * + * Generated from protobuf field .google.datastore.v1.PropertyOrder.Direction direction = 2; + * @param int $var + * @return $this + */ + public function setDirection($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\PropertyOrder\Direction::class); + $this->direction = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder/Direction.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder/Direction.php new file mode 100644 index 000000000000..6534ba280732 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder/Direction.php @@ -0,0 +1,64 @@ +google.datastore.v1.PropertyOrder.Direction + */ +class Direction +{ + /** + * Unspecified. This value must not be used. + * + * Generated from protobuf enum DIRECTION_UNSPECIFIED = 0; + */ + const DIRECTION_UNSPECIFIED = 0; + /** + * Ascending. + * + * Generated from protobuf enum ASCENDING = 1; + */ + const ASCENDING = 1; + /** + * Descending. + * + * Generated from protobuf enum DESCENDING = 2; + */ + const DESCENDING = 2; + + private static $valueToName = [ + self::DIRECTION_UNSPECIFIED => 'DIRECTION_UNSPECIFIED', + self::ASCENDING => 'ASCENDING', + self::DESCENDING => 'DESCENDING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Direction::class, \Google\Cloud\Datastore\V1\PropertyOrder_Direction::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyReference.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyReference.php new file mode 100644 index 000000000000..ea6acf710a57 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyReference.php @@ -0,0 +1,83 @@ +google.datastore.v1.PropertyReference + */ +class PropertyReference extends \Google\Protobuf\Internal\Message +{ + /** + * A reference to a property. + * Requires: + * * MUST be a dot-delimited (`.`) string of segments, where each segment + * conforms to [entity property name][google.datastore.v1.Entity.properties] + * limitations. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * A reference to a property. + * Requires: + * * MUST be a dot-delimited (`.`) string of segments, where each segment + * conforms to [entity property name][google.datastore.v1.Entity.properties] + * limitations. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * A reference to a property. + * Requires: + * * MUST be a dot-delimited (`.`) string of segments, where each segment + * conforms to [entity property name][google.datastore.v1.Entity.properties] + * limitations. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * A reference to a property. + * Requires: + * * MUST be a dot-delimited (`.`) string of segments, where each segment + * conforms to [entity property name][google.datastore.v1.Entity.properties] + * limitations. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform.php new file mode 100644 index 000000000000..1114cd9027ae --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform.php @@ -0,0 +1,432 @@ +google.datastore.v1.PropertyTransform + */ +class PropertyTransform extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the property. + * Property paths (a list of property names separated by dots (`.`)) may be + * used to refer to properties inside entity values. For example `foo.bar` + * means the property `bar` inside the entity property `foo`. + * If a property name contains a dot `.` or a backlslash `\`, then that name + * must be escaped. + * + * Generated from protobuf field string property = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $property = ''; + protected $transform_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $property + * Optional. The name of the property. + * Property paths (a list of property names separated by dots (`.`)) may be + * used to refer to properties inside entity values. For example `foo.bar` + * means the property `bar` inside the entity property `foo`. + * If a property name contains a dot `.` or a backlslash `\`, then that name + * must be escaped. + * @type int $set_to_server_value + * Sets the property to the given server value. + * @type \Google\Cloud\Datastore\V1\Value $increment + * Adds the given value to the property's current value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the given value. + * If either of the given value or the current property value are doubles, + * both values will be interpreted as doubles. Double arithmetic and + * representation of double values follows IEEE 754 semantics. + * If there is positive/negative integer overflow, the property is resolved + * to the largest magnitude positive/negative integer. + * @type \Google\Cloud\Datastore\V1\Value $maximum + * Sets the property to the maximum of its current value and the given + * value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the given value. + * If a maximum operation is applied where the property and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the property takes on the type of the larger operand. If the operands are + * equivalent (e.g. 3 and 3.0), the property does not change. + * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and + * zero input value is always the stored value. + * The maximum of any numeric value x and NaN is NaN. + * @type \Google\Cloud\Datastore\V1\Value $minimum + * Sets the property to the minimum of its current value and the given + * value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the input value. + * If a minimum operation is applied where the property and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the property takes on the type of the smaller operand. If the operands + * are equivalent (e.g. 3 and 3.0), the property does not change. 0, 0.0, + * and -0.0 are all zero. The minimum of a zero stored value and zero input + * value is always the stored value. The minimum of any numeric value x and + * NaN is NaN. + * @type \Google\Cloud\Datastore\V1\ArrayValue $append_missing_elements + * Appends the given elements in order if they are not already present in + * the current property value. + * If the property is not an array, or if the property does not yet exist, + * it is first set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when checking if a value is missing. + * NaN is equal to NaN, and the null value is equal to the null value. + * If the input contains multiple equivalent values, only the first will + * be considered. + * The corresponding transform result will be the null value. + * @type \Google\Cloud\Datastore\V1\ArrayValue $remove_all_from_array + * Removes all of the given elements from the array in the property. + * If the property is not an array, or if the property does not yet exist, + * it is set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when deciding whether an element should be removed. + * NaN is equal to NaN, and the null value is equal to the null value. + * This will remove all equivalent values if there are duplicates. + * The corresponding transform result will be the null value. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The name of the property. + * Property paths (a list of property names separated by dots (`.`)) may be + * used to refer to properties inside entity values. For example `foo.bar` + * means the property `bar` inside the entity property `foo`. + * If a property name contains a dot `.` or a backlslash `\`, then that name + * must be escaped. + * + * Generated from protobuf field string property = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getProperty() + { + return $this->property; + } + + /** + * Optional. The name of the property. + * Property paths (a list of property names separated by dots (`.`)) may be + * used to refer to properties inside entity values. For example `foo.bar` + * means the property `bar` inside the entity property `foo`. + * If a property name contains a dot `.` or a backlslash `\`, then that name + * must be escaped. + * + * Generated from protobuf field string property = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setProperty($var) + { + GPBUtil::checkString($var, True); + $this->property = $var; + + return $this; + } + + /** + * Sets the property to the given server value. + * + * Generated from protobuf field .google.datastore.v1.PropertyTransform.ServerValue set_to_server_value = 2; + * @return int + */ + public function getSetToServerValue() + { + return $this->readOneof(2); + } + + public function hasSetToServerValue() + { + return $this->hasOneof(2); + } + + /** + * Sets the property to the given server value. + * + * Generated from protobuf field .google.datastore.v1.PropertyTransform.ServerValue set_to_server_value = 2; + * @param int $var + * @return $this + */ + public function setSetToServerValue($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\PropertyTransform\ServerValue::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Adds the given value to the property's current value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the given value. + * If either of the given value or the current property value are doubles, + * both values will be interpreted as doubles. Double arithmetic and + * representation of double values follows IEEE 754 semantics. + * If there is positive/negative integer overflow, the property is resolved + * to the largest magnitude positive/negative integer. + * + * Generated from protobuf field .google.datastore.v1.Value increment = 3; + * @return \Google\Cloud\Datastore\V1\Value|null + */ + public function getIncrement() + { + return $this->readOneof(3); + } + + public function hasIncrement() + { + return $this->hasOneof(3); + } + + /** + * Adds the given value to the property's current value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the given value. + * If either of the given value or the current property value are doubles, + * both values will be interpreted as doubles. Double arithmetic and + * representation of double values follows IEEE 754 semantics. + * If there is positive/negative integer overflow, the property is resolved + * to the largest magnitude positive/negative integer. + * + * Generated from protobuf field .google.datastore.v1.Value increment = 3; + * @param \Google\Cloud\Datastore\V1\Value $var + * @return $this + */ + public function setIncrement($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Sets the property to the maximum of its current value and the given + * value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the given value. + * If a maximum operation is applied where the property and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the property takes on the type of the larger operand. If the operands are + * equivalent (e.g. 3 and 3.0), the property does not change. + * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and + * zero input value is always the stored value. + * The maximum of any numeric value x and NaN is NaN. + * + * Generated from protobuf field .google.datastore.v1.Value maximum = 4; + * @return \Google\Cloud\Datastore\V1\Value|null + */ + public function getMaximum() + { + return $this->readOneof(4); + } + + public function hasMaximum() + { + return $this->hasOneof(4); + } + + /** + * Sets the property to the maximum of its current value and the given + * value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the given value. + * If a maximum operation is applied where the property and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the property takes on the type of the larger operand. If the operands are + * equivalent (e.g. 3 and 3.0), the property does not change. + * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and + * zero input value is always the stored value. + * The maximum of any numeric value x and NaN is NaN. + * + * Generated from protobuf field .google.datastore.v1.Value maximum = 4; + * @param \Google\Cloud\Datastore\V1\Value $var + * @return $this + */ + public function setMaximum($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Sets the property to the minimum of its current value and the given + * value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the input value. + * If a minimum operation is applied where the property and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the property takes on the type of the smaller operand. If the operands + * are equivalent (e.g. 3 and 3.0), the property does not change. 0, 0.0, + * and -0.0 are all zero. The minimum of a zero stored value and zero input + * value is always the stored value. The minimum of any numeric value x and + * NaN is NaN. + * + * Generated from protobuf field .google.datastore.v1.Value minimum = 5; + * @return \Google\Cloud\Datastore\V1\Value|null + */ + public function getMinimum() + { + return $this->readOneof(5); + } + + public function hasMinimum() + { + return $this->hasOneof(5); + } + + /** + * Sets the property to the minimum of its current value and the given + * value. + * This must be an integer or a double value. + * If the property is not an integer or double, or if the property does not + * yet exist, the transformation will set the property to the input value. + * If a minimum operation is applied where the property and the input value + * are of mixed types (that is - one is an integer and one is a double) + * the property takes on the type of the smaller operand. If the operands + * are equivalent (e.g. 3 and 3.0), the property does not change. 0, 0.0, + * and -0.0 are all zero. The minimum of a zero stored value and zero input + * value is always the stored value. The minimum of any numeric value x and + * NaN is NaN. + * + * Generated from protobuf field .google.datastore.v1.Value minimum = 5; + * @param \Google\Cloud\Datastore\V1\Value $var + * @return $this + */ + public function setMinimum($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Appends the given elements in order if they are not already present in + * the current property value. + * If the property is not an array, or if the property does not yet exist, + * it is first set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when checking if a value is missing. + * NaN is equal to NaN, and the null value is equal to the null value. + * If the input contains multiple equivalent values, only the first will + * be considered. + * The corresponding transform result will be the null value. + * + * Generated from protobuf field .google.datastore.v1.ArrayValue append_missing_elements = 6; + * @return \Google\Cloud\Datastore\V1\ArrayValue|null + */ + public function getAppendMissingElements() + { + return $this->readOneof(6); + } + + public function hasAppendMissingElements() + { + return $this->hasOneof(6); + } + + /** + * Appends the given elements in order if they are not already present in + * the current property value. + * If the property is not an array, or if the property does not yet exist, + * it is first set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when checking if a value is missing. + * NaN is equal to NaN, and the null value is equal to the null value. + * If the input contains multiple equivalent values, only the first will + * be considered. + * The corresponding transform result will be the null value. + * + * Generated from protobuf field .google.datastore.v1.ArrayValue append_missing_elements = 6; + * @param \Google\Cloud\Datastore\V1\ArrayValue $var + * @return $this + */ + public function setAppendMissingElements($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ArrayValue::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Removes all of the given elements from the array in the property. + * If the property is not an array, or if the property does not yet exist, + * it is set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when deciding whether an element should be removed. + * NaN is equal to NaN, and the null value is equal to the null value. + * This will remove all equivalent values if there are duplicates. + * The corresponding transform result will be the null value. + * + * Generated from protobuf field .google.datastore.v1.ArrayValue remove_all_from_array = 7; + * @return \Google\Cloud\Datastore\V1\ArrayValue|null + */ + public function getRemoveAllFromArray() + { + return $this->readOneof(7); + } + + public function hasRemoveAllFromArray() + { + return $this->hasOneof(7); + } + + /** + * Removes all of the given elements from the array in the property. + * If the property is not an array, or if the property does not yet exist, + * it is set to the empty array. + * Equivalent numbers of different types (e.g. 3L and 3.0) are + * considered equal when deciding whether an element should be removed. + * NaN is equal to NaN, and the null value is equal to the null value. + * This will remove all equivalent values if there are duplicates. + * The corresponding transform result will be the null value. + * + * Generated from protobuf field .google.datastore.v1.ArrayValue remove_all_from_array = 7; + * @param \Google\Cloud\Datastore\V1\ArrayValue $var + * @return $this + */ + public function setRemoveAllFromArray($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ArrayValue::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * @return string + */ + public function getTransformType() + { + return $this->whichOneof("transform_type"); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform/ServerValue.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform/ServerValue.php new file mode 100644 index 000000000000..6162f10f4c4d --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform/ServerValue.php @@ -0,0 +1,59 @@ +google.datastore.v1.PropertyTransform.ServerValue + */ +class ServerValue +{ + /** + * Unspecified. This value must not be used. + * + * Generated from protobuf enum SERVER_VALUE_UNSPECIFIED = 0; + */ + const SERVER_VALUE_UNSPECIFIED = 0; + /** + * The time at which the server processed the request, with millisecond + * precision. If used on multiple properties (same or different entities) + * in a transaction, all the properties will get the same server timestamp. + * + * Generated from protobuf enum REQUEST_TIME = 1; + */ + const REQUEST_TIME = 1; + + private static $valueToName = [ + self::SERVER_VALUE_UNSPECIFIED => 'SERVER_VALUE_UNSPECIFIED', + self::REQUEST_TIME => 'REQUEST_TIME', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ServerValue::class, \Google\Cloud\Datastore\V1\PropertyTransform_ServerValue::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Query.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Query.php new file mode 100644 index 000000000000..5d1def8847b7 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Query.php @@ -0,0 +1,516 @@ +google.datastore.v1.Query + */ +class Query extends \Google\Protobuf\Internal\Message +{ + /** + * The projection to return. Defaults to returning all properties. + * + * Generated from protobuf field repeated .google.datastore.v1.Projection projection = 2; + */ + private $projection; + /** + * The kinds to query (if empty, returns entities of all kinds). + * Currently at most 1 kind may be specified. + * + * Generated from protobuf field repeated .google.datastore.v1.KindExpression kind = 3; + */ + private $kind; + /** + * The filter to apply. + * + * Generated from protobuf field .google.datastore.v1.Filter filter = 4; + */ + protected $filter = null; + /** + * The order to apply to the query results (if empty, order is unspecified). + * + * Generated from protobuf field repeated .google.datastore.v1.PropertyOrder order = 5; + */ + private $order; + /** + * The properties to make distinct. The query results will contain the first + * result for each distinct combination of values for the given properties + * (if empty, all results are returned). + * Requires: + * * If `order` is specified, the set of distinct on properties must appear + * before the non-distinct on properties in `order`. + * + * Generated from protobuf field repeated .google.datastore.v1.PropertyReference distinct_on = 6; + */ + private $distinct_on; + /** + * A starting point for the query results. Query cursors are + * returned in query result batches and + * [can only be used to continue the same + * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + * + * Generated from protobuf field bytes start_cursor = 7; + */ + protected $start_cursor = ''; + /** + * An ending point for the query results. Query cursors are + * returned in query result batches and + * [can only be used to limit the same + * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + * + * Generated from protobuf field bytes end_cursor = 8; + */ + protected $end_cursor = ''; + /** + * The number of results to skip. Applies before limit, but after all other + * constraints. Optional. Must be >= 0 if specified. + * + * Generated from protobuf field int32 offset = 10; + */ + protected $offset = 0; + /** + * The maximum number of results to return. Applies after all other + * constraints. Optional. + * Unspecified is interpreted as no limit. + * Must be >= 0 if specified. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 12; + */ + protected $limit = null; + /** + * Optional. A potential Nearest Neighbors Search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * + * Generated from protobuf field .google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $find_nearest = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Datastore\V1\Projection>|\Google\Protobuf\Internal\RepeatedField $projection + * The projection to return. Defaults to returning all properties. + * @type array<\Google\Cloud\Datastore\V1\KindExpression>|\Google\Protobuf\Internal\RepeatedField $kind + * The kinds to query (if empty, returns entities of all kinds). + * Currently at most 1 kind may be specified. + * @type \Google\Cloud\Datastore\V1\Filter $filter + * The filter to apply. + * @type array<\Google\Cloud\Datastore\V1\PropertyOrder>|\Google\Protobuf\Internal\RepeatedField $order + * The order to apply to the query results (if empty, order is unspecified). + * @type array<\Google\Cloud\Datastore\V1\PropertyReference>|\Google\Protobuf\Internal\RepeatedField $distinct_on + * The properties to make distinct. The query results will contain the first + * result for each distinct combination of values for the given properties + * (if empty, all results are returned). + * Requires: + * * If `order` is specified, the set of distinct on properties must appear + * before the non-distinct on properties in `order`. + * @type string $start_cursor + * A starting point for the query results. Query cursors are + * returned in query result batches and + * [can only be used to continue the same + * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + * @type string $end_cursor + * An ending point for the query results. Query cursors are + * returned in query result batches and + * [can only be used to limit the same + * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + * @type int $offset + * The number of results to skip. Applies before limit, but after all other + * constraints. Optional. Must be >= 0 if specified. + * @type \Google\Protobuf\Int32Value $limit + * The maximum number of results to return. Applies after all other + * constraints. Optional. + * Unspecified is interpreted as no limit. + * Must be >= 0 if specified. + * @type \Google\Cloud\Datastore\V1\FindNearest $find_nearest + * Optional. A potential Nearest Neighbors Search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The projection to return. Defaults to returning all properties. + * + * Generated from protobuf field repeated .google.datastore.v1.Projection projection = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProjection() + { + return $this->projection; + } + + /** + * The projection to return. Defaults to returning all properties. + * + * Generated from protobuf field repeated .google.datastore.v1.Projection projection = 2; + * @param array<\Google\Cloud\Datastore\V1\Projection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProjection($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Projection::class); + $this->projection = $arr; + + return $this; + } + + /** + * The kinds to query (if empty, returns entities of all kinds). + * Currently at most 1 kind may be specified. + * + * Generated from protobuf field repeated .google.datastore.v1.KindExpression kind = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKind() + { + return $this->kind; + } + + /** + * The kinds to query (if empty, returns entities of all kinds). + * Currently at most 1 kind may be specified. + * + * Generated from protobuf field repeated .google.datastore.v1.KindExpression kind = 3; + * @param array<\Google\Cloud\Datastore\V1\KindExpression>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKind($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\KindExpression::class); + $this->kind = $arr; + + return $this; + } + + /** + * The filter to apply. + * + * Generated from protobuf field .google.datastore.v1.Filter filter = 4; + * @return \Google\Cloud\Datastore\V1\Filter|null + */ + public function getFilter() + { + return $this->filter; + } + + public function hasFilter() + { + return isset($this->filter); + } + + public function clearFilter() + { + unset($this->filter); + } + + /** + * The filter to apply. + * + * Generated from protobuf field .google.datastore.v1.Filter filter = 4; + * @param \Google\Cloud\Datastore\V1\Filter $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Filter::class); + $this->filter = $var; + + return $this; + } + + /** + * The order to apply to the query results (if empty, order is unspecified). + * + * Generated from protobuf field repeated .google.datastore.v1.PropertyOrder order = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOrder() + { + return $this->order; + } + + /** + * The order to apply to the query results (if empty, order is unspecified). + * + * Generated from protobuf field repeated .google.datastore.v1.PropertyOrder order = 5; + * @param array<\Google\Cloud\Datastore\V1\PropertyOrder>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOrder($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\PropertyOrder::class); + $this->order = $arr; + + return $this; + } + + /** + * The properties to make distinct. The query results will contain the first + * result for each distinct combination of values for the given properties + * (if empty, all results are returned). + * Requires: + * * If `order` is specified, the set of distinct on properties must appear + * before the non-distinct on properties in `order`. + * + * Generated from protobuf field repeated .google.datastore.v1.PropertyReference distinct_on = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDistinctOn() + { + return $this->distinct_on; + } + + /** + * The properties to make distinct. The query results will contain the first + * result for each distinct combination of values for the given properties + * (if empty, all results are returned). + * Requires: + * * If `order` is specified, the set of distinct on properties must appear + * before the non-distinct on properties in `order`. + * + * Generated from protobuf field repeated .google.datastore.v1.PropertyReference distinct_on = 6; + * @param array<\Google\Cloud\Datastore\V1\PropertyReference>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDistinctOn($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\PropertyReference::class); + $this->distinct_on = $arr; + + return $this; + } + + /** + * A starting point for the query results. Query cursors are + * returned in query result batches and + * [can only be used to continue the same + * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + * + * Generated from protobuf field bytes start_cursor = 7; + * @return string + */ + public function getStartCursor() + { + return $this->start_cursor; + } + + /** + * A starting point for the query results. Query cursors are + * returned in query result batches and + * [can only be used to continue the same + * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + * + * Generated from protobuf field bytes start_cursor = 7; + * @param string $var + * @return $this + */ + public function setStartCursor($var) + { + GPBUtil::checkString($var, False); + $this->start_cursor = $var; + + return $this; + } + + /** + * An ending point for the query results. Query cursors are + * returned in query result batches and + * [can only be used to limit the same + * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + * + * Generated from protobuf field bytes end_cursor = 8; + * @return string + */ + public function getEndCursor() + { + return $this->end_cursor; + } + + /** + * An ending point for the query results. Query cursors are + * returned in query result batches and + * [can only be used to limit the same + * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + * + * Generated from protobuf field bytes end_cursor = 8; + * @param string $var + * @return $this + */ + public function setEndCursor($var) + { + GPBUtil::checkString($var, False); + $this->end_cursor = $var; + + return $this; + } + + /** + * The number of results to skip. Applies before limit, but after all other + * constraints. Optional. Must be >= 0 if specified. + * + * Generated from protobuf field int32 offset = 10; + * @return int + */ + public function getOffset() + { + return $this->offset; + } + + /** + * The number of results to skip. Applies before limit, but after all other + * constraints. Optional. Must be >= 0 if specified. + * + * Generated from protobuf field int32 offset = 10; + * @param int $var + * @return $this + */ + public function setOffset($var) + { + GPBUtil::checkInt32($var); + $this->offset = $var; + + return $this; + } + + /** + * The maximum number of results to return. Applies after all other + * constraints. Optional. + * Unspecified is interpreted as no limit. + * Must be >= 0 if specified. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 12; + * @return \Google\Protobuf\Int32Value|null + */ + public function getLimit() + { + return $this->limit; + } + + public function hasLimit() + { + return isset($this->limit); + } + + public function clearLimit() + { + unset($this->limit); + } + + /** + * Returns the unboxed value from getLimit() + + * The maximum number of results to return. Applies after all other + * constraints. Optional. + * Unspecified is interpreted as no limit. + * Must be >= 0 if specified. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 12; + * @return int|null + */ + public function getLimitUnwrapped() + { + return $this->readWrapperValue("limit"); + } + + /** + * The maximum number of results to return. Applies after all other + * constraints. Optional. + * Unspecified is interpreted as no limit. + * Must be >= 0 if specified. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 12; + * @param \Google\Protobuf\Int32Value $var + * @return $this + */ + public function setLimit($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); + $this->limit = $var; + + return $this; + } + + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * The maximum number of results to return. Applies after all other + * constraints. Optional. + * Unspecified is interpreted as no limit. + * Must be >= 0 if specified. + * + * Generated from protobuf field .google.protobuf.Int32Value limit = 12; + * @param int|null $var + * @return $this + */ + public function setLimitUnwrapped($var) + { + $this->writeWrapperValue("limit", $var); + return $this;} + + /** + * Optional. A potential Nearest Neighbors Search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * + * Generated from protobuf field .google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Datastore\V1\FindNearest|null + */ + public function getFindNearest() + { + return $this->find_nearest; + } + + public function hasFindNearest() + { + return isset($this->find_nearest); + } + + public function clearFindNearest() + { + unset($this->find_nearest); + } + + /** + * Optional. A potential Nearest Neighbors Search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * + * Generated from protobuf field .google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Datastore\V1\FindNearest $var + * @return $this + */ + public function setFindNearest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\FindNearest::class); + $this->find_nearest = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch.php new file mode 100644 index 000000000000..04cc35cb4ad8 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch.php @@ -0,0 +1,379 @@ +google.datastore.v1.QueryResultBatch + */ +class QueryResultBatch extends \Google\Protobuf\Internal\Message +{ + /** + * The number of results skipped, typically because of an offset. + * + * Generated from protobuf field int32 skipped_results = 6; + */ + protected $skipped_results = 0; + /** + * A cursor that points to the position after the last skipped result. + * Will be set when `skipped_results` != 0. + * + * Generated from protobuf field bytes skipped_cursor = 3; + */ + protected $skipped_cursor = ''; + /** + * The result type for every entity in `entity_results`. + * + * Generated from protobuf field .google.datastore.v1.EntityResult.ResultType entity_result_type = 1; + */ + protected $entity_result_type = 0; + /** + * The results for this batch. + * + * Generated from protobuf field repeated .google.datastore.v1.EntityResult entity_results = 2; + */ + private $entity_results; + /** + * A cursor that points to the position after the last result in the batch. + * + * Generated from protobuf field bytes end_cursor = 4; + */ + protected $end_cursor = ''; + /** + * The state of the query after the current batch. + * + * Generated from protobuf field .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5; + */ + protected $more_results = 0; + /** + * The version number of the snapshot this batch was returned from. + * This applies to the range of results from the query's `start_cursor` (or + * the beginning of the query if no cursor was given) to this batch's + * `end_cursor` (not the query's `end_cursor`). + * In a single transaction, subsequent query result batches for the same query + * can have a greater snapshot version number. Each batch's snapshot version + * is valid for all preceding batches. + * The value will be zero for eventually consistent queries. + * + * Generated from protobuf field int64 snapshot_version = 7; + */ + protected $snapshot_version = 0; + /** + * Read timestamp this batch was returned from. + * This applies to the range of results from the query's `start_cursor` (or + * the beginning of the query if no cursor was given) to this batch's + * `end_cursor` (not the query's `end_cursor`). + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + * This value will not be set for eventually consistent queries in Cloud + * Datastore. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 8; + */ + protected $read_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $skipped_results + * The number of results skipped, typically because of an offset. + * @type string $skipped_cursor + * A cursor that points to the position after the last skipped result. + * Will be set when `skipped_results` != 0. + * @type int $entity_result_type + * The result type for every entity in `entity_results`. + * @type array<\Google\Cloud\Datastore\V1\EntityResult>|\Google\Protobuf\Internal\RepeatedField $entity_results + * The results for this batch. + * @type string $end_cursor + * A cursor that points to the position after the last result in the batch. + * @type int $more_results + * The state of the query after the current batch. + * @type int|string $snapshot_version + * The version number of the snapshot this batch was returned from. + * This applies to the range of results from the query's `start_cursor` (or + * the beginning of the query if no cursor was given) to this batch's + * `end_cursor` (not the query's `end_cursor`). + * In a single transaction, subsequent query result batches for the same query + * can have a greater snapshot version number. Each batch's snapshot version + * is valid for all preceding batches. + * The value will be zero for eventually consistent queries. + * @type \Google\Protobuf\Timestamp $read_time + * Read timestamp this batch was returned from. + * This applies to the range of results from the query's `start_cursor` (or + * the beginning of the query if no cursor was given) to this batch's + * `end_cursor` (not the query's `end_cursor`). + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + * This value will not be set for eventually consistent queries in Cloud + * Datastore. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Query::initOnce(); + parent::__construct($data); + } + + /** + * The number of results skipped, typically because of an offset. + * + * Generated from protobuf field int32 skipped_results = 6; + * @return int + */ + public function getSkippedResults() + { + return $this->skipped_results; + } + + /** + * The number of results skipped, typically because of an offset. + * + * Generated from protobuf field int32 skipped_results = 6; + * @param int $var + * @return $this + */ + public function setSkippedResults($var) + { + GPBUtil::checkInt32($var); + $this->skipped_results = $var; + + return $this; + } + + /** + * A cursor that points to the position after the last skipped result. + * Will be set when `skipped_results` != 0. + * + * Generated from protobuf field bytes skipped_cursor = 3; + * @return string + */ + public function getSkippedCursor() + { + return $this->skipped_cursor; + } + + /** + * A cursor that points to the position after the last skipped result. + * Will be set when `skipped_results` != 0. + * + * Generated from protobuf field bytes skipped_cursor = 3; + * @param string $var + * @return $this + */ + public function setSkippedCursor($var) + { + GPBUtil::checkString($var, False); + $this->skipped_cursor = $var; + + return $this; + } + + /** + * The result type for every entity in `entity_results`. + * + * Generated from protobuf field .google.datastore.v1.EntityResult.ResultType entity_result_type = 1; + * @return int + */ + public function getEntityResultType() + { + return $this->entity_result_type; + } + + /** + * The result type for every entity in `entity_results`. + * + * Generated from protobuf field .google.datastore.v1.EntityResult.ResultType entity_result_type = 1; + * @param int $var + * @return $this + */ + public function setEntityResultType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\EntityResult\ResultType::class); + $this->entity_result_type = $var; + + return $this; + } + + /** + * The results for this batch. + * + * Generated from protobuf field repeated .google.datastore.v1.EntityResult entity_results = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEntityResults() + { + return $this->entity_results; + } + + /** + * The results for this batch. + * + * Generated from protobuf field repeated .google.datastore.v1.EntityResult entity_results = 2; + * @param array<\Google\Cloud\Datastore\V1\EntityResult>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEntityResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\EntityResult::class); + $this->entity_results = $arr; + + return $this; + } + + /** + * A cursor that points to the position after the last result in the batch. + * + * Generated from protobuf field bytes end_cursor = 4; + * @return string + */ + public function getEndCursor() + { + return $this->end_cursor; + } + + /** + * A cursor that points to the position after the last result in the batch. + * + * Generated from protobuf field bytes end_cursor = 4; + * @param string $var + * @return $this + */ + public function setEndCursor($var) + { + GPBUtil::checkString($var, False); + $this->end_cursor = $var; + + return $this; + } + + /** + * The state of the query after the current batch. + * + * Generated from protobuf field .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5; + * @return int + */ + public function getMoreResults() + { + return $this->more_results; + } + + /** + * The state of the query after the current batch. + * + * Generated from protobuf field .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5; + * @param int $var + * @return $this + */ + public function setMoreResults($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\QueryResultBatch\MoreResultsType::class); + $this->more_results = $var; + + return $this; + } + + /** + * The version number of the snapshot this batch was returned from. + * This applies to the range of results from the query's `start_cursor` (or + * the beginning of the query if no cursor was given) to this batch's + * `end_cursor` (not the query's `end_cursor`). + * In a single transaction, subsequent query result batches for the same query + * can have a greater snapshot version number. Each batch's snapshot version + * is valid for all preceding batches. + * The value will be zero for eventually consistent queries. + * + * Generated from protobuf field int64 snapshot_version = 7; + * @return int|string + */ + public function getSnapshotVersion() + { + return $this->snapshot_version; + } + + /** + * The version number of the snapshot this batch was returned from. + * This applies to the range of results from the query's `start_cursor` (or + * the beginning of the query if no cursor was given) to this batch's + * `end_cursor` (not the query's `end_cursor`). + * In a single transaction, subsequent query result batches for the same query + * can have a greater snapshot version number. Each batch's snapshot version + * is valid for all preceding batches. + * The value will be zero for eventually consistent queries. + * + * Generated from protobuf field int64 snapshot_version = 7; + * @param int|string $var + * @return $this + */ + public function setSnapshotVersion($var) + { + GPBUtil::checkInt64($var); + $this->snapshot_version = $var; + + return $this; + } + + /** + * Read timestamp this batch was returned from. + * This applies to the range of results from the query's `start_cursor` (or + * the beginning of the query if no cursor was given) to this batch's + * `end_cursor` (not the query's `end_cursor`). + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + * This value will not be set for eventually consistent queries in Cloud + * Datastore. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 8; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * Read timestamp this batch was returned from. + * This applies to the range of results from the query's `start_cursor` (or + * the beginning of the query if no cursor was given) to this batch's + * `end_cursor` (not the query's `end_cursor`). + * In a single transaction, subsequent query result batches for the same query + * can have a greater timestamp. Each batch's read timestamp + * is valid for all preceding batches. + * This value will not be set for eventually consistent queries in Cloud + * Datastore. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 8; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch/MoreResultsType.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch/MoreResultsType.php new file mode 100644 index 000000000000..6f4a9d2dd046 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch/MoreResultsType.php @@ -0,0 +1,79 @@ +google.datastore.v1.QueryResultBatch.MoreResultsType + */ +class MoreResultsType +{ + /** + * Unspecified. This value is never used. + * + * Generated from protobuf enum MORE_RESULTS_TYPE_UNSPECIFIED = 0; + */ + const MORE_RESULTS_TYPE_UNSPECIFIED = 0; + /** + * There may be additional batches to fetch from this query. + * + * Generated from protobuf enum NOT_FINISHED = 1; + */ + const NOT_FINISHED = 1; + /** + * The query is finished, but there may be more results after the limit. + * + * Generated from protobuf enum MORE_RESULTS_AFTER_LIMIT = 2; + */ + const MORE_RESULTS_AFTER_LIMIT = 2; + /** + * The query is finished, but there may be more results after the end + * cursor. + * + * Generated from protobuf enum MORE_RESULTS_AFTER_CURSOR = 4; + */ + const MORE_RESULTS_AFTER_CURSOR = 4; + /** + * The query is finished, and there are no more results. + * + * Generated from protobuf enum NO_MORE_RESULTS = 3; + */ + const NO_MORE_RESULTS = 3; + + private static $valueToName = [ + self::MORE_RESULTS_TYPE_UNSPECIFIED => 'MORE_RESULTS_TYPE_UNSPECIFIED', + self::NOT_FINISHED => 'NOT_FINISHED', + self::MORE_RESULTS_AFTER_LIMIT => 'MORE_RESULTS_AFTER_LIMIT', + self::MORE_RESULTS_AFTER_CURSOR => 'MORE_RESULTS_AFTER_CURSOR', + self::NO_MORE_RESULTS => 'NO_MORE_RESULTS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MoreResultsType::class, \Google\Cloud\Datastore\V1\QueryResultBatch_MoreResultsType::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions.php new file mode 100644 index 000000000000..8de51a5f93b4 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions.php @@ -0,0 +1,207 @@ +google.datastore.v1.ReadOptions + */ +class ReadOptions extends \Google\Protobuf\Internal\Message +{ + protected $consistency_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $read_consistency + * The non-transactional read consistency to use. + * @type string $transaction + * The identifier of the transaction in which to read. A + * transaction identifier is returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * @type \Google\Cloud\Datastore\V1\TransactionOptions $new_transaction + * Options for beginning a new transaction for this request. + * The new transaction identifier will be returned in the corresponding + * response as either + * [LookupResponse.transaction][google.datastore.v1.LookupResponse.transaction] + * or + * [RunQueryResponse.transaction][google.datastore.v1.RunQueryResponse.transaction]. + * @type \Google\Protobuf\Timestamp $read_time + * Reads entities as they were at the given time. This value is only + * supported for Cloud Firestore in Datastore mode. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * The non-transactional read consistency to use. + * + * Generated from protobuf field .google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1; + * @return int + */ + public function getReadConsistency() + { + return $this->readOneof(1); + } + + public function hasReadConsistency() + { + return $this->hasOneof(1); + } + + /** + * The non-transactional read consistency to use. + * + * Generated from protobuf field .google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1; + * @param int $var + * @return $this + */ + public function setReadConsistency($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\ReadOptions\ReadConsistency::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The identifier of the transaction in which to read. A + * transaction identifier is returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * + * Generated from protobuf field bytes transaction = 2; + * @return string + */ + public function getTransaction() + { + return $this->readOneof(2); + } + + public function hasTransaction() + { + return $this->hasOneof(2); + } + + /** + * The identifier of the transaction in which to read. A + * transaction identifier is returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * + * Generated from protobuf field bytes transaction = 2; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Options for beginning a new transaction for this request. + * The new transaction identifier will be returned in the corresponding + * response as either + * [LookupResponse.transaction][google.datastore.v1.LookupResponse.transaction] + * or + * [RunQueryResponse.transaction][google.datastore.v1.RunQueryResponse.transaction]. + * + * Generated from protobuf field .google.datastore.v1.TransactionOptions new_transaction = 3; + * @return \Google\Cloud\Datastore\V1\TransactionOptions|null + */ + public function getNewTransaction() + { + return $this->readOneof(3); + } + + public function hasNewTransaction() + { + return $this->hasOneof(3); + } + + /** + * Options for beginning a new transaction for this request. + * The new transaction identifier will be returned in the corresponding + * response as either + * [LookupResponse.transaction][google.datastore.v1.LookupResponse.transaction] + * or + * [RunQueryResponse.transaction][google.datastore.v1.RunQueryResponse.transaction]. + * + * Generated from protobuf field .google.datastore.v1.TransactionOptions new_transaction = 3; + * @param \Google\Cloud\Datastore\V1\TransactionOptions $var + * @return $this + */ + public function setNewTransaction($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\TransactionOptions::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Reads entities as they were at the given time. This value is only + * supported for Cloud Firestore in Datastore mode. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->readOneof(4); + } + + public function hasReadTime() + { + return $this->hasOneof(4); + } + + /** + * Reads entities as they were at the given time. This value is only + * supported for Cloud Firestore in Datastore mode. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * @return string + */ + public function getConsistencyType() + { + return $this->whichOneof("consistency_type"); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions/ReadConsistency.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions/ReadConsistency.php new file mode 100644 index 000000000000..631a403de9f1 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions/ReadConsistency.php @@ -0,0 +1,64 @@ +google.datastore.v1.ReadOptions.ReadConsistency + */ +class ReadConsistency +{ + /** + * Unspecified. This value must not be used. + * + * Generated from protobuf enum READ_CONSISTENCY_UNSPECIFIED = 0; + */ + const READ_CONSISTENCY_UNSPECIFIED = 0; + /** + * Strong consistency. + * + * Generated from protobuf enum STRONG = 1; + */ + const STRONG = 1; + /** + * Eventual consistency. + * + * Generated from protobuf enum EVENTUAL = 2; + */ + const EVENTUAL = 2; + + private static $valueToName = [ + self::READ_CONSISTENCY_UNSPECIFIED => 'READ_CONSISTENCY_UNSPECIFIED', + self::STRONG => 'STRONG', + self::EVENTUAL => 'EVENTUAL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReadConsistency::class, \Google\Cloud\Datastore\V1\ReadOptions_ReadConsistency::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsRequest.php new file mode 100644 index 000000000000..756b9acee543 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsRequest.php @@ -0,0 +1,164 @@ +google.datastore.v1.ReserveIdsRequest + */ +class ReserveIdsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + */ + protected $database_id = ''; + /** + * Required. A list of keys with complete key paths whose numeric IDs should + * not be auto-allocated. + * + * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + private $keys; + + /** + * @param string $projectId Required. The ID of the project against which to make the request. + * @param \Google\Cloud\Datastore\V1\Key[] $keys Required. A list of keys with complete key paths whose numeric IDs should + * not be auto-allocated. + * + * @return \Google\Cloud\Datastore\V1\ReserveIdsRequest + * + * @experimental + */ + public static function build(string $projectId, array $keys): self + { + return (new self()) + ->setProjectId($projectId) + ->setKeys($keys); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. The ID of the project against which to make the request. + * @type string $database_id + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $keys + * Required. A list of keys with complete key paths whose numeric IDs should + * not be auto-allocated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @return string + */ + public function getDatabaseId() + { + return $this->database_id; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @param string $var + * @return $this + */ + public function setDatabaseId($var) + { + GPBUtil::checkString($var, True); + $this->database_id = $var; + + return $this; + } + + /** + * Required. A list of keys with complete key paths whose numeric IDs should + * not be auto-allocated. + * + * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKeys() + { + return $this->keys; + } + + /** + * Required. A list of keys with complete key paths whose numeric IDs should + * not be auto-allocated. + * + * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKeys($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Key::class); + $this->keys = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsResponse.php new file mode 100644 index 000000000000..d890d0cbb735 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsResponse.php @@ -0,0 +1,34 @@ +google.datastore.v1.ReserveIdsResponse + */ +class ReserveIdsResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackRequest.php new file mode 100644 index 000000000000..8e823c1778c8 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackRequest.php @@ -0,0 +1,163 @@ +google.datastore.v1.RollbackRequest + */ +class RollbackRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + */ + protected $database_id = ''; + /** + * Required. The transaction identifier, returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * + * Generated from protobuf field bytes transaction = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $transaction = ''; + + /** + * @param string $projectId Required. The ID of the project against which to make the request. + * @param string $transaction Required. The transaction identifier, returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * + * @return \Google\Cloud\Datastore\V1\RollbackRequest + * + * @experimental + */ + public static function build(string $projectId, string $transaction): self + { + return (new self()) + ->setProjectId($projectId) + ->setTransaction($transaction); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. The ID of the project against which to make the request. + * @type string $database_id + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type string $transaction + * Required. The transaction identifier, returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @return string + */ + public function getDatabaseId() + { + return $this->database_id; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @param string $var + * @return $this + */ + public function setDatabaseId($var) + { + GPBUtil::checkString($var, True); + $this->database_id = $var; + + return $this; + } + + /** + * Required. The transaction identifier, returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * + * Generated from protobuf field bytes transaction = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getTransaction() + { + return $this->transaction; + } + + /** + * Required. The transaction identifier, returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * + * Generated from protobuf field bytes transaction = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->transaction = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackResponse.php new file mode 100644 index 000000000000..4a043aebfbd5 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackResponse.php @@ -0,0 +1,35 @@ +google.datastore.v1.RollbackResponse + */ +class RollbackResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryRequest.php new file mode 100644 index 000000000000..85f561b5e40b --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryRequest.php @@ -0,0 +1,333 @@ +google.datastore.v1.RunAggregationQueryRequest + */ +class RunAggregationQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + */ + protected $database_id = ''; + /** + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * + * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 2; + */ + protected $partition_id = null; + /** + * The options for this query. + * + * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; + */ + protected $read_options = null; + /** + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * Generated from protobuf field .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $explain_options = null; + protected $query_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. The ID of the project against which to make the request. + * @type string $database_id + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type \Google\Cloud\Datastore\V1\PartitionId $partition_id + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * @type \Google\Cloud\Datastore\V1\ReadOptions $read_options + * The options for this query. + * @type \Google\Cloud\Datastore\V1\AggregationQuery $aggregation_query + * The query to run. + * @type \Google\Cloud\Datastore\V1\GqlQuery $gql_query + * The GQL query to run. This query must be an aggregation query. + * @type \Google\Cloud\Datastore\V1\ExplainOptions $explain_options + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @return string + */ + public function getDatabaseId() + { + return $this->database_id; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @param string $var + * @return $this + */ + public function setDatabaseId($var) + { + GPBUtil::checkString($var, True); + $this->database_id = $var; + + return $this; + } + + /** + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * + * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 2; + * @return \Google\Cloud\Datastore\V1\PartitionId|null + */ + public function getPartitionId() + { + return $this->partition_id; + } + + public function hasPartitionId() + { + return isset($this->partition_id); + } + + public function clearPartitionId() + { + unset($this->partition_id); + } + + /** + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * + * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 2; + * @param \Google\Cloud\Datastore\V1\PartitionId $var + * @return $this + */ + public function setPartitionId($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PartitionId::class); + $this->partition_id = $var; + + return $this; + } + + /** + * The options for this query. + * + * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; + * @return \Google\Cloud\Datastore\V1\ReadOptions|null + */ + public function getReadOptions() + { + return $this->read_options; + } + + public function hasReadOptions() + { + return isset($this->read_options); + } + + public function clearReadOptions() + { + unset($this->read_options); + } + + /** + * The options for this query. + * + * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; + * @param \Google\Cloud\Datastore\V1\ReadOptions $var + * @return $this + */ + public function setReadOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ReadOptions::class); + $this->read_options = $var; + + return $this; + } + + /** + * The query to run. + * + * Generated from protobuf field .google.datastore.v1.AggregationQuery aggregation_query = 3; + * @return \Google\Cloud\Datastore\V1\AggregationQuery|null + */ + public function getAggregationQuery() + { + return $this->readOneof(3); + } + + public function hasAggregationQuery() + { + return $this->hasOneof(3); + } + + /** + * The query to run. + * + * Generated from protobuf field .google.datastore.v1.AggregationQuery aggregation_query = 3; + * @param \Google\Cloud\Datastore\V1\AggregationQuery $var + * @return $this + */ + public function setAggregationQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\AggregationQuery::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The GQL query to run. This query must be an aggregation query. + * + * Generated from protobuf field .google.datastore.v1.GqlQuery gql_query = 7; + * @return \Google\Cloud\Datastore\V1\GqlQuery|null + */ + public function getGqlQuery() + { + return $this->readOneof(7); + } + + public function hasGqlQuery() + { + return $this->hasOneof(7); + } + + /** + * The GQL query to run. This query must be an aggregation query. + * + * Generated from protobuf field .google.datastore.v1.GqlQuery gql_query = 7; + * @param \Google\Cloud\Datastore\V1\GqlQuery $var + * @return $this + */ + public function setGqlQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\GqlQuery::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * Generated from protobuf field .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Datastore\V1\ExplainOptions|null + */ + public function getExplainOptions() + { + return $this->explain_options; + } + + public function hasExplainOptions() + { + return isset($this->explain_options); + } + + public function clearExplainOptions() + { + unset($this->explain_options); + } + + /** + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * Generated from protobuf field .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Datastore\V1\ExplainOptions $var + * @return $this + */ + public function setExplainOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ExplainOptions::class); + $this->explain_options = $var; + + return $this; + } + + /** + * @return string + */ + public function getQueryType() + { + return $this->whichOneof("query_type"); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryResponse.php new file mode 100644 index 000000000000..0ebff5e68fa2 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryResponse.php @@ -0,0 +1,228 @@ +google.datastore.v1.RunAggregationQueryResponse + */ +class RunAggregationQueryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A batch of aggregation results. Always present. + * + * Generated from protobuf field .google.datastore.v1.AggregationResultBatch batch = 1; + */ + protected $batch = null; + /** + * The parsed form of the `GqlQuery` from the request, if it was set. + * + * Generated from protobuf field .google.datastore.v1.AggregationQuery query = 2; + */ + protected $query = null; + /** + * The identifier of the transaction that was started as part of this + * RunAggregationQuery request. + * Set only when + * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] + * was set in + * [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options]. + * + * Generated from protobuf field bytes transaction = 5; + */ + protected $transaction = ''; + /** + * Query explain metrics. This is only present when the + * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * + * Generated from protobuf field .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + protected $explain_metrics = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\AggregationResultBatch $batch + * A batch of aggregation results. Always present. + * @type \Google\Cloud\Datastore\V1\AggregationQuery $query + * The parsed form of the `GqlQuery` from the request, if it was set. + * @type string $transaction + * The identifier of the transaction that was started as part of this + * RunAggregationQuery request. + * Set only when + * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] + * was set in + * [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options]. + * @type \Google\Cloud\Datastore\V1\ExplainMetrics $explain_metrics + * Query explain metrics. This is only present when the + * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * A batch of aggregation results. Always present. + * + * Generated from protobuf field .google.datastore.v1.AggregationResultBatch batch = 1; + * @return \Google\Cloud\Datastore\V1\AggregationResultBatch|null + */ + public function getBatch() + { + return $this->batch; + } + + public function hasBatch() + { + return isset($this->batch); + } + + public function clearBatch() + { + unset($this->batch); + } + + /** + * A batch of aggregation results. Always present. + * + * Generated from protobuf field .google.datastore.v1.AggregationResultBatch batch = 1; + * @param \Google\Cloud\Datastore\V1\AggregationResultBatch $var + * @return $this + */ + public function setBatch($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\AggregationResultBatch::class); + $this->batch = $var; + + return $this; + } + + /** + * The parsed form of the `GqlQuery` from the request, if it was set. + * + * Generated from protobuf field .google.datastore.v1.AggregationQuery query = 2; + * @return \Google\Cloud\Datastore\V1\AggregationQuery|null + */ + public function getQuery() + { + return $this->query; + } + + public function hasQuery() + { + return isset($this->query); + } + + public function clearQuery() + { + unset($this->query); + } + + /** + * The parsed form of the `GqlQuery` from the request, if it was set. + * + * Generated from protobuf field .google.datastore.v1.AggregationQuery query = 2; + * @param \Google\Cloud\Datastore\V1\AggregationQuery $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\AggregationQuery::class); + $this->query = $var; + + return $this; + } + + /** + * The identifier of the transaction that was started as part of this + * RunAggregationQuery request. + * Set only when + * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] + * was set in + * [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options]. + * + * Generated from protobuf field bytes transaction = 5; + * @return string + */ + public function getTransaction() + { + return $this->transaction; + } + + /** + * The identifier of the transaction that was started as part of this + * RunAggregationQuery request. + * Set only when + * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] + * was set in + * [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options]. + * + * Generated from protobuf field bytes transaction = 5; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->transaction = $var; + + return $this; + } + + /** + * Query explain metrics. This is only present when the + * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * + * Generated from protobuf field .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * @return \Google\Cloud\Datastore\V1\ExplainMetrics|null + */ + public function getExplainMetrics() + { + return $this->explain_metrics; + } + + public function hasExplainMetrics() + { + return isset($this->explain_metrics); + } + + public function clearExplainMetrics() + { + unset($this->explain_metrics); + } + + /** + * Query explain metrics. This is only present when the + * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * + * Generated from protobuf field .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * @param \Google\Cloud\Datastore\V1\ExplainMetrics $var + * @return $this + */ + public function setExplainMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ExplainMetrics::class); + $this->explain_metrics = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryRequest.php new file mode 100644 index 000000000000..a622f98a1e1e --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryRequest.php @@ -0,0 +1,388 @@ +google.datastore.v1.RunQueryRequest + */ +class RunQueryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + */ + protected $database_id = ''; + /** + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * + * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 2; + */ + protected $partition_id = null; + /** + * The options for this query. + * + * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; + */ + protected $read_options = null; + /** + * The properties to return. + * This field must not be set for a projection query. + * See + * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 10; + */ + protected $property_mask = null; + /** + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * Generated from protobuf field .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $explain_options = null; + protected $query_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. The ID of the project against which to make the request. + * @type string $database_id + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type \Google\Cloud\Datastore\V1\PartitionId $partition_id + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * @type \Google\Cloud\Datastore\V1\ReadOptions $read_options + * The options for this query. + * @type \Google\Cloud\Datastore\V1\Query $query + * The query to run. + * @type \Google\Cloud\Datastore\V1\GqlQuery $gql_query + * The GQL query to run. This query must be a non-aggregation query. + * @type \Google\Cloud\Datastore\V1\PropertyMask $property_mask + * The properties to return. + * This field must not be set for a projection query. + * See + * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. + * @type \Google\Cloud\Datastore\V1\ExplainOptions $explain_options + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. The ID of the project against which to make the request. + * + * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @return string + */ + public function getDatabaseId() + { + return $this->database_id; + } + + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * + * Generated from protobuf field string database_id = 9; + * @param string $var + * @return $this + */ + public function setDatabaseId($var) + { + GPBUtil::checkString($var, True); + $this->database_id = $var; + + return $this; + } + + /** + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * + * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 2; + * @return \Google\Cloud\Datastore\V1\PartitionId|null + */ + public function getPartitionId() + { + return $this->partition_id; + } + + public function hasPartitionId() + { + return isset($this->partition_id); + } + + public function clearPartitionId() + { + unset($this->partition_id); + } + + /** + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * + * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 2; + * @param \Google\Cloud\Datastore\V1\PartitionId $var + * @return $this + */ + public function setPartitionId($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PartitionId::class); + $this->partition_id = $var; + + return $this; + } + + /** + * The options for this query. + * + * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; + * @return \Google\Cloud\Datastore\V1\ReadOptions|null + */ + public function getReadOptions() + { + return $this->read_options; + } + + public function hasReadOptions() + { + return isset($this->read_options); + } + + public function clearReadOptions() + { + unset($this->read_options); + } + + /** + * The options for this query. + * + * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; + * @param \Google\Cloud\Datastore\V1\ReadOptions $var + * @return $this + */ + public function setReadOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ReadOptions::class); + $this->read_options = $var; + + return $this; + } + + /** + * The query to run. + * + * Generated from protobuf field .google.datastore.v1.Query query = 3; + * @return \Google\Cloud\Datastore\V1\Query|null + */ + public function getQuery() + { + return $this->readOneof(3); + } + + public function hasQuery() + { + return $this->hasOneof(3); + } + + /** + * The query to run. + * + * Generated from protobuf field .google.datastore.v1.Query query = 3; + * @param \Google\Cloud\Datastore\V1\Query $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Query::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * The GQL query to run. This query must be a non-aggregation query. + * + * Generated from protobuf field .google.datastore.v1.GqlQuery gql_query = 7; + * @return \Google\Cloud\Datastore\V1\GqlQuery|null + */ + public function getGqlQuery() + { + return $this->readOneof(7); + } + + public function hasGqlQuery() + { + return $this->hasOneof(7); + } + + /** + * The GQL query to run. This query must be a non-aggregation query. + * + * Generated from protobuf field .google.datastore.v1.GqlQuery gql_query = 7; + * @param \Google\Cloud\Datastore\V1\GqlQuery $var + * @return $this + */ + public function setGqlQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\GqlQuery::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * The properties to return. + * This field must not be set for a projection query. + * See + * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 10; + * @return \Google\Cloud\Datastore\V1\PropertyMask|null + */ + public function getPropertyMask() + { + return $this->property_mask; + } + + public function hasPropertyMask() + { + return isset($this->property_mask); + } + + public function clearPropertyMask() + { + unset($this->property_mask); + } + + /** + * The properties to return. + * This field must not be set for a projection query. + * See + * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. + * + * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 10; + * @param \Google\Cloud\Datastore\V1\PropertyMask $var + * @return $this + */ + public function setPropertyMask($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyMask::class); + $this->property_mask = $var; + + return $this; + } + + /** + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * Generated from protobuf field .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Datastore\V1\ExplainOptions|null + */ + public function getExplainOptions() + { + return $this->explain_options; + } + + public function hasExplainOptions() + { + return isset($this->explain_options); + } + + public function clearExplainOptions() + { + unset($this->explain_options); + } + + /** + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * + * Generated from protobuf field .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Datastore\V1\ExplainOptions $var + * @return $this + */ + public function setExplainOptions($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ExplainOptions::class); + $this->explain_options = $var; + + return $this; + } + + /** + * @return string + */ + public function getQueryType() + { + return $this->whichOneof("query_type"); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryResponse.php new file mode 100644 index 000000000000..752570362949 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryResponse.php @@ -0,0 +1,228 @@ +google.datastore.v1.RunQueryResponse + */ +class RunQueryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * A batch of query results (always present). + * + * Generated from protobuf field .google.datastore.v1.QueryResultBatch batch = 1; + */ + protected $batch = null; + /** + * The parsed form of the `GqlQuery` from the request, if it was set. + * + * Generated from protobuf field .google.datastore.v1.Query query = 2; + */ + protected $query = null; + /** + * The identifier of the transaction that was started as part of this + * RunQuery request. + * Set only when + * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] + * was set in + * [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options]. + * + * Generated from protobuf field bytes transaction = 5; + */ + protected $transaction = ''; + /** + * Query explain metrics. This is only present when the + * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * + * Generated from protobuf field .google.datastore.v1.ExplainMetrics explain_metrics = 9; + */ + protected $explain_metrics = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\QueryResultBatch $batch + * A batch of query results (always present). + * @type \Google\Cloud\Datastore\V1\Query $query + * The parsed form of the `GqlQuery` from the request, if it was set. + * @type string $transaction + * The identifier of the transaction that was started as part of this + * RunQuery request. + * Set only when + * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] + * was set in + * [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options]. + * @type \Google\Cloud\Datastore\V1\ExplainMetrics $explain_metrics + * Query explain metrics. This is only present when the + * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * A batch of query results (always present). + * + * Generated from protobuf field .google.datastore.v1.QueryResultBatch batch = 1; + * @return \Google\Cloud\Datastore\V1\QueryResultBatch|null + */ + public function getBatch() + { + return $this->batch; + } + + public function hasBatch() + { + return isset($this->batch); + } + + public function clearBatch() + { + unset($this->batch); + } + + /** + * A batch of query results (always present). + * + * Generated from protobuf field .google.datastore.v1.QueryResultBatch batch = 1; + * @param \Google\Cloud\Datastore\V1\QueryResultBatch $var + * @return $this + */ + public function setBatch($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\QueryResultBatch::class); + $this->batch = $var; + + return $this; + } + + /** + * The parsed form of the `GqlQuery` from the request, if it was set. + * + * Generated from protobuf field .google.datastore.v1.Query query = 2; + * @return \Google\Cloud\Datastore\V1\Query|null + */ + public function getQuery() + { + return $this->query; + } + + public function hasQuery() + { + return isset($this->query); + } + + public function clearQuery() + { + unset($this->query); + } + + /** + * The parsed form of the `GqlQuery` from the request, if it was set. + * + * Generated from protobuf field .google.datastore.v1.Query query = 2; + * @param \Google\Cloud\Datastore\V1\Query $var + * @return $this + */ + public function setQuery($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Query::class); + $this->query = $var; + + return $this; + } + + /** + * The identifier of the transaction that was started as part of this + * RunQuery request. + * Set only when + * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] + * was set in + * [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options]. + * + * Generated from protobuf field bytes transaction = 5; + * @return string + */ + public function getTransaction() + { + return $this->transaction; + } + + /** + * The identifier of the transaction that was started as part of this + * RunQuery request. + * Set only when + * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] + * was set in + * [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options]. + * + * Generated from protobuf field bytes transaction = 5; + * @param string $var + * @return $this + */ + public function setTransaction($var) + { + GPBUtil::checkString($var, False); + $this->transaction = $var; + + return $this; + } + + /** + * Query explain metrics. This is only present when the + * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * + * Generated from protobuf field .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * @return \Google\Cloud\Datastore\V1\ExplainMetrics|null + */ + public function getExplainMetrics() + { + return $this->explain_metrics; + } + + public function hasExplainMetrics() + { + return isset($this->explain_metrics); + } + + public function clearExplainMetrics() + { + unset($this->explain_metrics); + } + + /** + * Query explain metrics. This is only present when the + * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options] + * is provided, and it is sent only once with the last response in the stream. + * + * Generated from protobuf field .google.datastore.v1.ExplainMetrics explain_metrics = 9; + * @param \Google\Cloud\Datastore\V1\ExplainMetrics $var + * @return $this + */ + public function setExplainMetrics($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ExplainMetrics::class); + $this->explain_metrics = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions.php new file mode 100644 index 000000000000..f1d2d422af6d --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions.php @@ -0,0 +1,113 @@ +google.datastore.v1.TransactionOptions + */ +class TransactionOptions extends \Google\Protobuf\Internal\Message +{ + protected $mode; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite $read_write + * The transaction should allow both reads and writes. + * @type \Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly $read_only + * The transaction should only allow reads. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * The transaction should allow both reads and writes. + * + * Generated from protobuf field .google.datastore.v1.TransactionOptions.ReadWrite read_write = 1; + * @return \Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite|null + */ + public function getReadWrite() + { + return $this->readOneof(1); + } + + public function hasReadWrite() + { + return $this->hasOneof(1); + } + + /** + * The transaction should allow both reads and writes. + * + * Generated from protobuf field .google.datastore.v1.TransactionOptions.ReadWrite read_write = 1; + * @param \Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite $var + * @return $this + */ + public function setReadWrite($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * The transaction should only allow reads. + * + * Generated from protobuf field .google.datastore.v1.TransactionOptions.ReadOnly read_only = 2; + * @return \Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly|null + */ + public function getReadOnly() + { + return $this->readOneof(2); + } + + public function hasReadOnly() + { + return $this->hasOneof(2); + } + + /** + * The transaction should only allow reads. + * + * Generated from protobuf field .google.datastore.v1.TransactionOptions.ReadOnly read_only = 2; + * @param \Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly $var + * @return $this + */ + public function setReadOnly($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * @return string + */ + public function getMode() + { + return $this->whichOneof("mode"); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/PBReadOnly.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/PBReadOnly.php new file mode 100644 index 000000000000..77e0b253f413 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/PBReadOnly.php @@ -0,0 +1,95 @@ +google.datastore.v1.TransactionOptions.ReadOnly + */ +class PBReadOnly extends \Google\Protobuf\Internal\Message +{ + /** + * Reads entities at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 1; + */ + protected $read_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $read_time + * Reads entities at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * Reads entities at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getReadTime() + { + return $this->read_time; + } + + public function hasReadTime() + { + return isset($this->read_time); + } + + public function clearReadTime() + { + unset($this->read_time); + } + + /** + * Reads entities at the given time. + * This must be a microsecond precision timestamp within the past one hour, + * or if Point-in-Time Recovery is enabled, can additionally be a whole + * minute timestamp within the past 7 days. + * + * Generated from protobuf field .google.protobuf.Timestamp read_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setReadTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->read_time = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PBReadOnly::class, \Google\Cloud\Datastore\V1\TransactionOptions_ReadOnly::class); + +// Adding a class alias for backwards compatibility with the "readonly" keyword. +class_alias(PBReadOnly::class, __NAMESPACE__ . '\ReadOnly'); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/ReadOnly.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/ReadOnly.php new file mode 100644 index 000000000000..f6ef4bbabdcc --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/ReadOnly.php @@ -0,0 +1,9 @@ +google.datastore.v1.TransactionOptions.ReadWrite + */ +class ReadWrite extends \Google\Protobuf\Internal\Message +{ + /** + * The transaction identifier of the transaction being retried. + * + * Generated from protobuf field bytes previous_transaction = 1; + */ + protected $previous_transaction = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $previous_transaction + * The transaction identifier of the transaction being retried. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); + parent::__construct($data); + } + + /** + * The transaction identifier of the transaction being retried. + * + * Generated from protobuf field bytes previous_transaction = 1; + * @return string + */ + public function getPreviousTransaction() + { + return $this->previous_transaction; + } + + /** + * The transaction identifier of the transaction being retried. + * + * Generated from protobuf field bytes previous_transaction = 1; + * @param string $var + * @return $this + */ + public function setPreviousTransaction($var) + { + GPBUtil::checkString($var, False); + $this->previous_transaction = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ReadWrite::class, \Google\Cloud\Datastore\V1\TransactionOptions_ReadWrite::class); + diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Value.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Value.php new file mode 100644 index 000000000000..2b2ef2edcd88 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Value.php @@ -0,0 +1,517 @@ +google.datastore.v1.Value + */ +class Value extends \Google\Protobuf\Internal\Message +{ + /** + * The `meaning` field should only be populated for backwards compatibility. + * + * Generated from protobuf field int32 meaning = 14; + */ + protected $meaning = 0; + /** + * If the value should be excluded from all indexes including those defined + * explicitly. + * + * Generated from protobuf field bool exclude_from_indexes = 19; + */ + protected $exclude_from_indexes = false; + protected $value_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $null_value + * A null value. + * @type bool $boolean_value + * A boolean value. + * @type int|string $integer_value + * An integer value. + * @type float $double_value + * A double value. + * @type \Google\Protobuf\Timestamp $timestamp_value + * A timestamp value. + * When stored in the Datastore, precise only to microseconds; + * any additional precision is rounded down. + * @type \Google\Cloud\Datastore\V1\Key $key_value + * A key value. + * @type string $string_value + * A UTF-8 encoded string value. + * When `exclude_from_indexes` is false (it is indexed) , may have at most + * 1500 bytes. Otherwise, may be set to at most 1,000,000 bytes. + * @type string $blob_value + * A blob value. + * May have at most 1,000,000 bytes. + * When `exclude_from_indexes` is false, may have at most 1500 bytes. + * In JSON requests, must be base64-encoded. + * @type \Google\Type\LatLng $geo_point_value + * A geo point value representing a point on the surface of Earth. + * @type \Google\Cloud\Datastore\V1\Entity $entity_value + * An entity value. + * - May have no key. + * - May have a key with an incomplete key path. + * - May have a reserved/read-only key. + * @type \Google\Cloud\Datastore\V1\ArrayValue $array_value + * An array value. + * Cannot contain another array value. + * A `Value` instance that sets field `array_value` must not set fields + * `meaning` or `exclude_from_indexes`. + * @type int $meaning + * The `meaning` field should only be populated for backwards compatibility. + * @type bool $exclude_from_indexes + * If the value should be excluded from all indexes including those defined + * explicitly. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\V1\Entity::initOnce(); + parent::__construct($data); + } + + /** + * A null value. + * + * Generated from protobuf field .google.protobuf.NullValue null_value = 11; + * @return int + */ + public function getNullValue() + { + return $this->readOneof(11); + } + + public function hasNullValue() + { + return $this->hasOneof(11); + } + + /** + * A null value. + * + * Generated from protobuf field .google.protobuf.NullValue null_value = 11; + * @param int $var + * @return $this + */ + public function setNullValue($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\NullValue::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * A boolean value. + * + * Generated from protobuf field bool boolean_value = 1; + * @return bool + */ + public function getBooleanValue() + { + return $this->readOneof(1); + } + + public function hasBooleanValue() + { + return $this->hasOneof(1); + } + + /** + * A boolean value. + * + * Generated from protobuf field bool boolean_value = 1; + * @param bool $var + * @return $this + */ + public function setBooleanValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * An integer value. + * + * Generated from protobuf field int64 integer_value = 2; + * @return int|string + */ + public function getIntegerValue() + { + return $this->readOneof(2); + } + + public function hasIntegerValue() + { + return $this->hasOneof(2); + } + + /** + * An integer value. + * + * Generated from protobuf field int64 integer_value = 2; + * @param int|string $var + * @return $this + */ + public function setIntegerValue($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * A double value. + * + * Generated from protobuf field double double_value = 3; + * @return float + */ + public function getDoubleValue() + { + return $this->readOneof(3); + } + + public function hasDoubleValue() + { + return $this->hasOneof(3); + } + + /** + * A double value. + * + * Generated from protobuf field double double_value = 3; + * @param float $var + * @return $this + */ + public function setDoubleValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * A timestamp value. + * When stored in the Datastore, precise only to microseconds; + * any additional precision is rounded down. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 10; + * @return \Google\Protobuf\Timestamp|null + */ + public function getTimestampValue() + { + return $this->readOneof(10); + } + + public function hasTimestampValue() + { + return $this->hasOneof(10); + } + + /** + * A timestamp value. + * When stored in the Datastore, precise only to microseconds; + * any additional precision is rounded down. + * + * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 10; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setTimestampValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * A key value. + * + * Generated from protobuf field .google.datastore.v1.Key key_value = 5; + * @return \Google\Cloud\Datastore\V1\Key|null + */ + public function getKeyValue() + { + return $this->readOneof(5); + } + + public function hasKeyValue() + { + return $this->hasOneof(5); + } + + /** + * A key value. + * + * Generated from protobuf field .google.datastore.v1.Key key_value = 5; + * @param \Google\Cloud\Datastore\V1\Key $var + * @return $this + */ + public function setKeyValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Key::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * A UTF-8 encoded string value. + * When `exclude_from_indexes` is false (it is indexed) , may have at most + * 1500 bytes. Otherwise, may be set to at most 1,000,000 bytes. + * + * Generated from protobuf field string string_value = 17; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(17); + } + + public function hasStringValue() + { + return $this->hasOneof(17); + } + + /** + * A UTF-8 encoded string value. + * When `exclude_from_indexes` is false (it is indexed) , may have at most + * 1500 bytes. Otherwise, may be set to at most 1,000,000 bytes. + * + * Generated from protobuf field string string_value = 17; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(17, $var); + + return $this; + } + + /** + * A blob value. + * May have at most 1,000,000 bytes. + * When `exclude_from_indexes` is false, may have at most 1500 bytes. + * In JSON requests, must be base64-encoded. + * + * Generated from protobuf field bytes blob_value = 18; + * @return string + */ + public function getBlobValue() + { + return $this->readOneof(18); + } + + public function hasBlobValue() + { + return $this->hasOneof(18); + } + + /** + * A blob value. + * May have at most 1,000,000 bytes. + * When `exclude_from_indexes` is false, may have at most 1500 bytes. + * In JSON requests, must be base64-encoded. + * + * Generated from protobuf field bytes blob_value = 18; + * @param string $var + * @return $this + */ + public function setBlobValue($var) + { + GPBUtil::checkString($var, False); + $this->writeOneof(18, $var); + + return $this; + } + + /** + * A geo point value representing a point on the surface of Earth. + * + * Generated from protobuf field .google.type.LatLng geo_point_value = 8; + * @return \Google\Type\LatLng|null + */ + public function getGeoPointValue() + { + return $this->readOneof(8); + } + + public function hasGeoPointValue() + { + return $this->hasOneof(8); + } + + /** + * A geo point value representing a point on the surface of Earth. + * + * Generated from protobuf field .google.type.LatLng geo_point_value = 8; + * @param \Google\Type\LatLng $var + * @return $this + */ + public function setGeoPointValue($var) + { + GPBUtil::checkMessage($var, \Google\Type\LatLng::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * An entity value. + * - May have no key. + * - May have a key with an incomplete key path. + * - May have a reserved/read-only key. + * + * Generated from protobuf field .google.datastore.v1.Entity entity_value = 6; + * @return \Google\Cloud\Datastore\V1\Entity|null + */ + public function getEntityValue() + { + return $this->readOneof(6); + } + + public function hasEntityValue() + { + return $this->hasOneof(6); + } + + /** + * An entity value. + * - May have no key. + * - May have a key with an incomplete key path. + * - May have a reserved/read-only key. + * + * Generated from protobuf field .google.datastore.v1.Entity entity_value = 6; + * @param \Google\Cloud\Datastore\V1\Entity $var + * @return $this + */ + public function setEntityValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Entity::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * An array value. + * Cannot contain another array value. + * A `Value` instance that sets field `array_value` must not set fields + * `meaning` or `exclude_from_indexes`. + * + * Generated from protobuf field .google.datastore.v1.ArrayValue array_value = 9; + * @return \Google\Cloud\Datastore\V1\ArrayValue|null + */ + public function getArrayValue() + { + return $this->readOneof(9); + } + + public function hasArrayValue() + { + return $this->hasOneof(9); + } + + /** + * An array value. + * Cannot contain another array value. + * A `Value` instance that sets field `array_value` must not set fields + * `meaning` or `exclude_from_indexes`. + * + * Generated from protobuf field .google.datastore.v1.ArrayValue array_value = 9; + * @param \Google\Cloud\Datastore\V1\ArrayValue $var + * @return $this + */ + public function setArrayValue($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ArrayValue::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * The `meaning` field should only be populated for backwards compatibility. + * + * Generated from protobuf field int32 meaning = 14; + * @return int + */ + public function getMeaning() + { + return $this->meaning; + } + + /** + * The `meaning` field should only be populated for backwards compatibility. + * + * Generated from protobuf field int32 meaning = 14; + * @param int $var + * @return $this + */ + public function setMeaning($var) + { + GPBUtil::checkInt32($var); + $this->meaning = $var; + + return $this; + } + + /** + * If the value should be excluded from all indexes including those defined + * explicitly. + * + * Generated from protobuf field bool exclude_from_indexes = 19; + * @return bool + */ + public function getExcludeFromIndexes() + { + return $this->exclude_from_indexes; + } + + /** + * If the value should be excluded from all indexes including those defined + * explicitly. + * + * Generated from protobuf field bool exclude_from_indexes = 19; + * @param bool $var + * @return $this + */ + public function setExcludeFromIndexes($var) + { + GPBUtil::checkBool($var); + $this->exclude_from_indexes = $var; + + return $this; + } + + /** + * @return string + */ + public function getValueType() + { + return $this->whichOneof("value_type"); + } + +} + diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/allocate_ids.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/allocate_ids.php new file mode 100644 index 000000000000..f7de5fa7ff80 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/allocate_ids.php @@ -0,0 +1,74 @@ +setProjectId($projectId) + ->setKeys($keys); + + // Call the API and handle any network failures. + try { + /** @var AllocateIdsResponse $response */ + $response = $datastoreClient->allocateIds($request); + 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 +{ + $projectId = '[PROJECT_ID]'; + + allocate_ids_sample($projectId); +} +// [END datastore_v1_generated_Datastore_AllocateIds_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/begin_transaction.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/begin_transaction.php new file mode 100644 index 000000000000..ab644ee65011 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/begin_transaction.php @@ -0,0 +1,70 @@ +setProjectId($projectId); + + // Call the API and handle any network failures. + try { + /** @var BeginTransactionResponse $response */ + $response = $datastoreClient->beginTransaction($request); + 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 +{ + $projectId = '[PROJECT_ID]'; + + begin_transaction_sample($projectId); +} +// [END datastore_v1_generated_Datastore_BeginTransaction_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/commit.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/commit.php new file mode 100644 index 000000000000..fd3d7d4a7577 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/commit.php @@ -0,0 +1,78 @@ +setProjectId($projectId) + ->setMode($mode) + ->setMutations($mutations); + + // Call the API and handle any network failures. + try { + /** @var CommitResponse $response */ + $response = $datastoreClient->commit($request); + 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 +{ + $projectId = '[PROJECT_ID]'; + $mode = Mode::MODE_UNSPECIFIED; + + commit_sample($projectId, $mode); +} +// [END datastore_v1_generated_Datastore_Commit_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/lookup.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/lookup.php new file mode 100644 index 000000000000..ecfeb42175fa --- /dev/null +++ b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/lookup.php @@ -0,0 +1,73 @@ +setProjectId($projectId) + ->setKeys($keys); + + // Call the API and handle any network failures. + try { + /** @var LookupResponse $response */ + $response = $datastoreClient->lookup($request); + 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 +{ + $projectId = '[PROJECT_ID]'; + + lookup_sample($projectId); +} +// [END datastore_v1_generated_Datastore_Lookup_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/reserve_ids.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/reserve_ids.php new file mode 100644 index 000000000000..3fce8684f055 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/reserve_ids.php @@ -0,0 +1,74 @@ +setProjectId($projectId) + ->setKeys($keys); + + // Call the API and handle any network failures. + try { + /** @var ReserveIdsResponse $response */ + $response = $datastoreClient->reserveIds($request); + 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 +{ + $projectId = '[PROJECT_ID]'; + + reserve_ids_sample($projectId); +} +// [END datastore_v1_generated_Datastore_ReserveIds_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/rollback.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/rollback.php new file mode 100644 index 000000000000..657d32ada50e --- /dev/null +++ b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/rollback.php @@ -0,0 +1,74 @@ +setProjectId($projectId) + ->setTransaction($transaction); + + // Call the API and handle any network failures. + try { + /** @var RollbackResponse $response */ + $response = $datastoreClient->rollback($request); + 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 +{ + $projectId = '[PROJECT_ID]'; + $transaction = '...'; + + rollback_sample($projectId, $transaction); +} +// [END datastore_v1_generated_Datastore_Rollback_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_aggregation_query.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_aggregation_query.php new file mode 100644 index 000000000000..f7c99caf4ac4 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_aggregation_query.php @@ -0,0 +1,70 @@ +setProjectId($projectId); + + // Call the API and handle any network failures. + try { + /** @var RunAggregationQueryResponse $response */ + $response = $datastoreClient->runAggregationQuery($request); + 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 +{ + $projectId = '[PROJECT_ID]'; + + run_aggregation_query_sample($projectId); +} +// [END datastore_v1_generated_Datastore_RunAggregationQuery_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_query.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_query.php new file mode 100644 index 000000000000..0fe2c0b5e241 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_query.php @@ -0,0 +1,73 @@ +setProjectId($projectId) + ->setPartitionId($partitionId); + + // Call the API and handle any network failures. + try { + /** @var RunQueryResponse $response */ + $response = $datastoreClient->runQuery($request); + 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 +{ + $projectId = '[PROJECT_ID]'; + + run_query_sample($projectId); +} +// [END datastore_v1_generated_Datastore_RunQuery_sync] diff --git a/owl-bot-staging/Datastore/v1/src/V1/Client/DatastoreClient.php b/owl-bot-staging/Datastore/v1/src/V1/Client/DatastoreClient.php new file mode 100644 index 000000000000..4a343ecaca14 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/src/V1/Client/DatastoreClient.php @@ -0,0 +1,403 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/datastore_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/datastore_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/datastore_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/datastore_rest_client_config.php', + ], + ], + ]; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'datastore.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Allocates IDs for the given keys, which is useful for referencing an entity + * before it is inserted. + * + * The async variant is {@see DatastoreClient::allocateIdsAsync()} . + * + * @example samples/V1/DatastoreClient/allocate_ids.php + * + * @param AllocateIdsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return AllocateIdsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function allocateIds(AllocateIdsRequest $request, array $callOptions = []): AllocateIdsResponse + { + return $this->startApiCall('AllocateIds', $request, $callOptions)->wait(); + } + + /** + * Begins a new transaction. + * + * The async variant is {@see DatastoreClient::beginTransactionAsync()} . + * + * @example samples/V1/DatastoreClient/begin_transaction.php + * + * @param BeginTransactionRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return BeginTransactionResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function beginTransaction(BeginTransactionRequest $request, array $callOptions = []): BeginTransactionResponse + { + return $this->startApiCall('BeginTransaction', $request, $callOptions)->wait(); + } + + /** + * Commits a transaction, optionally creating, deleting or modifying some + * entities. + * + * The async variant is {@see DatastoreClient::commitAsync()} . + * + * @example samples/V1/DatastoreClient/commit.php + * + * @param CommitRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return CommitResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function commit(CommitRequest $request, array $callOptions = []): CommitResponse + { + return $this->startApiCall('Commit', $request, $callOptions)->wait(); + } + + /** + * Looks up entities by key. + * + * The async variant is {@see DatastoreClient::lookupAsync()} . + * + * @example samples/V1/DatastoreClient/lookup.php + * + * @param LookupRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return LookupResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function lookup(LookupRequest $request, array $callOptions = []): LookupResponse + { + return $this->startApiCall('Lookup', $request, $callOptions)->wait(); + } + + /** + * Prevents the supplied keys' IDs from being auto-allocated by Cloud + * Datastore. + * + * The async variant is {@see DatastoreClient::reserveIdsAsync()} . + * + * @example samples/V1/DatastoreClient/reserve_ids.php + * + * @param ReserveIdsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ReserveIdsResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function reserveIds(ReserveIdsRequest $request, array $callOptions = []): ReserveIdsResponse + { + return $this->startApiCall('ReserveIds', $request, $callOptions)->wait(); + } + + /** + * Rolls back a transaction. + * + * The async variant is {@see DatastoreClient::rollbackAsync()} . + * + * @example samples/V1/DatastoreClient/rollback.php + * + * @param RollbackRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return RollbackResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function rollback(RollbackRequest $request, array $callOptions = []): RollbackResponse + { + return $this->startApiCall('Rollback', $request, $callOptions)->wait(); + } + + /** + * Runs an aggregation query. + * + * The async variant is {@see DatastoreClient::runAggregationQueryAsync()} . + * + * @example samples/V1/DatastoreClient/run_aggregation_query.php + * + * @param RunAggregationQueryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return RunAggregationQueryResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function runAggregationQuery(RunAggregationQueryRequest $request, array $callOptions = []): RunAggregationQueryResponse + { + return $this->startApiCall('RunAggregationQuery', $request, $callOptions)->wait(); + } + + /** + * Queries for entities. + * + * The async variant is {@see DatastoreClient::runQueryAsync()} . + * + * @example samples/V1/DatastoreClient/run_query.php + * + * @param RunQueryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return RunQueryResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function runQuery(RunQueryRequest $request, array $callOptions = []): RunQueryResponse + { + return $this->startApiCall('RunQuery', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/Datastore/v1/src/V1/DatastoreClient.php b/owl-bot-staging/Datastore/v1/src/V1/DatastoreClient.php new file mode 100644 index 000000000000..5e5ff92d748a --- /dev/null +++ b/owl-bot-staging/Datastore/v1/src/V1/DatastoreClient.php @@ -0,0 +1,34 @@ +allocateIds($projectId, $keys); + * } finally { + * $datastoreClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\Datastore\V1\Client\DatastoreClient}. + */ +class DatastoreGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.datastore.v1.Datastore'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'datastore.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'datastore.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/datastore', + ]; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/datastore_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/datastore_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/datastore_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/datastore_rest_client_config.php', + ], + ], + ]; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'datastore.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Allocates IDs for the given keys, which is useful for referencing an entity + * before it is inserted. + * + * Sample code: + * ``` + * $datastoreClient = new DatastoreClient(); + * try { + * $projectId = 'project_id'; + * $keys = []; + * $response = $datastoreClient->allocateIds($projectId, $keys); + * } finally { + * $datastoreClient->close(); + * } + * ``` + * + * @param string $projectId Required. The ID of the project against which to make the request. + * @param Key[] $keys Required. A list of keys with incomplete key paths for which to allocate + * IDs. No key may be reserved/read-only. + * @param array $optionalArgs { + * Optional. + * + * @type string $databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Datastore\V1\AllocateIdsResponse + * + * @throws ApiException if the remote call fails + */ + public function allocateIds($projectId, $keys, array $optionalArgs = []) + { + $request = new AllocateIdsRequest(); + $requestParamHeaders = []; + $request->setProjectId($projectId); + $request->setKeys($keys); + $requestParamHeaders['project_id'] = $projectId; + if (isset($optionalArgs['databaseId'])) { + $request->setDatabaseId($optionalArgs['databaseId']); + $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('AllocateIds', AllocateIdsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Begins a new transaction. + * + * Sample code: + * ``` + * $datastoreClient = new DatastoreClient(); + * try { + * $projectId = 'project_id'; + * $response = $datastoreClient->beginTransaction($projectId); + * } finally { + * $datastoreClient->close(); + * } + * ``` + * + * @param string $projectId Required. The ID of the project against which to make the request. + * @param array $optionalArgs { + * Optional. + * + * @type string $databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type TransactionOptions $transactionOptions + * Options for a new transaction. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Datastore\V1\BeginTransactionResponse + * + * @throws ApiException if the remote call fails + */ + public function beginTransaction($projectId, array $optionalArgs = []) + { + $request = new BeginTransactionRequest(); + $requestParamHeaders = []; + $request->setProjectId($projectId); + $requestParamHeaders['project_id'] = $projectId; + if (isset($optionalArgs['databaseId'])) { + $request->setDatabaseId($optionalArgs['databaseId']); + $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; + } + + if (isset($optionalArgs['transactionOptions'])) { + $request->setTransactionOptions($optionalArgs['transactionOptions']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('BeginTransaction', BeginTransactionResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Commits a transaction, optionally creating, deleting or modifying some + * entities. + * + * Sample code: + * ``` + * $datastoreClient = new DatastoreClient(); + * try { + * $projectId = 'project_id'; + * $mode = Mode::MODE_UNSPECIFIED; + * $mutations = []; + * $response = $datastoreClient->commit($projectId, $mode, $mutations); + * } finally { + * $datastoreClient->close(); + * } + * ``` + * + * @param string $projectId Required. The ID of the project against which to make the request. + * @param int $mode The type of commit to perform. Defaults to `TRANSACTIONAL`. + * For allowed values, use constants defined on {@see \Google\Cloud\Datastore\V1\CommitRequest\Mode} + * @param Mutation[] $mutations The mutations to perform. + * + * When mode is `TRANSACTIONAL`, mutations affecting a single entity are + * applied in order. The following sequences of mutations affecting a single + * entity are not permitted in a single `Commit` request: + * + * - `insert` followed by `insert` + * - `update` followed by `insert` + * - `upsert` followed by `insert` + * - `delete` followed by `update` + * + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + * @param array $optionalArgs { + * Optional. + * + * @type string $databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type string $transaction + * The identifier of the transaction associated with the commit. A + * transaction identifier is returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * @type TransactionOptions $singleUseTransaction + * Options for beginning a new transaction for this request. + * The transaction is committed when the request completes. If specified, + * [TransactionOptions.mode][google.datastore.v1.TransactionOptions] must be + * [TransactionOptions.ReadWrite][google.datastore.v1.TransactionOptions.ReadWrite]. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Datastore\V1\CommitResponse + * + * @throws ApiException if the remote call fails + */ + public function commit($projectId, $mode, $mutations, array $optionalArgs = []) + { + $request = new CommitRequest(); + $requestParamHeaders = []; + $request->setProjectId($projectId); + $request->setMode($mode); + $request->setMutations($mutations); + $requestParamHeaders['project_id'] = $projectId; + if (isset($optionalArgs['databaseId'])) { + $request->setDatabaseId($optionalArgs['databaseId']); + $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; + } + + if (isset($optionalArgs['transaction'])) { + $request->setTransaction($optionalArgs['transaction']); + } + + if (isset($optionalArgs['singleUseTransaction'])) { + $request->setSingleUseTransaction($optionalArgs['singleUseTransaction']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Commit', CommitResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Looks up entities by key. + * + * Sample code: + * ``` + * $datastoreClient = new DatastoreClient(); + * try { + * $projectId = 'project_id'; + * $keys = []; + * $response = $datastoreClient->lookup($projectId, $keys); + * } finally { + * $datastoreClient->close(); + * } + * ``` + * + * @param string $projectId Required. The ID of the project against which to make the request. + * @param Key[] $keys Required. Keys of entities to look up. + * @param array $optionalArgs { + * Optional. + * + * @type string $databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type ReadOptions $readOptions + * The options for this lookup request. + * @type PropertyMask $propertyMask + * The properties to return. Defaults to returning all properties. + * + * If this field is set and an entity has a property not referenced in the + * mask, it will be absent from [LookupResponse.found.entity.properties][]. + * + * The entity's key is always returned. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Datastore\V1\LookupResponse + * + * @throws ApiException if the remote call fails + */ + public function lookup($projectId, $keys, array $optionalArgs = []) + { + $request = new LookupRequest(); + $requestParamHeaders = []; + $request->setProjectId($projectId); + $request->setKeys($keys); + $requestParamHeaders['project_id'] = $projectId; + if (isset($optionalArgs['databaseId'])) { + $request->setDatabaseId($optionalArgs['databaseId']); + $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; + } + + if (isset($optionalArgs['readOptions'])) { + $request->setReadOptions($optionalArgs['readOptions']); + } + + if (isset($optionalArgs['propertyMask'])) { + $request->setPropertyMask($optionalArgs['propertyMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Lookup', LookupResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Prevents the supplied keys' IDs from being auto-allocated by Cloud + * Datastore. + * + * Sample code: + * ``` + * $datastoreClient = new DatastoreClient(); + * try { + * $projectId = 'project_id'; + * $keys = []; + * $response = $datastoreClient->reserveIds($projectId, $keys); + * } finally { + * $datastoreClient->close(); + * } + * ``` + * + * @param string $projectId Required. The ID of the project against which to make the request. + * @param Key[] $keys Required. A list of keys with complete key paths whose numeric IDs should + * not be auto-allocated. + * @param array $optionalArgs { + * Optional. + * + * @type string $databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Datastore\V1\ReserveIdsResponse + * + * @throws ApiException if the remote call fails + */ + public function reserveIds($projectId, $keys, array $optionalArgs = []) + { + $request = new ReserveIdsRequest(); + $requestParamHeaders = []; + $request->setProjectId($projectId); + $request->setKeys($keys); + $requestParamHeaders['project_id'] = $projectId; + if (isset($optionalArgs['databaseId'])) { + $request->setDatabaseId($optionalArgs['databaseId']); + $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('ReserveIds', ReserveIdsResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Rolls back a transaction. + * + * Sample code: + * ``` + * $datastoreClient = new DatastoreClient(); + * try { + * $projectId = 'project_id'; + * $transaction = '...'; + * $response = $datastoreClient->rollback($projectId, $transaction); + * } finally { + * $datastoreClient->close(); + * } + * ``` + * + * @param string $projectId Required. The ID of the project against which to make the request. + * @param string $transaction Required. The transaction identifier, returned by a call to + * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. + * @param array $optionalArgs { + * Optional. + * + * @type string $databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Datastore\V1\RollbackResponse + * + * @throws ApiException if the remote call fails + */ + public function rollback($projectId, $transaction, array $optionalArgs = []) + { + $request = new RollbackRequest(); + $requestParamHeaders = []; + $request->setProjectId($projectId); + $request->setTransaction($transaction); + $requestParamHeaders['project_id'] = $projectId; + if (isset($optionalArgs['databaseId'])) { + $request->setDatabaseId($optionalArgs['databaseId']); + $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('Rollback', RollbackResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Runs an aggregation query. + * + * Sample code: + * ``` + * $datastoreClient = new DatastoreClient(); + * try { + * $projectId = 'project_id'; + * $response = $datastoreClient->runAggregationQuery($projectId); + * } finally { + * $datastoreClient->close(); + * } + * ``` + * + * @param string $projectId Required. The ID of the project against which to make the request. + * @param array $optionalArgs { + * Optional. + * + * @type string $databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type PartitionId $partitionId + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * @type ReadOptions $readOptions + * The options for this query. + * @type AggregationQuery $aggregationQuery + * The query to run. + * @type GqlQuery $gqlQuery + * The GQL query to run. This query must be an aggregation query. + * @type ExplainOptions $explainOptions + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Datastore\V1\RunAggregationQueryResponse + * + * @throws ApiException if the remote call fails + */ + public function runAggregationQuery($projectId, array $optionalArgs = []) + { + $request = new RunAggregationQueryRequest(); + $requestParamHeaders = []; + $request->setProjectId($projectId); + $requestParamHeaders['project_id'] = $projectId; + if (isset($optionalArgs['databaseId'])) { + $request->setDatabaseId($optionalArgs['databaseId']); + $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; + } + + if (isset($optionalArgs['partitionId'])) { + $request->setPartitionId($optionalArgs['partitionId']); + } + + if (isset($optionalArgs['readOptions'])) { + $request->setReadOptions($optionalArgs['readOptions']); + } + + if (isset($optionalArgs['aggregationQuery'])) { + $request->setAggregationQuery($optionalArgs['aggregationQuery']); + } + + if (isset($optionalArgs['gqlQuery'])) { + $request->setGqlQuery($optionalArgs['gqlQuery']); + } + + if (isset($optionalArgs['explainOptions'])) { + $request->setExplainOptions($optionalArgs['explainOptions']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RunAggregationQuery', RunAggregationQueryResponse::class, $optionalArgs, $request)->wait(); + } + + /** + * Queries for entities. + * + * Sample code: + * ``` + * $datastoreClient = new DatastoreClient(); + * try { + * $projectId = 'project_id'; + * $partitionId = new PartitionId(); + * $response = $datastoreClient->runQuery($projectId, $partitionId); + * } finally { + * $datastoreClient->close(); + * } + * ``` + * + * @param string $projectId Required. The ID of the project against which to make the request. + * @param PartitionId $partitionId Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * @param array $optionalArgs { + * Optional. + * + * @type string $databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @type ReadOptions $readOptions + * The options for this query. + * @type Query $query + * The query to run. + * @type GqlQuery $gqlQuery + * The GQL query to run. This query must be a non-aggregation query. + * @type PropertyMask $propertyMask + * The properties to return. + * This field must not be set for a projection query. + * + * See + * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. + * @type ExplainOptions $explainOptions + * Optional. Explain options for the query. If set, additional query + * statistics will be returned. If not, only query results will be returned. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Datastore\V1\RunQueryResponse + * + * @throws ApiException if the remote call fails + */ + public function runQuery($projectId, $partitionId, array $optionalArgs = []) + { + $request = new RunQueryRequest(); + $requestParamHeaders = []; + $request->setProjectId($projectId); + $request->setPartitionId($partitionId); + $requestParamHeaders['project_id'] = $projectId; + if (isset($optionalArgs['databaseId'])) { + $request->setDatabaseId($optionalArgs['databaseId']); + $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; + } + + if (isset($optionalArgs['readOptions'])) { + $request->setReadOptions($optionalArgs['readOptions']); + } + + if (isset($optionalArgs['query'])) { + $request->setQuery($optionalArgs['query']); + } + + if (isset($optionalArgs['gqlQuery'])) { + $request->setGqlQuery($optionalArgs['gqlQuery']); + } + + if (isset($optionalArgs['propertyMask'])) { + $request->setPropertyMask($optionalArgs['propertyMask']); + } + + if (isset($optionalArgs['explainOptions'])) { + $request->setExplainOptions($optionalArgs['explainOptions']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('RunQuery', RunQueryResponse::class, $optionalArgs, $request)->wait(); + } +} diff --git a/owl-bot-staging/Datastore/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Datastore/v1/src/V1/gapic_metadata.json new file mode 100644 index 000000000000..7cfff6525f13 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/src/V1/gapic_metadata.json @@ -0,0 +1,58 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.datastore.v1", + "libraryPackage": "Google\\Cloud\\Datastore\\V1", + "services": { + "Datastore": { + "clients": { + "grpc": { + "libraryClient": "DatastoreGapicClient", + "rpcs": { + "AllocateIds": { + "methods": [ + "allocateIds" + ] + }, + "BeginTransaction": { + "methods": [ + "beginTransaction" + ] + }, + "Commit": { + "methods": [ + "commit" + ] + }, + "Lookup": { + "methods": [ + "lookup" + ] + }, + "ReserveIds": { + "methods": [ + "reserveIds" + ] + }, + "Rollback": { + "methods": [ + "rollback" + ] + }, + "RunAggregationQuery": { + "methods": [ + "runAggregationQuery" + ] + }, + "RunQuery": { + "methods": [ + "runQuery" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_client_config.json b/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_client_config.json new file mode 100644 index 000000000000..081d5f9f6b62 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_client_config.json @@ -0,0 +1,95 @@ +{ + "interfaces": { + "google.datastore.v1.Datastore": { + "retry_codes": { + "no_retry_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ], + "no_retry_1_codes": [], + "no_retry_2_codes": [] + }, + "retry_params": { + "no_retry_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + }, + "retry_policy_1_params": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_1_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 60000 + }, + "no_retry_2_params": { + "initial_retry_delay_millis": 0, + "retry_delay_multiplier": 0.0, + "max_retry_delay_millis": 0, + "initial_rpc_timeout_millis": 0, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 0, + "total_timeout_millis": 0 + } + }, + "methods": { + "AllocateIds": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "BeginTransaction": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Commit": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "Lookup": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ReserveIds": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "Rollback": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "RunAggregationQuery": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "RunQuery": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_descriptor_config.php b/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_descriptor_config.php new file mode 100644 index 000000000000..533cf81dbb42 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_descriptor_config.php @@ -0,0 +1,172 @@ + [ + 'google.datastore.v1.Datastore' => [ + 'AllocateIds' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Datastore\V1\AllocateIdsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + [ + 'keyName' => 'database_id', + 'fieldAccessors' => [ + 'getDatabaseId', + ], + ], + ], + ], + 'BeginTransaction' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Datastore\V1\BeginTransactionResponse', + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + [ + 'keyName' => 'database_id', + 'fieldAccessors' => [ + 'getDatabaseId', + ], + ], + ], + ], + 'Commit' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Datastore\V1\CommitResponse', + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + [ + 'keyName' => 'database_id', + 'fieldAccessors' => [ + 'getDatabaseId', + ], + ], + ], + ], + 'Lookup' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Datastore\V1\LookupResponse', + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + [ + 'keyName' => 'database_id', + 'fieldAccessors' => [ + 'getDatabaseId', + ], + ], + ], + ], + 'ReserveIds' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Datastore\V1\ReserveIdsResponse', + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + [ + 'keyName' => 'database_id', + 'fieldAccessors' => [ + 'getDatabaseId', + ], + ], + ], + ], + 'Rollback' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Datastore\V1\RollbackResponse', + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + [ + 'keyName' => 'database_id', + 'fieldAccessors' => [ + 'getDatabaseId', + ], + ], + ], + ], + 'RunAggregationQuery' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Datastore\V1\RunAggregationQueryResponse', + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + [ + 'keyName' => 'database_id', + 'fieldAccessors' => [ + 'getDatabaseId', + ], + ], + ], + ], + 'RunQuery' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Datastore\V1\RunQueryResponse', + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + [ + 'keyName' => 'database_id', + 'fieldAccessors' => [ + 'getDatabaseId', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_rest_client_config.php b/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_rest_client_config.php new file mode 100644 index 000000000000..b3e9cc385e70 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_rest_client_config.php @@ -0,0 +1,171 @@ + [ + 'google.datastore.v1.Datastore' => [ + 'AllocateIds' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project_id}:allocateIds', + 'body' => '*', + 'placeholders' => [ + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + 'BeginTransaction' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project_id}:beginTransaction', + 'body' => '*', + 'placeholders' => [ + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + 'Commit' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project_id}:commit', + 'body' => '*', + 'placeholders' => [ + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + 'Lookup' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project_id}:lookup', + 'body' => '*', + 'placeholders' => [ + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + 'ReserveIds' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project_id}:reserveIds', + 'body' => '*', + 'placeholders' => [ + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + 'Rollback' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project_id}:rollback', + 'body' => '*', + 'placeholders' => [ + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + 'RunAggregationQuery' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project_id}:runAggregationQuery', + 'body' => '*', + 'placeholders' => [ + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + 'RunQuery' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project_id}:runQuery', + 'body' => '*', + 'placeholders' => [ + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/operations/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/Datastore/v1/tests/Unit/V1/Client/DatastoreClientTest.php b/owl-bot-staging/Datastore/v1/tests/Unit/V1/Client/DatastoreClientTest.php new file mode 100644 index 000000000000..57ffe283b6f1 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/tests/Unit/V1/Client/DatastoreClientTest.php @@ -0,0 +1,657 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DatastoreClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DatastoreClient($options); + } + + /** @test */ + public function allocateIdsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AllocateIdsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + $request = (new AllocateIdsRequest()) + ->setProjectId($projectId) + ->setKeys($keys); + $response = $gapicClient->allocateIds($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/AllocateIds', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getKeys(); + $this->assertProtobufEquals($keys, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function allocateIdsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + $request = (new AllocateIdsRequest()) + ->setProjectId($projectId) + ->setKeys($keys); + try { + $gapicClient->allocateIds($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function beginTransactionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction = '-34'; + $expectedResponse = new BeginTransactionResponse(); + $expectedResponse->setTransaction($transaction); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $request = (new BeginTransactionRequest()) + ->setProjectId($projectId); + $response = $gapicClient->beginTransaction($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/BeginTransaction', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function beginTransactionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $request = (new BeginTransactionRequest()) + ->setProjectId($projectId); + try { + $gapicClient->beginTransaction($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function commitTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $indexUpdates = 1425228195; + $expectedResponse = new CommitResponse(); + $expectedResponse->setIndexUpdates($indexUpdates); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $mode = Mode::MODE_UNSPECIFIED; + $mutations = []; + $request = (new CommitRequest()) + ->setProjectId($projectId) + ->setMode($mode) + ->setMutations($mutations); + $response = $gapicClient->commit($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/Commit', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getMode(); + $this->assertProtobufEquals($mode, $actualValue); + $actualValue = $actualRequestObject->getMutations(); + $this->assertProtobufEquals($mutations, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function commitExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $mode = Mode::MODE_UNSPECIFIED; + $mutations = []; + $request = (new CommitRequest()) + ->setProjectId($projectId) + ->setMode($mode) + ->setMutations($mutations); + try { + $gapicClient->commit($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function lookupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction = '-34'; + $expectedResponse = new LookupResponse(); + $expectedResponse->setTransaction($transaction); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + $request = (new LookupRequest()) + ->setProjectId($projectId) + ->setKeys($keys); + $response = $gapicClient->lookup($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/Lookup', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getKeys(); + $this->assertProtobufEquals($keys, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function lookupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + $request = (new LookupRequest()) + ->setProjectId($projectId) + ->setKeys($keys); + try { + $gapicClient->lookup($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reserveIdsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ReserveIdsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + $request = (new ReserveIdsRequest()) + ->setProjectId($projectId) + ->setKeys($keys); + $response = $gapicClient->reserveIds($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/ReserveIds', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getKeys(); + $this->assertProtobufEquals($keys, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reserveIdsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + $request = (new ReserveIdsRequest()) + ->setProjectId($projectId) + ->setKeys($keys); + try { + $gapicClient->reserveIds($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rollbackTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RollbackResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $transaction = '-34'; + $request = (new RollbackRequest()) + ->setProjectId($projectId) + ->setTransaction($transaction); + $response = $gapicClient->rollback($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/Rollback', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getTransaction(); + $this->assertProtobufEquals($transaction, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rollbackExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $transaction = '-34'; + $request = (new RollbackRequest()) + ->setProjectId($projectId) + ->setTransaction($transaction); + try { + $gapicClient->rollback($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runAggregationQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction = '-34'; + $expectedResponse = new RunAggregationQueryResponse(); + $expectedResponse->setTransaction($transaction); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $request = (new RunAggregationQueryRequest()) + ->setProjectId($projectId); + $response = $gapicClient->runAggregationQuery($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/RunAggregationQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runAggregationQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $request = (new RunAggregationQueryRequest()) + ->setProjectId($projectId); + try { + $gapicClient->runAggregationQuery($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction = '-34'; + $expectedResponse = new RunQueryResponse(); + $expectedResponse->setTransaction($transaction); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $partitionId = new PartitionId(); + $request = (new RunQueryRequest()) + ->setProjectId($projectId) + ->setPartitionId($partitionId); + $response = $gapicClient->runQuery($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/RunQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getPartitionId(); + $this->assertProtobufEquals($partitionId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $partitionId = new PartitionId(); + $request = (new RunQueryRequest()) + ->setProjectId($projectId) + ->setPartitionId($partitionId); + try { + $gapicClient->runQuery($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function allocateIdsAsyncTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AllocateIdsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + $request = (new AllocateIdsRequest()) + ->setProjectId($projectId) + ->setKeys($keys); + $response = $gapicClient->allocateIdsAsync($request)->wait(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/AllocateIds', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getKeys(); + $this->assertProtobufEquals($keys, $actualValue); + $this->assertTrue($transport->isExhausted()); + } +} diff --git a/owl-bot-staging/Datastore/v1/tests/Unit/V1/DatastoreClientTest.php b/owl-bot-staging/Datastore/v1/tests/Unit/V1/DatastoreClientTest.php new file mode 100644 index 000000000000..fa2f88b51f95 --- /dev/null +++ b/owl-bot-staging/Datastore/v1/tests/Unit/V1/DatastoreClientTest.php @@ -0,0 +1,572 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DatastoreClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DatastoreClient($options); + } + + /** @test */ + public function allocateIdsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new AllocateIdsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + $response = $gapicClient->allocateIds($projectId, $keys); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/AllocateIds', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getKeys(); + $this->assertProtobufEquals($keys, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function allocateIdsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + try { + $gapicClient->allocateIds($projectId, $keys); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function beginTransactionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction = '-34'; + $expectedResponse = new BeginTransactionResponse(); + $expectedResponse->setTransaction($transaction); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $response = $gapicClient->beginTransaction($projectId); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/BeginTransaction', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function beginTransactionExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + try { + $gapicClient->beginTransaction($projectId); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function commitTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $indexUpdates = 1425228195; + $expectedResponse = new CommitResponse(); + $expectedResponse->setIndexUpdates($indexUpdates); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $mode = Mode::MODE_UNSPECIFIED; + $mutations = []; + $response = $gapicClient->commit($projectId, $mode, $mutations); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/Commit', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getMode(); + $this->assertProtobufEquals($mode, $actualValue); + $actualValue = $actualRequestObject->getMutations(); + $this->assertProtobufEquals($mutations, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function commitExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $mode = Mode::MODE_UNSPECIFIED; + $mutations = []; + try { + $gapicClient->commit($projectId, $mode, $mutations); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function lookupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction = '-34'; + $expectedResponse = new LookupResponse(); + $expectedResponse->setTransaction($transaction); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + $response = $gapicClient->lookup($projectId, $keys); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/Lookup', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getKeys(); + $this->assertProtobufEquals($keys, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function lookupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + try { + $gapicClient->lookup($projectId, $keys); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reserveIdsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new ReserveIdsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + $response = $gapicClient->reserveIds($projectId, $keys); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/ReserveIds', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getKeys(); + $this->assertProtobufEquals($keys, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function reserveIdsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $keys = []; + try { + $gapicClient->reserveIds($projectId, $keys); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rollbackTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new RollbackResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $transaction = '-34'; + $response = $gapicClient->rollback($projectId, $transaction); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/Rollback', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getTransaction(); + $this->assertProtobufEquals($transaction, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function rollbackExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $transaction = '-34'; + try { + $gapicClient->rollback($projectId, $transaction); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runAggregationQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction = '-34'; + $expectedResponse = new RunAggregationQueryResponse(); + $expectedResponse->setTransaction($transaction); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $response = $gapicClient->runAggregationQuery($projectId); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/RunAggregationQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runAggregationQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + try { + $gapicClient->runAggregationQuery($projectId); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runQueryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $transaction = '-34'; + $expectedResponse = new RunQueryResponse(); + $expectedResponse->setTransaction($transaction); + $transport->addResponse($expectedResponse); + // Mock request + $projectId = 'projectId-1969970175'; + $partitionId = new PartitionId(); + $response = $gapicClient->runQuery($projectId, $partitionId); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.v1.Datastore/RunQuery', $actualFuncCall); + $actualValue = $actualRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualRequestObject->getPartitionId(); + $this->assertProtobufEquals($partitionId, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function runQueryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $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); + $transport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $partitionId = new PartitionId(); + try { + $gapicClient->runQuery($projectId, $partitionId); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} From 095f74049f5efef522ebbacbafea557225762d71 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 11 Oct 2024 22:04:22 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- Datastore/metadata/V1/Query.php | Bin 4366 -> 4897 bytes .../src}/V1/FindNearest.php | 20 +- .../src}/V1/FindNearest/DistanceMeasure.php | 0 Datastore/src/V1/Query.php | 60 ++ .../Google/Datastore/V1/AggregationResult.php | 39 - .../Google/Datastore/V1/Datastore.php | Bin 8218 -> 0 bytes .../Google/Datastore/V1/Entity.php | Bin 2034 -> 0 bytes .../GPBMetadata/Google/Datastore/V1/Query.php | Bin 4897 -> 0 bytes .../Google/Datastore/V1/QueryProfile.php | 42 - .../Cloud/Datastore/V1/AggregationQuery.php | 122 --- .../V1/AggregationQuery/Aggregation.php | 290 ------- .../V1/AggregationQuery/Aggregation/Avg.php | 86 -- .../V1/AggregationQuery/Aggregation/Count.php | 181 ----- .../V1/AggregationQuery/Aggregation/Sum.php | 95 --- .../Cloud/Datastore/V1/AggregationResult.php | 86 -- .../Datastore/V1/AggregationResultBatch.php | 165 ---- .../Cloud/Datastore/V1/AllocateIdsRequest.php | 164 ---- .../Datastore/V1/AllocateIdsResponse.php | 72 -- .../Google/Cloud/Datastore/V1/ArrayValue.php | 75 -- .../Datastore/V1/BeginTransactionRequest.php | 167 ---- .../Datastore/V1/BeginTransactionResponse.php | 68 -- .../Cloud/Datastore/V1/CommitRequest.php | 367 --------- .../Cloud/Datastore/V1/CommitRequest/Mode.php | 66 -- .../Cloud/Datastore/V1/CommitResponse.php | 153 ---- .../Cloud/Datastore/V1/CompositeFilter.php | 109 --- .../Datastore/V1/CompositeFilter/Operator.php | 68 -- .../src/Google/Cloud/Datastore/V1/Entity.php | 148 ---- .../Cloud/Datastore/V1/EntityResult.php | 285 ------- .../Datastore/V1/EntityResult/ResultType.php | 75 -- .../Cloud/Datastore/V1/ExecutionStats.php | 237 ------ .../Cloud/Datastore/V1/ExplainMetrics.php | 129 --- .../Cloud/Datastore/V1/ExplainOptions.php | 83 -- .../src/Google/Cloud/Datastore/V1/Filter.php | 108 --- .../Google/Cloud/Datastore/V1/GqlQuery.php | 210 ----- .../Cloud/Datastore/V1/GqlQueryParameter.php | 111 --- .../src/Google/Cloud/Datastore/V1/Key.php | 174 ----- .../Cloud/Datastore/V1/Key/PathElement.php | 195 ----- .../Cloud/Datastore/V1/KindExpression.php | 67 -- .../Cloud/Datastore/V1/LookupRequest.php | 260 ------ .../Cloud/Datastore/V1/LookupResponse.php | 257 ------ .../Google/Cloud/Datastore/V1/Mutation.php | 429 ---------- .../Mutation/ConflictResolutionStrategy.php | 64 -- .../Cloud/Datastore/V1/MutationResult.php | 311 -------- .../Google/Cloud/Datastore/V1/PartitionId.php | 154 ---- .../Google/Cloud/Datastore/V1/PlanSummary.php | 83 -- .../Google/Cloud/Datastore/V1/Projection.php | 77 -- .../Cloud/Datastore/V1/PropertyFilter.php | 155 ---- .../Datastore/V1/PropertyFilter/Operator.php | 135 ---- .../Cloud/Datastore/V1/PropertyMask.php | 96 --- .../Cloud/Datastore/V1/PropertyOrder.php | 111 --- .../Datastore/V1/PropertyOrder/Direction.php | 64 -- .../Cloud/Datastore/V1/PropertyReference.php | 83 -- .../Cloud/Datastore/V1/PropertyTransform.php | 432 ---------- .../V1/PropertyTransform/ServerValue.php | 59 -- .../src/Google/Cloud/Datastore/V1/Query.php | 516 ------------ .../Cloud/Datastore/V1/QueryResultBatch.php | 379 --------- .../V1/QueryResultBatch/MoreResultsType.php | 79 -- .../Google/Cloud/Datastore/V1/ReadOptions.php | 207 ----- .../V1/ReadOptions/ReadConsistency.php | 64 -- .../Cloud/Datastore/V1/ReserveIdsRequest.php | 164 ---- .../Cloud/Datastore/V1/ReserveIdsResponse.php | 34 - .../Cloud/Datastore/V1/RollbackRequest.php | 163 ---- .../Cloud/Datastore/V1/RollbackResponse.php | 35 - .../V1/RunAggregationQueryRequest.php | 333 -------- .../V1/RunAggregationQueryResponse.php | 228 ------ .../Cloud/Datastore/V1/RunQueryRequest.php | 388 --------- .../Cloud/Datastore/V1/RunQueryResponse.php | 228 ------ .../Cloud/Datastore/V1/TransactionOptions.php | 113 --- .../V1/TransactionOptions/PBReadOnly.php | 95 --- .../V1/TransactionOptions/ReadOnly.php | 9 - .../V1/TransactionOptions/ReadWrite.php | 70 -- .../src/Google/Cloud/Datastore/V1/Value.php | 517 ------------ .../V1/DatastoreClient/allocate_ids.php | 74 -- .../V1/DatastoreClient/begin_transaction.php | 70 -- .../v1/samples/V1/DatastoreClient/commit.php | 78 -- .../v1/samples/V1/DatastoreClient/lookup.php | 73 -- .../V1/DatastoreClient/reserve_ids.php | 74 -- .../samples/V1/DatastoreClient/rollback.php | 74 -- .../DatastoreClient/run_aggregation_query.php | 70 -- .../samples/V1/DatastoreClient/run_query.php | 73 -- .../v1/src/V1/Client/DatastoreClient.php | 403 ---------- .../Datastore/v1/src/V1/DatastoreClient.php | 34 - .../v1/src/V1/Gapic/DatastoreGapicClient.php | 739 ------------------ .../Datastore/v1/src/V1/gapic_metadata.json | 58 -- .../V1/resources/datastore_client_config.json | 95 --- .../resources/datastore_descriptor_config.php | 172 ---- .../datastore_rest_client_config.php | 171 ---- .../Unit/V1/Client/DatastoreClientTest.php | 657 ---------------- .../v1/tests/Unit/V1/DatastoreClientTest.php | 572 -------------- 89 files changed, 70 insertions(+), 14126 deletions(-) rename {owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore => Datastore/src}/V1/FindNearest.php (97%) rename {owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore => Datastore/src}/V1/FindNearest/DistanceMeasure.php (100%) delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/AggregationResult.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Datastore.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Entity.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Query.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/QueryProfile.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Avg.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Count.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Sum.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResult.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResultBatch.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsRequest.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsResponse.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ArrayValue.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionRequest.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionResponse.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest/Mode.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitResponse.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter/Operator.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Entity.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult/ResultType.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExecutionStats.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainMetrics.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainOptions.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Filter.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQuery.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQueryParameter.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key/PathElement.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/KindExpression.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupRequest.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupResponse.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation/ConflictResolutionStrategy.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/MutationResult.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PartitionId.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PlanSummary.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Projection.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter/Operator.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyMask.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder/Direction.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyReference.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform/ServerValue.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Query.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch/MoreResultsType.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions/ReadConsistency.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsRequest.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsResponse.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackRequest.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackResponse.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryRequest.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryResponse.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryRequest.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryResponse.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/PBReadOnly.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/ReadOnly.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/ReadWrite.php delete mode 100644 owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Value.php delete mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/allocate_ids.php delete mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/begin_transaction.php delete mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/commit.php delete mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/lookup.php delete mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/reserve_ids.php delete mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/rollback.php delete mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_aggregation_query.php delete mode 100644 owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_query.php delete mode 100644 owl-bot-staging/Datastore/v1/src/V1/Client/DatastoreClient.php delete mode 100644 owl-bot-staging/Datastore/v1/src/V1/DatastoreClient.php delete mode 100644 owl-bot-staging/Datastore/v1/src/V1/Gapic/DatastoreGapicClient.php delete mode 100644 owl-bot-staging/Datastore/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/Datastore/v1/src/V1/resources/datastore_client_config.json delete mode 100644 owl-bot-staging/Datastore/v1/src/V1/resources/datastore_descriptor_config.php delete mode 100644 owl-bot-staging/Datastore/v1/src/V1/resources/datastore_rest_client_config.php delete mode 100644 owl-bot-staging/Datastore/v1/tests/Unit/V1/Client/DatastoreClientTest.php delete mode 100644 owl-bot-staging/Datastore/v1/tests/Unit/V1/DatastoreClientTest.php diff --git a/Datastore/metadata/V1/Query.php b/Datastore/metadata/V1/Query.php index 04f68361a258e850ff80a5bdba11974d64b91292..a42f6011f29891340783c73ac1e44cf2d3b47cc8 100644 GIT binary patch delta 441 zcmZ9H&r8B!7{}Y@1m9_n7lI)MOGtuXl~9-Hu(nqi9!2Y5={ zkj$x6l9>acAumq~J7O~l%xr$i{isa*&EMxMUmOrN5~zdnE$P!B#7jXq+f7Lpo`T{{ zM8XBmB8gpTE2*}A?fMbPFbjwSZ%*B5pWq2`=TS%`ETaaYxbrz*fd(f+N8D z-o&F)Zu!aY-DSglAg!&*Q;|>cEDUBOqzj2p?1dC#;01tdjE)m<9QXq%ziL`lMnN$0 ziIObRpcf4lJ&1ZfS$Ah@7?l52f-M#7ZX#b%;r5z>lm3nF>TIaDPr6#&DO%Uxs-1W3jofc3wr.google.datastore.v1.PropertyReference vector_property = 1 [(.google.api.field_behavior) = REQUIRED]; */ - protected $vector_property = null; + private $vector_property = null; /** * Required. The query vector that we are searching on. Must be a vector of no * more than 2048 dimensions. * * Generated from protobuf field .google.datastore.v1.Value query_vector = 2 [(.google.api.field_behavior) = REQUIRED]; */ - protected $query_vector = null; + private $query_vector = null; /** * Required. The Distance Measure to use, required. * * Generated from protobuf field .google.datastore.v1.FindNearest.DistanceMeasure distance_measure = 3 [(.google.api.field_behavior) = REQUIRED]; */ - protected $distance_measure = 0; + private $distance_measure = 0; /** * Required. The number of nearest neighbors to return. Must be a positive * integer of no more than 100. * * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; */ - protected $limit = null; + private $limit = null; /** * Optional. Optional name of the field to output the result of the vector * distance calculation. Must conform to [entity @@ -53,7 +53,7 @@ class FindNearest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string distance_result_property = 5 [(.google.api.field_behavior) = OPTIONAL]; */ - protected $distance_result_property = ''; + private $distance_result_property = ''; /** * Optional. Option to specify a threshold for which no less similar documents * will be returned. The behavior of the specified `distance_measure` will @@ -64,7 +64,7 @@ class FindNearest extends \Google\Protobuf\Internal\Message * * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; */ - protected $distance_threshold = null; + private $distance_threshold = null; /** * Constructor. @@ -237,7 +237,7 @@ public function clearLimit() * Generated from protobuf field .google.protobuf.Int32Value limit = 4 [(.google.api.field_behavior) = REQUIRED]; * @return int|null */ - public function getLimitUnwrapped() + public function getLimitValue() { return $this->readWrapperValue("limit"); } @@ -268,7 +268,7 @@ public function setLimit($var) * @param int|null $var * @return $this */ - public function setLimitUnwrapped($var) + public function setLimitValue($var) { $this->writeWrapperValue("limit", $var); return $this;} @@ -342,7 +342,7 @@ public function clearDistanceThreshold() * Generated from protobuf field .google.protobuf.DoubleValue distance_threshold = 6 [(.google.api.field_behavior) = OPTIONAL]; * @return float|null */ - public function getDistanceThresholdUnwrapped() + public function getDistanceThresholdValue() { return $this->readWrapperValue("distance_threshold"); } @@ -381,7 +381,7 @@ public function setDistanceThreshold($var) * @param float|null $var * @return $this */ - public function setDistanceThresholdUnwrapped($var) + public function setDistanceThresholdValue($var) { $this->writeWrapperValue("distance_threshold", $var); return $this;} diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/FindNearest/DistanceMeasure.php b/Datastore/src/V1/FindNearest/DistanceMeasure.php similarity index 100% rename from owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/FindNearest/DistanceMeasure.php rename to Datastore/src/V1/FindNearest/DistanceMeasure.php diff --git a/Datastore/src/V1/Query.php b/Datastore/src/V1/Query.php index 0c752662bf17..e89908155e7d 100644 --- a/Datastore/src/V1/Query.php +++ b/Datastore/src/V1/Query.php @@ -10,6 +10,14 @@ /** * A query for entities. + * The query stages are executed in the following order: + * 1. kind + * 2. filter + * 3. projection + * 4. order + start_cursor + end_cursor + * 5. offset + * 6. limit + * 7. find_nearest * * Generated from protobuf message google.datastore.v1.Query */ @@ -85,6 +93,14 @@ class Query extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.protobuf.Int32Value limit = 12; */ private $limit = null; + /** + * Optional. A potential Nearest Neighbors Search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * + * Generated from protobuf field .google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $find_nearest = null; /** * Constructor. @@ -126,6 +142,10 @@ class Query extends \Google\Protobuf\Internal\Message * constraints. Optional. * Unspecified is interpreted as no limit. * Must be >= 0 if specified. + * @type \Google\Cloud\Datastore\V1\FindNearest $find_nearest + * Optional. A potential Nearest Neighbors Search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. * } */ public function __construct($data = NULL) { @@ -452,5 +472,45 @@ public function setLimitValue($var) $this->writeWrapperValue("limit", $var); return $this;} + /** + * Optional. A potential Nearest Neighbors Search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * + * Generated from protobuf field .google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\Datastore\V1\FindNearest|null + */ + public function getFindNearest() + { + return $this->find_nearest; + } + + public function hasFindNearest() + { + return isset($this->find_nearest); + } + + public function clearFindNearest() + { + unset($this->find_nearest); + } + + /** + * Optional. A potential Nearest Neighbors Search. + * Applies after all other filters and ordering. + * Finds the closest vector embeddings to the given query vector. + * + * Generated from protobuf field .google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\Datastore\V1\FindNearest $var + * @return $this + */ + public function setFindNearest($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\FindNearest::class); + $this->find_nearest = $var; + + return $this; + } + } diff --git a/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/AggregationResult.php b/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/AggregationResult.php deleted file mode 100644 index ca7de2ad9eef..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/AggregationResult.php +++ /dev/null @@ -1,39 +0,0 @@ -internalAddGeneratedFile( - ' -€ -,google/datastore/v1/aggregation_result.protogoogle.datastore.v1google/datastore/v1/query.protogoogle/protobuf/timestamp.proto"Ê -AggregationResult] -aggregate_properties ( 2?.google.datastore.v1.AggregationResult.AggregatePropertiesEntryV -AggregatePropertiesEntry -key ( ) -value ( 2.google.datastore.v1.Value:8"Ù -AggregationResultBatchC -aggregation_results ( 2&.google.datastore.v1.AggregationResultK - more_results (25.google.datastore.v1.QueryResultBatch.MoreResultsType- - read_time ( 2.google.protobuf.TimestampBÇ -com.google.datastore.v1BAggregationResultProtoPZ;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepbªGoogle.Cloud.Datastore.V1ÊGoogle\\Cloud\\Datastore\\V1êGoogle::Cloud::Datastore::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Datastore.php b/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Datastore.php deleted file mode 100644 index 5fd0a98c20b1eccf60b4003d2554ea7d8db9aa71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8218 zcmcgx%X1rP5s&0Y?3Vl*=b<=B?d&AkI9XeY1q+L^0VG>-RK$Py-$m&`hr%rNm%d%Pq$uu-ib3Mx;nZvd2f6`1IfT^{KYio5PZ|)Yhh^JBV>Lz2Y zZuqR#{k8i5bwhJqIrtGi0U7_;otmN7W!KX@{OhLfs=BFrx@PF#N9`ZTP0er#au3or zJ7(R}EmNipJ7%3M-;udYN_*3`(Ao#GugorW02*H{nI3UW&8Th=x9;dR+O~_Nxm=5Q zf!pXW%Xh@FRGi+Fm${C)+<=k~WY6i4@aeMb5U=By_nF>Qz^mY2)d*MRZM~W|O^bTL zGTmIRYg1RmFvfL5C#LsiJP&nZGz#QEJJc=b%~;D;$J5Q$=uAP#5eLmyr z#`8nL36wv_VCJ!9J?q$If&yGmx(tBS-y?NT)f=fPIkr4q82d{;E-gZWYE;u)LcdJY zFVdGF=@6}u=(8Zc?M7eBcevi!yI{O8=7tgxK1+O80;l1YpXl z-jPj|-^5_P8yx|}FTzAk^Xdm8XKqExX2x(F7AUcF2ZY;rd`@s%G_F4C+SVqXqt{)Q z$%*WVwqct?NtGXt!4eu0y3mAzXzW>P$LET;0xX29GK-HuU$pc4%{(IzBjA*HD>(fv z23I4aAdr>oMb`U~$O;)3#uuWJJBH(HG{^iup!VY!TrQB7ZdSUr@obfC0~SN|HArb* z4yv~!y%RcAb)44RCXgO64sMIG}l4- zR~%;6t#(`Y&UV@dFy6Krgxx>0*&%-EIUv1-^wPx$EiqF{aEV@-22nfMFoXh-dPB#f zta~us?ua=dHOcPa=<>fMsFa5=&Xl_V^IJO`MfK_S-fnTd^srRim_H{iz)Yo_-`>lw zS4unE`N#7yv|?d`2AcfBp$@8CanDPUHz1O6Ut)k`CZ`9XrLySAj#VEL*lsD#`_cwg9O)*gNWZgLF+IGB4qh4T&r7V6ZaGzMYCn#0E~^Hi`n3j))7nM+3bgrp79-- zUKbM3;X=Tk;FkuvGdfQUYsbSqz4QncQDZ(0u-t4~PTNf-Sy^~5QX!weLa!1^&YCo( z3`-|yn1Ty?SPm-1&5!%a$2=tWisk)cS>4Y+epF4d!%8&e+s9f%Hh#sVC$Q)etO6DmAxsuWJ=Ba2VQuNhRE$&s+N@)v`P?(3=0F=D>|1Vw@enwy-;QB|p1!Fk<3YQN}XlV}4 z`*)WX$WkC^o%mIbrf zdy&x(@v;R2CbZ9o2=D7nXiuBOp9?T&k{3Nq37alg1-d5RrN zynsDm$VnV)pT=orBEGtKX!IXme3)B`ni85*vc(undv2 zgM5$9E!}}>>Io(lGwg!x5ZuXj+@6TAc6aG3FhxlzWA9FcTM-~{(Bp+k-q2?MIs?-i z{t{67Weg_yN=Q;7UEuGF*hsq+-MjfTqI+l`=dYmxVrjO*d~NYf*9u*8{owci_(}Yh zBGbj7pmQ^ybU9w-47P*I#qR!yl3vG9hqiE-GvU>n^s^W`MJ#)yn~_HNpGE(-6g|gv zse~cBOw;OZMH#NDBTgPs*+0Z!5zh&Yn@{K}Q_2j}yPwiGAsT2AqOr)bRiE-5W=&RE zJ<*u{^G3AmkGRw6p9iItNTd46e2Z2`q!#9o<9rAd%(jejcerh}zUg^H!*FLh$w!+Z z3F6N^CnbnaBUJx1cAUS}#rp~!G*`UtV87D#$GhYFm43S5+v#b7$idTmo(%G3z7KnTaJWZ4`CO1b0K?z zl6F_QH5`7}fcaDCh^G8H27t*cWsm+unzb_}sNOepMV9OonLxTD-0Zif?SG@2Pp zhp+RgZX?8BLh!xGO(Qygm;cs*=h<#9lX>ytg$RKEF{5?71ALaUI*nCaKYMgiSvie7 zIH~Xp+?e4JQBf_-1{dHiZTfa&-@ebz@rjWy)3Umc-5Jy={P=Cx?gt0iwV%hYY_j+6 z^g2~G9SBeFuf6uaRjce{HS{KqkD>pLU*oK~9Q&Nh1f&q5RD|;u|}$m(nh1I0kU;nM9v3QC1?=Pb%UsK9ivVxAchYC0bxn5WF{1s zST2pIh5t}*J@rzc_x_aL`VTt0OHyj1w9!T6%)FU5vu`=yJV`DR_<|g~&czLpif`GJu#)S(;Fvk)vV%Ig?byxKV5Ek!^BCZ%5Oj7 zV|V_l!Ky)hg||72qLGHS8rbv399f)={Q^UDJQBJAA9;9H7>#p~8q~URDA`Py$Q|k^ zR12R#GvIjVS#DRSQ9=9Huvs2@?gDfzP%jCTQb*W*sJ~&e9I&bZt);!<)J^qNiZGt! zh>sCbNBcH_7jZAQT4-&e)rQRpn%13DeO&4PR)HJ1zLqiQHw*P>Q4B=Mx#lHORX%Ec>4>_KUY6J(yPq=PA3@@3(Y?7{ZaT_S3BK>b%*=z&+1JB obsX(>oD%Ff=RI#t3;N;h@+*4JtdWJS^WKf4Bh6;Gf-8W(0fv}&dH?_b diff --git a/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Query.php b/owl-bot-staging/Datastore/v1/proto/src/GPBMetadata/Google/Datastore/V1/Query.php deleted file mode 100644 index a42f6011f29891340783c73ac1e44cf2d3b47cc8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4897 zcmbVQPjlPW5jRPZ7MB#oJSQ=&I0=lnjojK$B-gD&)p7X;l2}tDO;YZ-!x;=jK2nGw z00BUyYR4a;hu+$mUVG^!(_3eH$UV1AzCaE+$7AYBL;KhqpX9H$94)=VixJ zYv>!cB{7AzHKglzBw>@u-ga!<Y!-3JfVIR zF7{^qPOvO9XN;wF;bXac&dEoT?@sCb>XPJAf9hJ>+;3*!W%S=5CQKE_80;9-998L& zeqz{exjfs|%t)N-e1r$8nlf5=^L0tUq5y(q5B6{cO2?^@v1x#_dYX%uvbQ- zD9SsCy!9w9EJ`24KPC9^6_6v>gn$xZQaRaNiv=p>@eoK|3+-~;A`~|KaMOXn2f@OT zz?Z?!#CQ2`Nyv)`cd0iueez4lh!si+DY2g0dQXY*Oc5$%6|SCOln}9{C6rE)4af~$ ziq)wxM@kuPVl6ZgI-x|VVG2_RHytRXU#U=l%y8;@wp&V}Y+il}AUyA%I+VNz*Sl)( zpxM{@&pWDi(CT&6T4Sf7){9rjGA!*JG@Hc)DFAf3?cb}lexuzgCP^NapQz8ZcB}ck zn3BIrL7LYyxetIoe@=N(mXcBm1M*?GoB32Jok)yq!qN-F8lito{G(X$Cn%u)$#JR2 zg2#eBHcTvH9>$*vI${e&(0M<|=-3&^nxpg)LT|Fq2{$u{IhhUXi|E*j=4!xevi zp<b8gj_ZCeI+6Pumr`*Wa82ZQm$=@ zjD9h5FSM z$cc4D>i?5~)rCdKr;xNAp8CSpz1ML|X$QC>cj2nA?gd>XzRe16Z@ByiDV%y z^wKPTjaD&3a2Y&31m?2L++L-pRa!N*htV(QumxtA01B_j-yzq}^(AEJ)e|f!+torC zz8Q}(HcXNSkQe+TYz2gWK?sFf8;Y#o>)5`vW2$>oS46+C^+_yF=N!kf7K-~qPZ&fR z7oD7qc^7wbq3|;(MIK;3$H{UQ2R7u1K0zJLUA^% zAJqCd3jQkz%e!Bgd^})-kVuB-yM{Fpq>tz;=%#6ZshP-CE*|Z8l9sXA7g%c;X@@wi zptu*zYw;Nf7g1VFry8i>nC+gD8eHQ{h?9+O&de=cFvW%DI=YMY(66<@07#7O9Hd^* z(_kwP!b%lP8Q*cwnJywL#?zdl$eK3A=c9u;05B zF1j32Rox#Rk?XMPy)f{&Hqr#rJPx2V%S`xT{>XrtA>xP=$aC8PkHinternalAddGeneratedFile( - ' -ã -\'google/datastore/v1/query_profile.protogoogle.datastore.v1google/protobuf/duration.protogoogle/protobuf/struct.proto"& -ExplainOptions -analyze (BàA"† -ExplainMetrics6 - plan_summary ( 2 .google.datastore.v1.PlanSummary< -execution_stats ( 2#.google.datastore.v1.ExecutionStats"< - PlanSummary- - indexes_used ( 2.google.protobuf.Struct"¨ -ExecutionStats -results_returned (5 -execution_duration ( 2.google.protobuf.Duration -read_operations (, - debug_stats ( 2.google.protobuf.StructBÂ -com.google.datastore.v1BQueryProfileProtoPZ;cloud.google.com/go/datastore/apiv1/datastorepb;datastorepbªGoogle.Cloud.Datastore.V1ÊGoogle\\Cloud\\Datastore\\V1êGoogle::Cloud::Datastore::V1bproto3' - , true); - - static::$is_initialized = true; - } -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery.php deleted file mode 100644 index 7417e426db56..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery.php +++ /dev/null @@ -1,122 +0,0 @@ -google.datastore.v1.AggregationQuery - */ -class AggregationQuery extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Series of aggregations to apply over the results of the - * `nested_query`. - * Requires: - * * A minimum of one and maximum of five aggregations per query. - * - * Generated from protobuf field repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $aggregations; - protected $query_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\Query $nested_query - * Nested query for aggregation - * @type array<\Google\Cloud\Datastore\V1\AggregationQuery\Aggregation>|\Google\Protobuf\Internal\RepeatedField $aggregations - * Optional. Series of aggregations to apply over the results of the - * `nested_query`. - * Requires: - * * A minimum of one and maximum of five aggregations per query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * Nested query for aggregation - * - * Generated from protobuf field .google.datastore.v1.Query nested_query = 1; - * @return \Google\Cloud\Datastore\V1\Query|null - */ - public function getNestedQuery() - { - return $this->readOneof(1); - } - - public function hasNestedQuery() - { - return $this->hasOneof(1); - } - - /** - * Nested query for aggregation - * - * Generated from protobuf field .google.datastore.v1.Query nested_query = 1; - * @param \Google\Cloud\Datastore\V1\Query $var - * @return $this - */ - public function setNestedQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Query::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Optional. Series of aggregations to apply over the results of the - * `nested_query`. - * Requires: - * * A minimum of one and maximum of five aggregations per query. - * - * Generated from protobuf field repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAggregations() - { - return $this->aggregations; - } - - /** - * Optional. Series of aggregations to apply over the results of the - * `nested_query`. - * Requires: - * * A minimum of one and maximum of five aggregations per query. - * - * Generated from protobuf field repeated .google.datastore.v1.AggregationQuery.Aggregation aggregations = 3 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Datastore\V1\AggregationQuery\Aggregation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAggregations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation::class); - $this->aggregations = $arr; - - return $this; - } - - /** - * @return string - */ - public function getQueryType() - { - return $this->whichOneof("query_type"); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation.php deleted file mode 100644 index e8c7cc0360ae..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation.php +++ /dev/null @@ -1,290 +0,0 @@ -google.datastore.v1.AggregationQuery.Aggregation - */ -class Aggregation extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Optional name of the property to store the result of the - * aggregation. - * If not provided, Datastore will pick a default name following the format - * `property_`. For example: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2), - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) - * OVER ( - * ... - * ); - * ``` - * becomes: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2) AS property_1, - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) AS property_2 - * OVER ( - * ... - * ); - * ``` - * Requires: - * * Must be unique across all aggregation aliases. - * * Conform to [entity property - * name][google.datastore.v1.Entity.properties] limitations. - * - * Generated from protobuf field string alias = 7 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $alias = ''; - protected $operator; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Count $count - * Count aggregator. - * @type \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Sum $sum - * Sum aggregator. - * @type \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Avg $avg - * Average aggregator. - * @type string $alias - * Optional. Optional name of the property to store the result of the - * aggregation. - * If not provided, Datastore will pick a default name following the format - * `property_`. For example: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2), - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) - * OVER ( - * ... - * ); - * ``` - * becomes: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2) AS property_1, - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) AS property_2 - * OVER ( - * ... - * ); - * ``` - * Requires: - * * Must be unique across all aggregation aliases. - * * Conform to [entity property - * name][google.datastore.v1.Entity.properties] limitations. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * Count aggregator. - * - * Generated from protobuf field .google.datastore.v1.AggregationQuery.Aggregation.Count count = 1; - * @return \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Count|null - */ - public function getCount() - { - return $this->readOneof(1); - } - - public function hasCount() - { - return $this->hasOneof(1); - } - - /** - * Count aggregator. - * - * Generated from protobuf field .google.datastore.v1.AggregationQuery.Aggregation.Count count = 1; - * @param \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Count $var - * @return $this - */ - public function setCount($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Count::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Sum aggregator. - * - * Generated from protobuf field .google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2; - * @return \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Sum|null - */ - public function getSum() - { - return $this->readOneof(2); - } - - public function hasSum() - { - return $this->hasOneof(2); - } - - /** - * Sum aggregator. - * - * Generated from protobuf field .google.datastore.v1.AggregationQuery.Aggregation.Sum sum = 2; - * @param \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Sum $var - * @return $this - */ - public function setSum($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Sum::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Average aggregator. - * - * Generated from protobuf field .google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3; - * @return \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Avg|null - */ - public function getAvg() - { - return $this->readOneof(3); - } - - public function hasAvg() - { - return $this->hasOneof(3); - } - - /** - * Average aggregator. - * - * Generated from protobuf field .google.datastore.v1.AggregationQuery.Aggregation.Avg avg = 3; - * @param \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Avg $var - * @return $this - */ - public function setAvg($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\AggregationQuery\Aggregation\Avg::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Optional. Optional name of the property to store the result of the - * aggregation. - * If not provided, Datastore will pick a default name following the format - * `property_`. For example: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2), - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) - * OVER ( - * ... - * ); - * ``` - * becomes: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2) AS property_1, - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) AS property_2 - * OVER ( - * ... - * ); - * ``` - * Requires: - * * Must be unique across all aggregation aliases. - * * Conform to [entity property - * name][google.datastore.v1.Entity.properties] limitations. - * - * Generated from protobuf field string alias = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getAlias() - { - return $this->alias; - } - - /** - * Optional. Optional name of the property to store the result of the - * aggregation. - * If not provided, Datastore will pick a default name following the format - * `property_`. For example: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2), - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) - * OVER ( - * ... - * ); - * ``` - * becomes: - * ``` - * AGGREGATE - * COUNT_UP_TO(1) AS count_up_to_1, - * COUNT_UP_TO(2) AS property_1, - * COUNT_UP_TO(3) AS count_up_to_3, - * COUNT(*) AS property_2 - * OVER ( - * ... - * ); - * ``` - * Requires: - * * Must be unique across all aggregation aliases. - * * Conform to [entity property - * name][google.datastore.v1.Entity.properties] limitations. - * - * Generated from protobuf field string alias = 7 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setAlias($var) - { - GPBUtil::checkString($var, True); - $this->alias = $var; - - return $this; - } - - /** - * @return string - */ - public function getOperator() - { - return $this->whichOneof("operator"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Aggregation::class, \Google\Cloud\Datastore\V1\AggregationQuery_Aggregation::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Avg.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Avg.php deleted file mode 100644 index 3cc34c0639bc..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Avg.php +++ /dev/null @@ -1,86 +0,0 @@ -google.datastore.v1.AggregationQuery.Aggregation.Avg - */ -class Avg extends \Google\Protobuf\Internal\Message -{ - /** - * The property to aggregate on. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - */ - protected $property = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\PropertyReference $property - * The property to aggregate on. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The property to aggregate on. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - * @return \Google\Cloud\Datastore\V1\PropertyReference|null - */ - public function getProperty() - { - return $this->property; - } - - public function hasProperty() - { - return isset($this->property); - } - - public function clearProperty() - { - unset($this->property); - } - - /** - * The property to aggregate on. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - * @param \Google\Cloud\Datastore\V1\PropertyReference $var - * @return $this - */ - public function setProperty($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyReference::class); - $this->property = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Avg::class, \Google\Cloud\Datastore\V1\AggregationQuery_Aggregation_Avg::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Count.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Count.php deleted file mode 100644 index 209b170896c9..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Count.php +++ /dev/null @@ -1,181 +0,0 @@ -google.datastore.v1.AggregationQuery.Aggregation.Count - */ -class Count extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Optional constraint on the maximum number of entities to - * count. - * This provides a way to set an upper bound on the number of entities - * to scan, limiting latency, and cost. - * Unspecified is interpreted as no bound. - * If a zero value is provided, a count result of zero should always be - * expected. - * High-Level Example: - * ``` - * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - * ``` - * Requires: - * * Must be non-negative when present. - * - * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $up_to = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Int64Value $up_to - * Optional. Optional constraint on the maximum number of entities to - * count. - * This provides a way to set an upper bound on the number of entities - * to scan, limiting latency, and cost. - * Unspecified is interpreted as no bound. - * If a zero value is provided, a count result of zero should always be - * expected. - * High-Level Example: - * ``` - * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - * ``` - * Requires: - * * Must be non-negative when present. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Optional constraint on the maximum number of entities to - * count. - * This provides a way to set an upper bound on the number of entities - * to scan, limiting latency, and cost. - * Unspecified is interpreted as no bound. - * If a zero value is provided, a count result of zero should always be - * expected. - * High-Level Example: - * ``` - * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - * ``` - * Requires: - * * Must be non-negative when present. - * - * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Int64Value|null - */ - public function getUpTo() - { - return $this->up_to; - } - - public function hasUpTo() - { - return isset($this->up_to); - } - - public function clearUpTo() - { - unset($this->up_to); - } - - /** - * Returns the unboxed value from getUpTo() - - * Optional. Optional constraint on the maximum number of entities to - * count. - * This provides a way to set an upper bound on the number of entities - * to scan, limiting latency, and cost. - * Unspecified is interpreted as no bound. - * If a zero value is provided, a count result of zero should always be - * expected. - * High-Level Example: - * ``` - * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - * ``` - * Requires: - * * Must be non-negative when present. - * - * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return int|string|null - */ - public function getUpToUnwrapped() - { - return $this->readWrapperValue("up_to"); - } - - /** - * Optional. Optional constraint on the maximum number of entities to - * count. - * This provides a way to set an upper bound on the number of entities - * to scan, limiting latency, and cost. - * Unspecified is interpreted as no bound. - * If a zero value is provided, a count result of zero should always be - * expected. - * High-Level Example: - * ``` - * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - * ``` - * Requires: - * * Must be non-negative when present. - * - * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Protobuf\Int64Value $var - * @return $this - */ - public function setUpTo($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int64Value::class); - $this->up_to = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int64Value object. - - * Optional. Optional constraint on the maximum number of entities to - * count. - * This provides a way to set an upper bound on the number of entities - * to scan, limiting latency, and cost. - * Unspecified is interpreted as no bound. - * If a zero value is provided, a count result of zero should always be - * expected. - * High-Level Example: - * ``` - * AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - * ``` - * Requires: - * * Must be non-negative when present. - * - * Generated from protobuf field .google.protobuf.Int64Value up_to = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param int|string|null $var - * @return $this - */ - public function setUpToUnwrapped($var) - { - $this->writeWrapperValue("up_to", $var); - return $this;} - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Count::class, \Google\Cloud\Datastore\V1\AggregationQuery_Aggregation_Count::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Sum.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Sum.php deleted file mode 100644 index 1743020e7294..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationQuery/Aggregation/Sum.php +++ /dev/null @@ -1,95 +0,0 @@ -google.datastore.v1.AggregationQuery.Aggregation.Sum - */ -class Sum extends \Google\Protobuf\Internal\Message -{ - /** - * The property to aggregate on. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - */ - protected $property = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\PropertyReference $property - * The property to aggregate on. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The property to aggregate on. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - * @return \Google\Cloud\Datastore\V1\PropertyReference|null - */ - public function getProperty() - { - return $this->property; - } - - public function hasProperty() - { - return isset($this->property); - } - - public function clearProperty() - { - unset($this->property); - } - - /** - * The property to aggregate on. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - * @param \Google\Cloud\Datastore\V1\PropertyReference $var - * @return $this - */ - public function setProperty($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyReference::class); - $this->property = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Sum::class, \Google\Cloud\Datastore\V1\AggregationQuery_Aggregation_Sum::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResult.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResult.php deleted file mode 100644 index a88234102734..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResult.php +++ /dev/null @@ -1,86 +0,0 @@ -google.datastore.v1.AggregationResult - */ -class AggregationResult extends \Google\Protobuf\Internal\Message -{ - /** - * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. - * The key is the - * [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] assigned to - * the aggregation function on input and the size of this map equals the - * number of aggregation functions in the query. - * - * Generated from protobuf field map aggregate_properties = 2; - */ - private $aggregate_properties; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\MapField $aggregate_properties - * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. - * The key is the - * [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] assigned to - * the aggregation function on input and the size of this map equals the - * number of aggregation functions in the query. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\AggregationResult::initOnce(); - parent::__construct($data); - } - - /** - * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. - * The key is the - * [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] assigned to - * the aggregation function on input and the size of this map equals the - * number of aggregation functions in the query. - * - * Generated from protobuf field map aggregate_properties = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getAggregateProperties() - { - return $this->aggregate_properties; - } - - /** - * The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. - * The key is the - * [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] assigned to - * the aggregation function on input and the size of this map equals the - * number of aggregation functions in the query. - * - * Generated from protobuf field map aggregate_properties = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setAggregateProperties($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Value::class); - $this->aggregate_properties = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResultBatch.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResultBatch.php deleted file mode 100644 index 5dd97e690dc6..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AggregationResultBatch.php +++ /dev/null @@ -1,165 +0,0 @@ -google.datastore.v1.AggregationResultBatch - */ -class AggregationResultBatch extends \Google\Protobuf\Internal\Message -{ - /** - * The aggregation results for this batch. - * - * Generated from protobuf field repeated .google.datastore.v1.AggregationResult aggregation_results = 1; - */ - private $aggregation_results; - /** - * The state of the query after the current batch. - * Only COUNT(*) aggregations are supported in the initial launch. Therefore, - * expected result type is limited to `NO_MORE_RESULTS`. - * - * Generated from protobuf field .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2; - */ - protected $more_results = 0; - /** - * Read timestamp this batch was returned from. - * In a single transaction, subsequent query result batches for the same query - * can have a greater timestamp. Each batch's read timestamp - * is valid for all preceding batches. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; - */ - protected $read_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Datastore\V1\AggregationResult>|\Google\Protobuf\Internal\RepeatedField $aggregation_results - * The aggregation results for this batch. - * @type int $more_results - * The state of the query after the current batch. - * Only COUNT(*) aggregations are supported in the initial launch. Therefore, - * expected result type is limited to `NO_MORE_RESULTS`. - * @type \Google\Protobuf\Timestamp $read_time - * Read timestamp this batch was returned from. - * In a single transaction, subsequent query result batches for the same query - * can have a greater timestamp. Each batch's read timestamp - * is valid for all preceding batches. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\AggregationResult::initOnce(); - parent::__construct($data); - } - - /** - * The aggregation results for this batch. - * - * Generated from protobuf field repeated .google.datastore.v1.AggregationResult aggregation_results = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getAggregationResults() - { - return $this->aggregation_results; - } - - /** - * The aggregation results for this batch. - * - * Generated from protobuf field repeated .google.datastore.v1.AggregationResult aggregation_results = 1; - * @param array<\Google\Cloud\Datastore\V1\AggregationResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setAggregationResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\AggregationResult::class); - $this->aggregation_results = $arr; - - return $this; - } - - /** - * The state of the query after the current batch. - * Only COUNT(*) aggregations are supported in the initial launch. Therefore, - * expected result type is limited to `NO_MORE_RESULTS`. - * - * Generated from protobuf field .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2; - * @return int - */ - public function getMoreResults() - { - return $this->more_results; - } - - /** - * The state of the query after the current batch. - * Only COUNT(*) aggregations are supported in the initial launch. Therefore, - * expected result type is limited to `NO_MORE_RESULTS`. - * - * Generated from protobuf field .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 2; - * @param int $var - * @return $this - */ - public function setMoreResults($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\QueryResultBatch\MoreResultsType::class); - $this->more_results = $var; - - return $this; - } - - /** - * Read timestamp this batch was returned from. - * In a single transaction, subsequent query result batches for the same query - * can have a greater timestamp. Each batch's read timestamp - * is valid for all preceding batches. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->read_time; - } - - public function hasReadTime() - { - return isset($this->read_time); - } - - public function clearReadTime() - { - unset($this->read_time); - } - - /** - * Read timestamp this batch was returned from. - * In a single transaction, subsequent query result batches for the same query - * can have a greater timestamp. Each batch's read timestamp - * is valid for all preceding batches. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 3; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->read_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsRequest.php deleted file mode 100644 index df1f2e88eb08..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsRequest.php +++ /dev/null @@ -1,164 +0,0 @@ -google.datastore.v1.AllocateIdsRequest - */ -class AllocateIdsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project_id = ''; - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - */ - protected $database_id = ''; - /** - * Required. A list of keys with incomplete key paths for which to allocate - * IDs. No key may be reserved/read-only. - * - * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $keys; - - /** - * @param string $projectId Required. The ID of the project against which to make the request. - * @param \Google\Cloud\Datastore\V1\Key[] $keys Required. A list of keys with incomplete key paths for which to allocate - * IDs. No key may be reserved/read-only. - * - * @return \Google\Cloud\Datastore\V1\AllocateIdsRequest - * - * @experimental - */ - public static function build(string $projectId, array $keys): self - { - return (new self()) - ->setProjectId($projectId) - ->setKeys($keys); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Required. The ID of the project against which to make the request. - * @type string $database_id - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $keys - * Required. A list of keys with incomplete key paths for which to allocate - * IDs. No key may be reserved/read-only. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @return string - */ - public function getDatabaseId() - { - return $this->database_id; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @param string $var - * @return $this - */ - public function setDatabaseId($var) - { - GPBUtil::checkString($var, True); - $this->database_id = $var; - - return $this; - } - - /** - * Required. A list of keys with incomplete key paths for which to allocate - * IDs. No key may be reserved/read-only. - * - * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getKeys() - { - return $this->keys; - } - - /** - * Required. A list of keys with incomplete key paths for which to allocate - * IDs. No key may be reserved/read-only. - * - * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setKeys($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Key::class); - $this->keys = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsResponse.php deleted file mode 100644 index e0b747b6a67d..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/AllocateIdsResponse.php +++ /dev/null @@ -1,72 +0,0 @@ -google.datastore.v1.AllocateIdsResponse - */ -class AllocateIdsResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The keys specified in the request (in the same order), each with - * its key path completed with a newly allocated ID. - * - * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1; - */ - private $keys; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $keys - * The keys specified in the request (in the same order), each with - * its key path completed with a newly allocated ID. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * The keys specified in the request (in the same order), each with - * its key path completed with a newly allocated ID. - * - * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getKeys() - { - return $this->keys; - } - - /** - * The keys specified in the request (in the same order), each with - * its key path completed with a newly allocated ID. - * - * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1; - * @param array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setKeys($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Key::class); - $this->keys = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ArrayValue.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ArrayValue.php deleted file mode 100644 index 54d0bbf39feb..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ArrayValue.php +++ /dev/null @@ -1,75 +0,0 @@ -google.datastore.v1.ArrayValue - */ -class ArrayValue extends \Google\Protobuf\Internal\Message -{ - /** - * Values in the array. - * The order of values in an array is preserved as long as all values have - * identical settings for 'exclude_from_indexes'. - * - * Generated from protobuf field repeated .google.datastore.v1.Value values = 1; - */ - private $values; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Datastore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $values - * Values in the array. - * The order of values in an array is preserved as long as all values have - * identical settings for 'exclude_from_indexes'. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Entity::initOnce(); - parent::__construct($data); - } - - /** - * Values in the array. - * The order of values in an array is preserved as long as all values have - * identical settings for 'exclude_from_indexes'. - * - * Generated from protobuf field repeated .google.datastore.v1.Value values = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getValues() - { - return $this->values; - } - - /** - * Values in the array. - * The order of values in an array is preserved as long as all values have - * identical settings for 'exclude_from_indexes'. - * - * Generated from protobuf field repeated .google.datastore.v1.Value values = 1; - * @param array<\Google\Cloud\Datastore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setValues($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Value::class); - $this->values = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionRequest.php deleted file mode 100644 index 03c7ca69e5e0..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -google.datastore.v1.BeginTransactionRequest - */ -class BeginTransactionRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project_id = ''; - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - */ - protected $database_id = ''; - /** - * Options for a new transaction. - * - * Generated from protobuf field .google.datastore.v1.TransactionOptions transaction_options = 10; - */ - protected $transaction_options = null; - - /** - * @param string $projectId Required. The ID of the project against which to make the request. - * - * @return \Google\Cloud\Datastore\V1\BeginTransactionRequest - * - * @experimental - */ - public static function build(string $projectId): self - { - return (new self()) - ->setProjectId($projectId); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Required. The ID of the project against which to make the request. - * @type string $database_id - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type \Google\Cloud\Datastore\V1\TransactionOptions $transaction_options - * Options for a new transaction. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @return string - */ - public function getDatabaseId() - { - return $this->database_id; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @param string $var - * @return $this - */ - public function setDatabaseId($var) - { - GPBUtil::checkString($var, True); - $this->database_id = $var; - - return $this; - } - - /** - * Options for a new transaction. - * - * Generated from protobuf field .google.datastore.v1.TransactionOptions transaction_options = 10; - * @return \Google\Cloud\Datastore\V1\TransactionOptions|null - */ - public function getTransactionOptions() - { - return $this->transaction_options; - } - - public function hasTransactionOptions() - { - return isset($this->transaction_options); - } - - public function clearTransactionOptions() - { - unset($this->transaction_options); - } - - /** - * Options for a new transaction. - * - * Generated from protobuf field .google.datastore.v1.TransactionOptions transaction_options = 10; - * @param \Google\Cloud\Datastore\V1\TransactionOptions $var - * @return $this - */ - public function setTransactionOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\TransactionOptions::class); - $this->transaction_options = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionResponse.php deleted file mode 100644 index 09b15c04119b..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/BeginTransactionResponse.php +++ /dev/null @@ -1,68 +0,0 @@ -google.datastore.v1.BeginTransactionResponse - */ -class BeginTransactionResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The transaction identifier (always present). - * - * Generated from protobuf field bytes transaction = 1; - */ - protected $transaction = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $transaction - * The transaction identifier (always present). - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * The transaction identifier (always present). - * - * Generated from protobuf field bytes transaction = 1; - * @return string - */ - public function getTransaction() - { - return $this->transaction; - } - - /** - * The transaction identifier (always present). - * - * Generated from protobuf field bytes transaction = 1; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->transaction = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest.php deleted file mode 100644 index 3d25a236d48b..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest.php +++ /dev/null @@ -1,367 +0,0 @@ -google.datastore.v1.CommitRequest - */ -class CommitRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project_id = ''; - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - */ - protected $database_id = ''; - /** - * The type of commit to perform. Defaults to `TRANSACTIONAL`. - * - * Generated from protobuf field .google.datastore.v1.CommitRequest.Mode mode = 5; - */ - protected $mode = 0; - /** - * The mutations to perform. - * When mode is `TRANSACTIONAL`, mutations affecting a single entity are - * applied in order. The following sequences of mutations affecting a single - * entity are not permitted in a single `Commit` request: - * - `insert` followed by `insert` - * - `update` followed by `insert` - * - `upsert` followed by `insert` - * - `delete` followed by `update` - * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - * entity. - * - * Generated from protobuf field repeated .google.datastore.v1.Mutation mutations = 6; - */ - private $mutations; - protected $transaction_selector; - - /** - * @param string $projectId Required. The ID of the project against which to make the request. - * @param int $mode The type of commit to perform. Defaults to `TRANSACTIONAL`. - * For allowed values, use constants defined on {@see \Google\Cloud\Datastore\V1\CommitRequest\Mode} - * @param string $transaction The identifier of the transaction associated with the commit. A - * transaction identifier is returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * @param \Google\Cloud\Datastore\V1\Mutation[] $mutations The mutations to perform. - * - * When mode is `TRANSACTIONAL`, mutations affecting a single entity are - * applied in order. The following sequences of mutations affecting a single - * entity are not permitted in a single `Commit` request: - * - * - `insert` followed by `insert` - * - `update` followed by `insert` - * - `upsert` followed by `insert` - * - `delete` followed by `update` - * - * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - * entity. - * - * @return \Google\Cloud\Datastore\V1\CommitRequest - * - * @experimental - */ - public static function build(string $projectId, int $mode, string $transaction, array $mutations): self - { - return (new self()) - ->setProjectId($projectId) - ->setMode($mode) - ->setTransaction($transaction) - ->setMutations($mutations); - } - - /** - * @param string $projectId Required. The ID of the project against which to make the request. - * @param int $mode The type of commit to perform. Defaults to `TRANSACTIONAL`. - * For allowed values, use constants defined on {@see \Google\Cloud\Datastore\V1\CommitRequest\Mode} - * @param \Google\Cloud\Datastore\V1\Mutation[] $mutations The mutations to perform. - * - * When mode is `TRANSACTIONAL`, mutations affecting a single entity are - * applied in order. The following sequences of mutations affecting a single - * entity are not permitted in a single `Commit` request: - * - * - `insert` followed by `insert` - * - `update` followed by `insert` - * - `upsert` followed by `insert` - * - `delete` followed by `update` - * - * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - * entity. - * - * @return \Google\Cloud\Datastore\V1\CommitRequest - * - * @experimental - */ - public static function buildFromProjectIdModeMutations(string $projectId, int $mode, array $mutations): self - { - return (new self()) - ->setProjectId($projectId) - ->setMode($mode) - ->setMutations($mutations); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Required. The ID of the project against which to make the request. - * @type string $database_id - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type int $mode - * The type of commit to perform. Defaults to `TRANSACTIONAL`. - * @type string $transaction - * The identifier of the transaction associated with the commit. A - * transaction identifier is returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * @type \Google\Cloud\Datastore\V1\TransactionOptions $single_use_transaction - * Options for beginning a new transaction for this request. - * The transaction is committed when the request completes. If specified, - * [TransactionOptions.mode][google.datastore.v1.TransactionOptions] must be - * [TransactionOptions.ReadWrite][google.datastore.v1.TransactionOptions.ReadWrite]. - * @type array<\Google\Cloud\Datastore\V1\Mutation>|\Google\Protobuf\Internal\RepeatedField $mutations - * The mutations to perform. - * When mode is `TRANSACTIONAL`, mutations affecting a single entity are - * applied in order. The following sequences of mutations affecting a single - * entity are not permitted in a single `Commit` request: - * - `insert` followed by `insert` - * - `update` followed by `insert` - * - `upsert` followed by `insert` - * - `delete` followed by `update` - * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - * entity. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @return string - */ - public function getDatabaseId() - { - return $this->database_id; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @param string $var - * @return $this - */ - public function setDatabaseId($var) - { - GPBUtil::checkString($var, True); - $this->database_id = $var; - - return $this; - } - - /** - * The type of commit to perform. Defaults to `TRANSACTIONAL`. - * - * Generated from protobuf field .google.datastore.v1.CommitRequest.Mode mode = 5; - * @return int - */ - public function getMode() - { - return $this->mode; - } - - /** - * The type of commit to perform. Defaults to `TRANSACTIONAL`. - * - * Generated from protobuf field .google.datastore.v1.CommitRequest.Mode mode = 5; - * @param int $var - * @return $this - */ - public function setMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\CommitRequest\Mode::class); - $this->mode = $var; - - return $this; - } - - /** - * The identifier of the transaction associated with the commit. A - * transaction identifier is returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * - * Generated from protobuf field bytes transaction = 1; - * @return string - */ - public function getTransaction() - { - return $this->readOneof(1); - } - - public function hasTransaction() - { - return $this->hasOneof(1); - } - - /** - * The identifier of the transaction associated with the commit. A - * transaction identifier is returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * - * Generated from protobuf field bytes transaction = 1; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * Options for beginning a new transaction for this request. - * The transaction is committed when the request completes. If specified, - * [TransactionOptions.mode][google.datastore.v1.TransactionOptions] must be - * [TransactionOptions.ReadWrite][google.datastore.v1.TransactionOptions.ReadWrite]. - * - * Generated from protobuf field .google.datastore.v1.TransactionOptions single_use_transaction = 10; - * @return \Google\Cloud\Datastore\V1\TransactionOptions|null - */ - public function getSingleUseTransaction() - { - return $this->readOneof(10); - } - - public function hasSingleUseTransaction() - { - return $this->hasOneof(10); - } - - /** - * Options for beginning a new transaction for this request. - * The transaction is committed when the request completes. If specified, - * [TransactionOptions.mode][google.datastore.v1.TransactionOptions] must be - * [TransactionOptions.ReadWrite][google.datastore.v1.TransactionOptions.ReadWrite]. - * - * Generated from protobuf field .google.datastore.v1.TransactionOptions single_use_transaction = 10; - * @param \Google\Cloud\Datastore\V1\TransactionOptions $var - * @return $this - */ - public function setSingleUseTransaction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\TransactionOptions::class); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * The mutations to perform. - * When mode is `TRANSACTIONAL`, mutations affecting a single entity are - * applied in order. The following sequences of mutations affecting a single - * entity are not permitted in a single `Commit` request: - * - `insert` followed by `insert` - * - `update` followed by `insert` - * - `upsert` followed by `insert` - * - `delete` followed by `update` - * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - * entity. - * - * Generated from protobuf field repeated .google.datastore.v1.Mutation mutations = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMutations() - { - return $this->mutations; - } - - /** - * The mutations to perform. - * When mode is `TRANSACTIONAL`, mutations affecting a single entity are - * applied in order. The following sequences of mutations affecting a single - * entity are not permitted in a single `Commit` request: - * - `insert` followed by `insert` - * - `update` followed by `insert` - * - `upsert` followed by `insert` - * - `delete` followed by `update` - * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - * entity. - * - * Generated from protobuf field repeated .google.datastore.v1.Mutation mutations = 6; - * @param array<\Google\Cloud\Datastore\V1\Mutation>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMutations($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Mutation::class); - $this->mutations = $arr; - - return $this; - } - - /** - * @return string - */ - public function getTransactionSelector() - { - return $this->whichOneof("transaction_selector"); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest/Mode.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest/Mode.php deleted file mode 100644 index b4e9acbd6eb8..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitRequest/Mode.php +++ /dev/null @@ -1,66 +0,0 @@ -google.datastore.v1.CommitRequest.Mode - */ -class Mode -{ - /** - * Unspecified. This value must not be used. - * - * Generated from protobuf enum MODE_UNSPECIFIED = 0; - */ - const MODE_UNSPECIFIED = 0; - /** - * Transactional: The mutations are either all applied, or none are applied. - * Learn about transactions - * [here](https://cloud.google.com/datastore/docs/concepts/transactions). - * - * Generated from protobuf enum TRANSACTIONAL = 1; - */ - const TRANSACTIONAL = 1; - /** - * Non-transactional: The mutations may not apply as all or none. - * - * Generated from protobuf enum NON_TRANSACTIONAL = 2; - */ - const NON_TRANSACTIONAL = 2; - - private static $valueToName = [ - self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED', - self::TRANSACTIONAL => 'TRANSACTIONAL', - self::NON_TRANSACTIONAL => 'NON_TRANSACTIONAL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Mode::class, \Google\Cloud\Datastore\V1\CommitRequest_Mode::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitResponse.php deleted file mode 100644 index 9c468d874e9e..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CommitResponse.php +++ /dev/null @@ -1,153 +0,0 @@ -google.datastore.v1.CommitResponse - */ -class CommitResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The result of performing the mutations. - * The i-th mutation result corresponds to the i-th mutation in the request. - * - * Generated from protobuf field repeated .google.datastore.v1.MutationResult mutation_results = 3; - */ - private $mutation_results; - /** - * The number of index entries updated during the commit, or zero if none were - * updated. - * - * Generated from protobuf field int32 index_updates = 4; - */ - protected $index_updates = 0; - /** - * The transaction commit timestamp. Not set for non-transactional commits. - * - * Generated from protobuf field .google.protobuf.Timestamp commit_time = 8; - */ - protected $commit_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Datastore\V1\MutationResult>|\Google\Protobuf\Internal\RepeatedField $mutation_results - * The result of performing the mutations. - * The i-th mutation result corresponds to the i-th mutation in the request. - * @type int $index_updates - * The number of index entries updated during the commit, or zero if none were - * updated. - * @type \Google\Protobuf\Timestamp $commit_time - * The transaction commit timestamp. Not set for non-transactional commits. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * The result of performing the mutations. - * The i-th mutation result corresponds to the i-th mutation in the request. - * - * Generated from protobuf field repeated .google.datastore.v1.MutationResult mutation_results = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMutationResults() - { - return $this->mutation_results; - } - - /** - * The result of performing the mutations. - * The i-th mutation result corresponds to the i-th mutation in the request. - * - * Generated from protobuf field repeated .google.datastore.v1.MutationResult mutation_results = 3; - * @param array<\Google\Cloud\Datastore\V1\MutationResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMutationResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\MutationResult::class); - $this->mutation_results = $arr; - - return $this; - } - - /** - * The number of index entries updated during the commit, or zero if none were - * updated. - * - * Generated from protobuf field int32 index_updates = 4; - * @return int - */ - public function getIndexUpdates() - { - return $this->index_updates; - } - - /** - * The number of index entries updated during the commit, or zero if none were - * updated. - * - * Generated from protobuf field int32 index_updates = 4; - * @param int $var - * @return $this - */ - public function setIndexUpdates($var) - { - GPBUtil::checkInt32($var); - $this->index_updates = $var; - - return $this; - } - - /** - * The transaction commit timestamp. Not set for non-transactional commits. - * - * Generated from protobuf field .google.protobuf.Timestamp commit_time = 8; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCommitTime() - { - return $this->commit_time; - } - - public function hasCommitTime() - { - return isset($this->commit_time); - } - - public function clearCommitTime() - { - unset($this->commit_time); - } - - /** - * The transaction commit timestamp. Not set for non-transactional commits. - * - * Generated from protobuf field .google.protobuf.Timestamp commit_time = 8; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCommitTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->commit_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter.php deleted file mode 100644 index 8426fe7cea32..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter.php +++ /dev/null @@ -1,109 +0,0 @@ -google.datastore.v1.CompositeFilter - */ -class CompositeFilter extends \Google\Protobuf\Internal\Message -{ - /** - * The operator for combining multiple filters. - * - * Generated from protobuf field .google.datastore.v1.CompositeFilter.Operator op = 1; - */ - protected $op = 0; - /** - * The list of filters to combine. - * Requires: - * * At least one filter is present. - * - * Generated from protobuf field repeated .google.datastore.v1.Filter filters = 2; - */ - private $filters; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $op - * The operator for combining multiple filters. - * @type array<\Google\Cloud\Datastore\V1\Filter>|\Google\Protobuf\Internal\RepeatedField $filters - * The list of filters to combine. - * Requires: - * * At least one filter is present. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The operator for combining multiple filters. - * - * Generated from protobuf field .google.datastore.v1.CompositeFilter.Operator op = 1; - * @return int - */ - public function getOp() - { - return $this->op; - } - - /** - * The operator for combining multiple filters. - * - * Generated from protobuf field .google.datastore.v1.CompositeFilter.Operator op = 1; - * @param int $var - * @return $this - */ - public function setOp($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\CompositeFilter\Operator::class); - $this->op = $var; - - return $this; - } - - /** - * The list of filters to combine. - * Requires: - * * At least one filter is present. - * - * Generated from protobuf field repeated .google.datastore.v1.Filter filters = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFilters() - { - return $this->filters; - } - - /** - * The list of filters to combine. - * Requires: - * * At least one filter is present. - * - * Generated from protobuf field repeated .google.datastore.v1.Filter filters = 2; - * @param array<\Google\Cloud\Datastore\V1\Filter>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFilters($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Filter::class); - $this->filters = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter/Operator.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter/Operator.php deleted file mode 100644 index 4cd871b7ed94..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/CompositeFilter/Operator.php +++ /dev/null @@ -1,68 +0,0 @@ -google.datastore.v1.CompositeFilter.Operator - */ -class Operator -{ - /** - * Unspecified. This value must not be used. - * - * Generated from protobuf enum OPERATOR_UNSPECIFIED = 0; - */ - const OPERATOR_UNSPECIFIED = 0; - /** - * The results are required to satisfy each of the combined filters. - * - * Generated from protobuf enum AND = 1; - */ - const PBAND = 1; - /** - * Documents are required to satisfy at least one of the combined filters. - * - * Generated from protobuf enum OR = 2; - */ - const PBOR = 2; - - private static $valueToName = [ - self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', - self::PBAND => 'AND', - self::PBOR => 'OR', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - $pbconst = __CLASS__. '::PB' . strtoupper($name); - if (!defined($pbconst)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($pbconst); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Operator::class, \Google\Cloud\Datastore\V1\CompositeFilter_Operator::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Entity.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Entity.php deleted file mode 100644 index 53b46087f3a6..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Entity.php +++ /dev/null @@ -1,148 +0,0 @@ -google.datastore.v1.Entity - */ -class Entity extends \Google\Protobuf\Internal\Message -{ - /** - * The entity's key. - * An entity must have a key, unless otherwise documented (for example, - * an entity in `Value.entity_value` may have no key). - * An entity's kind is its key path's last element's kind, - * or null if it has no key. - * - * Generated from protobuf field .google.datastore.v1.Key key = 1; - */ - protected $key = null; - /** - * The entity's properties. - * The map's keys are property names. - * A property name matching regex `__.*__` is reserved. - * A reserved property name is forbidden in certain documented contexts. - * The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot - * be empty. - * - * Generated from protobuf field map properties = 3; - */ - private $properties; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\Key $key - * The entity's key. - * An entity must have a key, unless otherwise documented (for example, - * an entity in `Value.entity_value` may have no key). - * An entity's kind is its key path's last element's kind, - * or null if it has no key. - * @type array|\Google\Protobuf\Internal\MapField $properties - * The entity's properties. - * The map's keys are property names. - * A property name matching regex `__.*__` is reserved. - * A reserved property name is forbidden in certain documented contexts. - * The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot - * be empty. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Entity::initOnce(); - parent::__construct($data); - } - - /** - * The entity's key. - * An entity must have a key, unless otherwise documented (for example, - * an entity in `Value.entity_value` may have no key). - * An entity's kind is its key path's last element's kind, - * or null if it has no key. - * - * Generated from protobuf field .google.datastore.v1.Key key = 1; - * @return \Google\Cloud\Datastore\V1\Key|null - */ - public function getKey() - { - return $this->key; - } - - public function hasKey() - { - return isset($this->key); - } - - public function clearKey() - { - unset($this->key); - } - - /** - * The entity's key. - * An entity must have a key, unless otherwise documented (for example, - * an entity in `Value.entity_value` may have no key). - * An entity's kind is its key path's last element's kind, - * or null if it has no key. - * - * Generated from protobuf field .google.datastore.v1.Key key = 1; - * @param \Google\Cloud\Datastore\V1\Key $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Key::class); - $this->key = $var; - - return $this; - } - - /** - * The entity's properties. - * The map's keys are property names. - * A property name matching regex `__.*__` is reserved. - * A reserved property name is forbidden in certain documented contexts. - * The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot - * be empty. - * - * Generated from protobuf field map properties = 3; - * @return \Google\Protobuf\Internal\MapField - */ - public function getProperties() - { - return $this->properties; - } - - /** - * The entity's properties. - * The map's keys are property names. - * A property name matching regex `__.*__` is reserved. - * A reserved property name is forbidden in certain documented contexts. - * The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot - * be empty. - * - * Generated from protobuf field map properties = 3; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setProperties($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Value::class); - $this->properties = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult.php deleted file mode 100644 index 2fb16860fbd9..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult.php +++ /dev/null @@ -1,285 +0,0 @@ -google.datastore.v1.EntityResult - */ -class EntityResult extends \Google\Protobuf\Internal\Message -{ - /** - * The resulting entity. - * - * Generated from protobuf field .google.datastore.v1.Entity entity = 1; - */ - protected $entity = null; - /** - * The version of the entity, a strictly positive number that monotonically - * increases with changes to the entity. - * This field is set for - * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - * For [missing][google.datastore.v1.LookupResponse.missing] entities in - * `LookupResponse`, this is the version of the snapshot that was used to look - * up the entity, and it is always set except for eventually consistent reads. - * - * Generated from protobuf field int64 version = 4; - */ - protected $version = 0; - /** - * The time at which the entity was created. - * This field is set for - * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - * If this entity is missing, this field will not be set. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; - */ - protected $create_time = null; - /** - * The time at which the entity was last changed. - * This field is set for - * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - * If this entity is missing, this field will not be set. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5; - */ - protected $update_time = null; - /** - * A cursor that points to the position after the result entity. - * Set only when the `EntityResult` is part of a `QueryResultBatch` message. - * - * Generated from protobuf field bytes cursor = 3; - */ - protected $cursor = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\Entity $entity - * The resulting entity. - * @type int|string $version - * The version of the entity, a strictly positive number that monotonically - * increases with changes to the entity. - * This field is set for - * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - * For [missing][google.datastore.v1.LookupResponse.missing] entities in - * `LookupResponse`, this is the version of the snapshot that was used to look - * up the entity, and it is always set except for eventually consistent reads. - * @type \Google\Protobuf\Timestamp $create_time - * The time at which the entity was created. - * This field is set for - * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - * If this entity is missing, this field will not be set. - * @type \Google\Protobuf\Timestamp $update_time - * The time at which the entity was last changed. - * This field is set for - * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - * If this entity is missing, this field will not be set. - * @type string $cursor - * A cursor that points to the position after the result entity. - * Set only when the `EntityResult` is part of a `QueryResultBatch` message. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The resulting entity. - * - * Generated from protobuf field .google.datastore.v1.Entity entity = 1; - * @return \Google\Cloud\Datastore\V1\Entity|null - */ - public function getEntity() - { - return $this->entity; - } - - public function hasEntity() - { - return isset($this->entity); - } - - public function clearEntity() - { - unset($this->entity); - } - - /** - * The resulting entity. - * - * Generated from protobuf field .google.datastore.v1.Entity entity = 1; - * @param \Google\Cloud\Datastore\V1\Entity $var - * @return $this - */ - public function setEntity($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Entity::class); - $this->entity = $var; - - return $this; - } - - /** - * The version of the entity, a strictly positive number that monotonically - * increases with changes to the entity. - * This field is set for - * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - * For [missing][google.datastore.v1.LookupResponse.missing] entities in - * `LookupResponse`, this is the version of the snapshot that was used to look - * up the entity, and it is always set except for eventually consistent reads. - * - * Generated from protobuf field int64 version = 4; - * @return int|string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The version of the entity, a strictly positive number that monotonically - * increases with changes to the entity. - * This field is set for - * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - * For [missing][google.datastore.v1.LookupResponse.missing] entities in - * `LookupResponse`, this is the version of the snapshot that was used to look - * up the entity, and it is always set except for eventually consistent reads. - * - * Generated from protobuf field int64 version = 4; - * @param int|string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkInt64($var); - $this->version = $var; - - return $this; - } - - /** - * The time at which the entity was created. - * This field is set for - * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - * If this entity is missing, this field will not be set. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The time at which the entity was created. - * This field is set for - * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - * If this entity is missing, this field will not be set. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The time at which the entity was last changed. - * This field is set for - * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - * If this entity is missing, this field will not be set. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * The time at which the entity was last changed. - * This field is set for - * [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - * If this entity is missing, this field will not be set. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 5; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * A cursor that points to the position after the result entity. - * Set only when the `EntityResult` is part of a `QueryResultBatch` message. - * - * Generated from protobuf field bytes cursor = 3; - * @return string - */ - public function getCursor() - { - return $this->cursor; - } - - /** - * A cursor that points to the position after the result entity. - * Set only when the `EntityResult` is part of a `QueryResultBatch` message. - * - * Generated from protobuf field bytes cursor = 3; - * @param string $var - * @return $this - */ - public function setCursor($var) - { - GPBUtil::checkString($var, False); - $this->cursor = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult/ResultType.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult/ResultType.php deleted file mode 100644 index 2e2471e78e19..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/EntityResult/ResultType.php +++ /dev/null @@ -1,75 +0,0 @@ -google.datastore.v1.EntityResult.ResultType - */ -class ResultType -{ - /** - * Unspecified. This value is never used. - * - * Generated from protobuf enum RESULT_TYPE_UNSPECIFIED = 0; - */ - const RESULT_TYPE_UNSPECIFIED = 0; - /** - * The key and properties. - * - * Generated from protobuf enum FULL = 1; - */ - const FULL = 1; - /** - * A projected subset of properties. The entity may have no key. - * - * Generated from protobuf enum PROJECTION = 2; - */ - const PROJECTION = 2; - /** - * Only the key. - * - * Generated from protobuf enum KEY_ONLY = 3; - */ - const KEY_ONLY = 3; - - private static $valueToName = [ - self::RESULT_TYPE_UNSPECIFIED => 'RESULT_TYPE_UNSPECIFIED', - self::FULL => 'FULL', - self::PROJECTION => 'PROJECTION', - self::KEY_ONLY => 'KEY_ONLY', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ResultType::class, \Google\Cloud\Datastore\V1\EntityResult_ResultType::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExecutionStats.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExecutionStats.php deleted file mode 100644 index 4de843f075e3..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExecutionStats.php +++ /dev/null @@ -1,237 +0,0 @@ -google.datastore.v1.ExecutionStats - */ -class ExecutionStats extends \Google\Protobuf\Internal\Message -{ - /** - * Total number of results returned, including documents, projections, - * aggregation results, keys. - * - * Generated from protobuf field int64 results_returned = 1; - */ - protected $results_returned = 0; - /** - * Total time to execute the query in the backend. - * - * Generated from protobuf field .google.protobuf.Duration execution_duration = 3; - */ - protected $execution_duration = null; - /** - * Total billable read operations. - * - * Generated from protobuf field int64 read_operations = 4; - */ - protected $read_operations = 0; - /** - * Debugging statistics from the execution of the query. Note that the - * debugging stats are subject to change as Firestore evolves. It could - * include: - * { - * "indexes_entries_scanned": "1000", - * "documents_scanned": "20", - * "billing_details" : { - * "documents_billable": "20", - * "index_entries_billable": "1000", - * "min_query_cost": "0" - * } - * } - * - * Generated from protobuf field .google.protobuf.Struct debug_stats = 5; - */ - protected $debug_stats = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $results_returned - * Total number of results returned, including documents, projections, - * aggregation results, keys. - * @type \Google\Protobuf\Duration $execution_duration - * Total time to execute the query in the backend. - * @type int|string $read_operations - * Total billable read operations. - * @type \Google\Protobuf\Struct $debug_stats - * Debugging statistics from the execution of the query. Note that the - * debugging stats are subject to change as Firestore evolves. It could - * include: - * { - * "indexes_entries_scanned": "1000", - * "documents_scanned": "20", - * "billing_details" : { - * "documents_billable": "20", - * "index_entries_billable": "1000", - * "min_query_cost": "0" - * } - * } - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\QueryProfile::initOnce(); - parent::__construct($data); - } - - /** - * Total number of results returned, including documents, projections, - * aggregation results, keys. - * - * Generated from protobuf field int64 results_returned = 1; - * @return int|string - */ - public function getResultsReturned() - { - return $this->results_returned; - } - - /** - * Total number of results returned, including documents, projections, - * aggregation results, keys. - * - * Generated from protobuf field int64 results_returned = 1; - * @param int|string $var - * @return $this - */ - public function setResultsReturned($var) - { - GPBUtil::checkInt64($var); - $this->results_returned = $var; - - return $this; - } - - /** - * Total time to execute the query in the backend. - * - * Generated from protobuf field .google.protobuf.Duration execution_duration = 3; - * @return \Google\Protobuf\Duration|null - */ - public function getExecutionDuration() - { - return $this->execution_duration; - } - - public function hasExecutionDuration() - { - return isset($this->execution_duration); - } - - public function clearExecutionDuration() - { - unset($this->execution_duration); - } - - /** - * Total time to execute the query in the backend. - * - * Generated from protobuf field .google.protobuf.Duration execution_duration = 3; - * @param \Google\Protobuf\Duration $var - * @return $this - */ - public function setExecutionDuration($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); - $this->execution_duration = $var; - - return $this; - } - - /** - * Total billable read operations. - * - * Generated from protobuf field int64 read_operations = 4; - * @return int|string - */ - public function getReadOperations() - { - return $this->read_operations; - } - - /** - * Total billable read operations. - * - * Generated from protobuf field int64 read_operations = 4; - * @param int|string $var - * @return $this - */ - public function setReadOperations($var) - { - GPBUtil::checkInt64($var); - $this->read_operations = $var; - - return $this; - } - - /** - * Debugging statistics from the execution of the query. Note that the - * debugging stats are subject to change as Firestore evolves. It could - * include: - * { - * "indexes_entries_scanned": "1000", - * "documents_scanned": "20", - * "billing_details" : { - * "documents_billable": "20", - * "index_entries_billable": "1000", - * "min_query_cost": "0" - * } - * } - * - * Generated from protobuf field .google.protobuf.Struct debug_stats = 5; - * @return \Google\Protobuf\Struct|null - */ - public function getDebugStats() - { - return $this->debug_stats; - } - - public function hasDebugStats() - { - return isset($this->debug_stats); - } - - public function clearDebugStats() - { - unset($this->debug_stats); - } - - /** - * Debugging statistics from the execution of the query. Note that the - * debugging stats are subject to change as Firestore evolves. It could - * include: - * { - * "indexes_entries_scanned": "1000", - * "documents_scanned": "20", - * "billing_details" : { - * "documents_billable": "20", - * "index_entries_billable": "1000", - * "min_query_cost": "0" - * } - * } - * - * Generated from protobuf field .google.protobuf.Struct debug_stats = 5; - * @param \Google\Protobuf\Struct $var - * @return $this - */ - public function setDebugStats($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); - $this->debug_stats = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainMetrics.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainMetrics.php deleted file mode 100644 index 99decd220a7d..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainMetrics.php +++ /dev/null @@ -1,129 +0,0 @@ -google.datastore.v1.ExplainMetrics - */ -class ExplainMetrics extends \Google\Protobuf\Internal\Message -{ - /** - * Planning phase information for the query. - * - * Generated from protobuf field .google.datastore.v1.PlanSummary plan_summary = 1; - */ - protected $plan_summary = null; - /** - * Aggregated stats from the execution of the query. Only present when - * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set - * to true. - * - * Generated from protobuf field .google.datastore.v1.ExecutionStats execution_stats = 2; - */ - protected $execution_stats = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\PlanSummary $plan_summary - * Planning phase information for the query. - * @type \Google\Cloud\Datastore\V1\ExecutionStats $execution_stats - * Aggregated stats from the execution of the query. Only present when - * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set - * to true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\QueryProfile::initOnce(); - parent::__construct($data); - } - - /** - * Planning phase information for the query. - * - * Generated from protobuf field .google.datastore.v1.PlanSummary plan_summary = 1; - * @return \Google\Cloud\Datastore\V1\PlanSummary|null - */ - public function getPlanSummary() - { - return $this->plan_summary; - } - - public function hasPlanSummary() - { - return isset($this->plan_summary); - } - - public function clearPlanSummary() - { - unset($this->plan_summary); - } - - /** - * Planning phase information for the query. - * - * Generated from protobuf field .google.datastore.v1.PlanSummary plan_summary = 1; - * @param \Google\Cloud\Datastore\V1\PlanSummary $var - * @return $this - */ - public function setPlanSummary($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PlanSummary::class); - $this->plan_summary = $var; - - return $this; - } - - /** - * Aggregated stats from the execution of the query. Only present when - * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set - * to true. - * - * Generated from protobuf field .google.datastore.v1.ExecutionStats execution_stats = 2; - * @return \Google\Cloud\Datastore\V1\ExecutionStats|null - */ - public function getExecutionStats() - { - return $this->execution_stats; - } - - public function hasExecutionStats() - { - return isset($this->execution_stats); - } - - public function clearExecutionStats() - { - unset($this->execution_stats); - } - - /** - * Aggregated stats from the execution of the query. Only present when - * [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set - * to true. - * - * Generated from protobuf field .google.datastore.v1.ExecutionStats execution_stats = 2; - * @param \Google\Cloud\Datastore\V1\ExecutionStats $var - * @return $this - */ - public function setExecutionStats($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ExecutionStats::class); - $this->execution_stats = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainOptions.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainOptions.php deleted file mode 100644 index d903d204f9ea..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ExplainOptions.php +++ /dev/null @@ -1,83 +0,0 @@ -google.datastore.v1.ExplainOptions - */ -class ExplainOptions extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. Whether to execute this query. - * When false (the default), the query will be planned, returning only - * metrics from the planning stages. - * When true, the query will be planned and executed, returning the full - * query results along with both planning and execution stage metrics. - * - * Generated from protobuf field bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $analyze = false; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type bool $analyze - * Optional. Whether to execute this query. - * When false (the default), the query will be planned, returning only - * metrics from the planning stages. - * When true, the query will be planned and executed, returning the full - * query results along with both planning and execution stage metrics. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\QueryProfile::initOnce(); - parent::__construct($data); - } - - /** - * Optional. Whether to execute this query. - * When false (the default), the query will be planned, returning only - * metrics from the planning stages. - * When true, the query will be planned and executed, returning the full - * query results along with both planning and execution stage metrics. - * - * Generated from protobuf field bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return bool - */ - public function getAnalyze() - { - return $this->analyze; - } - - /** - * Optional. Whether to execute this query. - * When false (the default), the query will be planned, returning only - * metrics from the planning stages. - * When true, the query will be planned and executed, returning the full - * query results along with both planning and execution stage metrics. - * - * Generated from protobuf field bool analyze = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param bool $var - * @return $this - */ - public function setAnalyze($var) - { - GPBUtil::checkBool($var); - $this->analyze = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Filter.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Filter.php deleted file mode 100644 index a4d1b4c8b575..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Filter.php +++ /dev/null @@ -1,108 +0,0 @@ -google.datastore.v1.Filter - */ -class Filter extends \Google\Protobuf\Internal\Message -{ - protected $filter_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\CompositeFilter $composite_filter - * A composite filter. - * @type \Google\Cloud\Datastore\V1\PropertyFilter $property_filter - * A filter on a property. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * A composite filter. - * - * Generated from protobuf field .google.datastore.v1.CompositeFilter composite_filter = 1; - * @return \Google\Cloud\Datastore\V1\CompositeFilter|null - */ - public function getCompositeFilter() - { - return $this->readOneof(1); - } - - public function hasCompositeFilter() - { - return $this->hasOneof(1); - } - - /** - * A composite filter. - * - * Generated from protobuf field .google.datastore.v1.CompositeFilter composite_filter = 1; - * @param \Google\Cloud\Datastore\V1\CompositeFilter $var - * @return $this - */ - public function setCompositeFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\CompositeFilter::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * A filter on a property. - * - * Generated from protobuf field .google.datastore.v1.PropertyFilter property_filter = 2; - * @return \Google\Cloud\Datastore\V1\PropertyFilter|null - */ - public function getPropertyFilter() - { - return $this->readOneof(2); - } - - public function hasPropertyFilter() - { - return $this->hasOneof(2); - } - - /** - * A filter on a property. - * - * Generated from protobuf field .google.datastore.v1.PropertyFilter property_filter = 2; - * @param \Google\Cloud\Datastore\V1\PropertyFilter $var - * @return $this - */ - public function setPropertyFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyFilter::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getFilterType() - { - return $this->whichOneof("filter_type"); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQuery.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQuery.php deleted file mode 100644 index ba0e57d29944..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQuery.php +++ /dev/null @@ -1,210 +0,0 @@ -google.datastore.v1.GqlQuery - */ -class GqlQuery extends \Google\Protobuf\Internal\Message -{ - /** - * A string of the format described - * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). - * - * Generated from protobuf field string query_string = 1; - */ - protected $query_string = ''; - /** - * When false, the query string must not contain any literals and instead must - * bind all values. For example, - * `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while - * `SELECT * FROM Kind WHERE a = @value` is. - * - * Generated from protobuf field bool allow_literals = 2; - */ - protected $allow_literals = false; - /** - * For each non-reserved named binding site in the query string, there must be - * a named parameter with that name, but not necessarily the inverse. - * Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex - * `__.*__`, and must not be `""`. - * - * Generated from protobuf field map named_bindings = 5; - */ - private $named_bindings; - /** - * Numbered binding site @1 references the first numbered parameter, - * effectively using 1-based indexing, rather than the usual 0. - * For each binding site numbered i in `query_string`, there must be an i-th - * numbered parameter. The inverse must also be true. - * - * Generated from protobuf field repeated .google.datastore.v1.GqlQueryParameter positional_bindings = 4; - */ - private $positional_bindings; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $query_string - * A string of the format described - * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). - * @type bool $allow_literals - * When false, the query string must not contain any literals and instead must - * bind all values. For example, - * `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while - * `SELECT * FROM Kind WHERE a = @value` is. - * @type array|\Google\Protobuf\Internal\MapField $named_bindings - * For each non-reserved named binding site in the query string, there must be - * a named parameter with that name, but not necessarily the inverse. - * Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex - * `__.*__`, and must not be `""`. - * @type array<\Google\Cloud\Datastore\V1\GqlQueryParameter>|\Google\Protobuf\Internal\RepeatedField $positional_bindings - * Numbered binding site @1 references the first numbered parameter, - * effectively using 1-based indexing, rather than the usual 0. - * For each binding site numbered i in `query_string`, there must be an i-th - * numbered parameter. The inverse must also be true. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * A string of the format described - * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). - * - * Generated from protobuf field string query_string = 1; - * @return string - */ - public function getQueryString() - { - return $this->query_string; - } - - /** - * A string of the format described - * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). - * - * Generated from protobuf field string query_string = 1; - * @param string $var - * @return $this - */ - public function setQueryString($var) - { - GPBUtil::checkString($var, True); - $this->query_string = $var; - - return $this; - } - - /** - * When false, the query string must not contain any literals and instead must - * bind all values. For example, - * `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while - * `SELECT * FROM Kind WHERE a = @value` is. - * - * Generated from protobuf field bool allow_literals = 2; - * @return bool - */ - public function getAllowLiterals() - { - return $this->allow_literals; - } - - /** - * When false, the query string must not contain any literals and instead must - * bind all values. For example, - * `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while - * `SELECT * FROM Kind WHERE a = @value` is. - * - * Generated from protobuf field bool allow_literals = 2; - * @param bool $var - * @return $this - */ - public function setAllowLiterals($var) - { - GPBUtil::checkBool($var); - $this->allow_literals = $var; - - return $this; - } - - /** - * For each non-reserved named binding site in the query string, there must be - * a named parameter with that name, but not necessarily the inverse. - * Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex - * `__.*__`, and must not be `""`. - * - * Generated from protobuf field map named_bindings = 5; - * @return \Google\Protobuf\Internal\MapField - */ - public function getNamedBindings() - { - return $this->named_bindings; - } - - /** - * For each non-reserved named binding site in the query string, there must be - * a named parameter with that name, but not necessarily the inverse. - * Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex - * `__.*__`, and must not be `""`. - * - * Generated from protobuf field map named_bindings = 5; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setNamedBindings($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\GqlQueryParameter::class); - $this->named_bindings = $arr; - - return $this; - } - - /** - * Numbered binding site @1 references the first numbered parameter, - * effectively using 1-based indexing, rather than the usual 0. - * For each binding site numbered i in `query_string`, there must be an i-th - * numbered parameter. The inverse must also be true. - * - * Generated from protobuf field repeated .google.datastore.v1.GqlQueryParameter positional_bindings = 4; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPositionalBindings() - { - return $this->positional_bindings; - } - - /** - * Numbered binding site @1 references the first numbered parameter, - * effectively using 1-based indexing, rather than the usual 0. - * For each binding site numbered i in `query_string`, there must be an i-th - * numbered parameter. The inverse must also be true. - * - * Generated from protobuf field repeated .google.datastore.v1.GqlQueryParameter positional_bindings = 4; - * @param array<\Google\Cloud\Datastore\V1\GqlQueryParameter>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPositionalBindings($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\GqlQueryParameter::class); - $this->positional_bindings = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQueryParameter.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQueryParameter.php deleted file mode 100644 index c180d0429d80..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/GqlQueryParameter.php +++ /dev/null @@ -1,111 +0,0 @@ -google.datastore.v1.GqlQueryParameter - */ -class GqlQueryParameter extends \Google\Protobuf\Internal\Message -{ - protected $parameter_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\Value $value - * A value parameter. - * @type string $cursor - * A query cursor. Query cursors are returned in query - * result batches. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * A value parameter. - * - * Generated from protobuf field .google.datastore.v1.Value value = 2; - * @return \Google\Cloud\Datastore\V1\Value|null - */ - public function getValue() - { - return $this->readOneof(2); - } - - public function hasValue() - { - return $this->hasOneof(2); - } - - /** - * A value parameter. - * - * Generated from protobuf field .google.datastore.v1.Value value = 2; - * @param \Google\Cloud\Datastore\V1\Value $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * A query cursor. Query cursors are returned in query - * result batches. - * - * Generated from protobuf field bytes cursor = 3; - * @return string - */ - public function getCursor() - { - return $this->readOneof(3); - } - - public function hasCursor() - { - return $this->hasOneof(3); - } - - /** - * A query cursor. Query cursors are returned in query - * result batches. - * - * Generated from protobuf field bytes cursor = 3; - * @param string $var - * @return $this - */ - public function setCursor($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getParameterType() - { - return $this->whichOneof("parameter_type"); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key.php deleted file mode 100644 index a399e216a16d..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key.php +++ /dev/null @@ -1,174 +0,0 @@ -google.datastore.v1.Key - */ -class Key extends \Google\Protobuf\Internal\Message -{ - /** - * Entities are partitioned into subsets, currently identified by a project - * ID and namespace ID. - * Queries are scoped to a single partition. - * - * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 1; - */ - protected $partition_id = null; - /** - * The entity path. - * An entity path consists of one or more elements composed of a kind and a - * string or numerical identifier, which identify entities. The first - * element identifies a _root entity_, the second element identifies - * a _child_ of the root entity, the third element identifies a child of the - * second entity, and so forth. The entities identified by all prefixes of - * the path are called the element's _ancestors_. - * An entity path is always fully complete: *all* of the entity's ancestors - * are required to be in the path along with the entity identifier itself. - * The only exception is that in some documented cases, the identifier in the - * last path element (for the entity) itself may be omitted. For example, - * the last path element of the key of `Mutation.insert` may have no - * identifier. - * A path can never be empty, and a path can have at most 100 elements. - * - * Generated from protobuf field repeated .google.datastore.v1.Key.PathElement path = 2; - */ - private $path; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\PartitionId $partition_id - * Entities are partitioned into subsets, currently identified by a project - * ID and namespace ID. - * Queries are scoped to a single partition. - * @type array<\Google\Cloud\Datastore\V1\Key\PathElement>|\Google\Protobuf\Internal\RepeatedField $path - * The entity path. - * An entity path consists of one or more elements composed of a kind and a - * string or numerical identifier, which identify entities. The first - * element identifies a _root entity_, the second element identifies - * a _child_ of the root entity, the third element identifies a child of the - * second entity, and so forth. The entities identified by all prefixes of - * the path are called the element's _ancestors_. - * An entity path is always fully complete: *all* of the entity's ancestors - * are required to be in the path along with the entity identifier itself. - * The only exception is that in some documented cases, the identifier in the - * last path element (for the entity) itself may be omitted. For example, - * the last path element of the key of `Mutation.insert` may have no - * identifier. - * A path can never be empty, and a path can have at most 100 elements. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Entity::initOnce(); - parent::__construct($data); - } - - /** - * Entities are partitioned into subsets, currently identified by a project - * ID and namespace ID. - * Queries are scoped to a single partition. - * - * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 1; - * @return \Google\Cloud\Datastore\V1\PartitionId|null - */ - public function getPartitionId() - { - return $this->partition_id; - } - - public function hasPartitionId() - { - return isset($this->partition_id); - } - - public function clearPartitionId() - { - unset($this->partition_id); - } - - /** - * Entities are partitioned into subsets, currently identified by a project - * ID and namespace ID. - * Queries are scoped to a single partition. - * - * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 1; - * @param \Google\Cloud\Datastore\V1\PartitionId $var - * @return $this - */ - public function setPartitionId($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PartitionId::class); - $this->partition_id = $var; - - return $this; - } - - /** - * The entity path. - * An entity path consists of one or more elements composed of a kind and a - * string or numerical identifier, which identify entities. The first - * element identifies a _root entity_, the second element identifies - * a _child_ of the root entity, the third element identifies a child of the - * second entity, and so forth. The entities identified by all prefixes of - * the path are called the element's _ancestors_. - * An entity path is always fully complete: *all* of the entity's ancestors - * are required to be in the path along with the entity identifier itself. - * The only exception is that in some documented cases, the identifier in the - * last path element (for the entity) itself may be omitted. For example, - * the last path element of the key of `Mutation.insert` may have no - * identifier. - * A path can never be empty, and a path can have at most 100 elements. - * - * Generated from protobuf field repeated .google.datastore.v1.Key.PathElement path = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPath() - { - return $this->path; - } - - /** - * The entity path. - * An entity path consists of one or more elements composed of a kind and a - * string or numerical identifier, which identify entities. The first - * element identifies a _root entity_, the second element identifies - * a _child_ of the root entity, the third element identifies a child of the - * second entity, and so forth. The entities identified by all prefixes of - * the path are called the element's _ancestors_. - * An entity path is always fully complete: *all* of the entity's ancestors - * are required to be in the path along with the entity identifier itself. - * The only exception is that in some documented cases, the identifier in the - * last path element (for the entity) itself may be omitted. For example, - * the last path element of the key of `Mutation.insert` may have no - * identifier. - * A path can never be empty, and a path can have at most 100 elements. - * - * Generated from protobuf field repeated .google.datastore.v1.Key.PathElement path = 2; - * @param array<\Google\Cloud\Datastore\V1\Key\PathElement>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPath($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Key\PathElement::class); - $this->path = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key/PathElement.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key/PathElement.php deleted file mode 100644 index df942e9128e1..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Key/PathElement.php +++ /dev/null @@ -1,195 +0,0 @@ -google.datastore.v1.Key.PathElement - */ -class PathElement extends \Google\Protobuf\Internal\Message -{ - /** - * The kind of the entity. - * A kind matching regex `__.*__` is reserved/read-only. - * A kind must not contain more than 1500 bytes when UTF-8 encoded. - * Cannot be `""`. - * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are - * encoded as `__bytes__` where `` is the base-64 encoding of the - * bytes. - * - * Generated from protobuf field string kind = 1; - */ - protected $kind = ''; - protected $id_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $kind - * The kind of the entity. - * A kind matching regex `__.*__` is reserved/read-only. - * A kind must not contain more than 1500 bytes when UTF-8 encoded. - * Cannot be `""`. - * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are - * encoded as `__bytes__` where `` is the base-64 encoding of the - * bytes. - * @type int|string $id - * The auto-allocated ID of the entity. - * Never equal to zero. Values less than zero are discouraged and may not - * be supported in the future. - * @type string $name - * The name of the entity. - * A name matching regex `__.*__` is reserved/read-only. - * A name must not be more than 1500 bytes when UTF-8 encoded. - * Cannot be `""`. - * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are - * encoded as `__bytes__` where `` is the base-64 encoding of the - * bytes. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Entity::initOnce(); - parent::__construct($data); - } - - /** - * The kind of the entity. - * A kind matching regex `__.*__` is reserved/read-only. - * A kind must not contain more than 1500 bytes when UTF-8 encoded. - * Cannot be `""`. - * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are - * encoded as `__bytes__` where `` is the base-64 encoding of the - * bytes. - * - * Generated from protobuf field string kind = 1; - * @return string - */ - public function getKind() - { - return $this->kind; - } - - /** - * The kind of the entity. - * A kind matching regex `__.*__` is reserved/read-only. - * A kind must not contain more than 1500 bytes when UTF-8 encoded. - * Cannot be `""`. - * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are - * encoded as `__bytes__` where `` is the base-64 encoding of the - * bytes. - * - * Generated from protobuf field string kind = 1; - * @param string $var - * @return $this - */ - public function setKind($var) - { - GPBUtil::checkString($var, True); - $this->kind = $var; - - return $this; - } - - /** - * The auto-allocated ID of the entity. - * Never equal to zero. Values less than zero are discouraged and may not - * be supported in the future. - * - * Generated from protobuf field int64 id = 2; - * @return int|string - */ - public function getId() - { - return $this->readOneof(2); - } - - public function hasId() - { - return $this->hasOneof(2); - } - - /** - * The auto-allocated ID of the entity. - * Never equal to zero. Values less than zero are discouraged and may not - * be supported in the future. - * - * Generated from protobuf field int64 id = 2; - * @param int|string $var - * @return $this - */ - public function setId($var) - { - GPBUtil::checkInt64($var); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * The name of the entity. - * A name matching regex `__.*__` is reserved/read-only. - * A name must not be more than 1500 bytes when UTF-8 encoded. - * Cannot be `""`. - * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are - * encoded as `__bytes__` where `` is the base-64 encoding of the - * bytes. - * - * Generated from protobuf field string name = 3; - * @return string - */ - public function getName() - { - return $this->readOneof(3); - } - - public function hasName() - { - return $this->hasOneof(3); - } - - /** - * The name of the entity. - * A name matching regex `__.*__` is reserved/read-only. - * A name must not be more than 1500 bytes when UTF-8 encoded. - * Cannot be `""`. - * Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are - * encoded as `__bytes__` where `` is the base-64 encoding of the - * bytes. - * - * Generated from protobuf field string name = 3; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getIdType() - { - return $this->whichOneof("id_type"); - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PathElement::class, \Google\Cloud\Datastore\V1\Key_PathElement::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/KindExpression.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/KindExpression.php deleted file mode 100644 index be49b78b627c..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/KindExpression.php +++ /dev/null @@ -1,67 +0,0 @@ -google.datastore.v1.KindExpression - */ -class KindExpression extends \Google\Protobuf\Internal\Message -{ - /** - * The name of the kind. - * - * Generated from protobuf field string name = 1; - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * The name of the kind. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The name of the kind. - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The name of the kind. - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupRequest.php deleted file mode 100644 index de73e6c97ef1..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupRequest.php +++ /dev/null @@ -1,260 +0,0 @@ -google.datastore.v1.LookupRequest - */ -class LookupRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project_id = ''; - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - */ - protected $database_id = ''; - /** - * The options for this lookup request. - * - * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; - */ - protected $read_options = null; - /** - * Required. Keys of entities to look up. - * - * Generated from protobuf field repeated .google.datastore.v1.Key keys = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - private $keys; - /** - * The properties to return. Defaults to returning all properties. - * If this field is set and an entity has a property not referenced in the - * mask, it will be absent from [LookupResponse.found.entity.properties][]. - * The entity's key is always returned. - * - * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 5; - */ - protected $property_mask = null; - - /** - * @param string $projectId Required. The ID of the project against which to make the request. - * @param \Google\Cloud\Datastore\V1\ReadOptions $readOptions The options for this lookup request. - * @param \Google\Cloud\Datastore\V1\Key[] $keys Required. Keys of entities to look up. - * - * @return \Google\Cloud\Datastore\V1\LookupRequest - * - * @experimental - */ - public static function build(string $projectId, \Google\Cloud\Datastore\V1\ReadOptions $readOptions, array $keys): self - { - return (new self()) - ->setProjectId($projectId) - ->setReadOptions($readOptions) - ->setKeys($keys); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Required. The ID of the project against which to make the request. - * @type string $database_id - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type \Google\Cloud\Datastore\V1\ReadOptions $read_options - * The options for this lookup request. - * @type array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $keys - * Required. Keys of entities to look up. - * @type \Google\Cloud\Datastore\V1\PropertyMask $property_mask - * The properties to return. Defaults to returning all properties. - * If this field is set and an entity has a property not referenced in the - * mask, it will be absent from [LookupResponse.found.entity.properties][]. - * The entity's key is always returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @return string - */ - public function getDatabaseId() - { - return $this->database_id; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @param string $var - * @return $this - */ - public function setDatabaseId($var) - { - GPBUtil::checkString($var, True); - $this->database_id = $var; - - return $this; - } - - /** - * The options for this lookup request. - * - * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; - * @return \Google\Cloud\Datastore\V1\ReadOptions|null - */ - public function getReadOptions() - { - return $this->read_options; - } - - public function hasReadOptions() - { - return isset($this->read_options); - } - - public function clearReadOptions() - { - unset($this->read_options); - } - - /** - * The options for this lookup request. - * - * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; - * @param \Google\Cloud\Datastore\V1\ReadOptions $var - * @return $this - */ - public function setReadOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ReadOptions::class); - $this->read_options = $var; - - return $this; - } - - /** - * Required. Keys of entities to look up. - * - * Generated from protobuf field repeated .google.datastore.v1.Key keys = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getKeys() - { - return $this->keys; - } - - /** - * Required. Keys of entities to look up. - * - * Generated from protobuf field repeated .google.datastore.v1.Key keys = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setKeys($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Key::class); - $this->keys = $arr; - - return $this; - } - - /** - * The properties to return. Defaults to returning all properties. - * If this field is set and an entity has a property not referenced in the - * mask, it will be absent from [LookupResponse.found.entity.properties][]. - * The entity's key is always returned. - * - * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 5; - * @return \Google\Cloud\Datastore\V1\PropertyMask|null - */ - public function getPropertyMask() - { - return $this->property_mask; - } - - public function hasPropertyMask() - { - return isset($this->property_mask); - } - - public function clearPropertyMask() - { - unset($this->property_mask); - } - - /** - * The properties to return. Defaults to returning all properties. - * If this field is set and an entity has a property not referenced in the - * mask, it will be absent from [LookupResponse.found.entity.properties][]. - * The entity's key is always returned. - * - * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 5; - * @param \Google\Cloud\Datastore\V1\PropertyMask $var - * @return $this - */ - public function setPropertyMask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyMask::class); - $this->property_mask = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupResponse.php deleted file mode 100644 index e33d8a7f8742..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/LookupResponse.php +++ /dev/null @@ -1,257 +0,0 @@ -google.datastore.v1.LookupResponse - */ -class LookupResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Entities found as `ResultType.FULL` entities. The order of results in this - * field is undefined and has no relation to the order of the keys in the - * input. - * - * Generated from protobuf field repeated .google.datastore.v1.EntityResult found = 1; - */ - private $found; - /** - * Entities not found as `ResultType.KEY_ONLY` entities. The order of results - * in this field is undefined and has no relation to the order of the keys - * in the input. - * - * Generated from protobuf field repeated .google.datastore.v1.EntityResult missing = 2; - */ - private $missing; - /** - * A list of keys that were not looked up due to resource constraints. The - * order of results in this field is undefined and has no relation to the - * order of the keys in the input. - * - * Generated from protobuf field repeated .google.datastore.v1.Key deferred = 3; - */ - private $deferred; - /** - * The identifier of the transaction that was started as part of this Lookup - * request. - * Set only when - * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - * was set in - * [LookupRequest.read_options][google.datastore.v1.LookupRequest.read_options]. - * - * Generated from protobuf field bytes transaction = 5; - */ - protected $transaction = ''; - /** - * The time at which these entities were read or found missing. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; - */ - protected $read_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Datastore\V1\EntityResult>|\Google\Protobuf\Internal\RepeatedField $found - * Entities found as `ResultType.FULL` entities. The order of results in this - * field is undefined and has no relation to the order of the keys in the - * input. - * @type array<\Google\Cloud\Datastore\V1\EntityResult>|\Google\Protobuf\Internal\RepeatedField $missing - * Entities not found as `ResultType.KEY_ONLY` entities. The order of results - * in this field is undefined and has no relation to the order of the keys - * in the input. - * @type array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $deferred - * A list of keys that were not looked up due to resource constraints. The - * order of results in this field is undefined and has no relation to the - * order of the keys in the input. - * @type string $transaction - * The identifier of the transaction that was started as part of this Lookup - * request. - * Set only when - * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - * was set in - * [LookupRequest.read_options][google.datastore.v1.LookupRequest.read_options]. - * @type \Google\Protobuf\Timestamp $read_time - * The time at which these entities were read or found missing. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * Entities found as `ResultType.FULL` entities. The order of results in this - * field is undefined and has no relation to the order of the keys in the - * input. - * - * Generated from protobuf field repeated .google.datastore.v1.EntityResult found = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getFound() - { - return $this->found; - } - - /** - * Entities found as `ResultType.FULL` entities. The order of results in this - * field is undefined and has no relation to the order of the keys in the - * input. - * - * Generated from protobuf field repeated .google.datastore.v1.EntityResult found = 1; - * @param array<\Google\Cloud\Datastore\V1\EntityResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setFound($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\EntityResult::class); - $this->found = $arr; - - return $this; - } - - /** - * Entities not found as `ResultType.KEY_ONLY` entities. The order of results - * in this field is undefined and has no relation to the order of the keys - * in the input. - * - * Generated from protobuf field repeated .google.datastore.v1.EntityResult missing = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getMissing() - { - return $this->missing; - } - - /** - * Entities not found as `ResultType.KEY_ONLY` entities. The order of results - * in this field is undefined and has no relation to the order of the keys - * in the input. - * - * Generated from protobuf field repeated .google.datastore.v1.EntityResult missing = 2; - * @param array<\Google\Cloud\Datastore\V1\EntityResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setMissing($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\EntityResult::class); - $this->missing = $arr; - - return $this; - } - - /** - * A list of keys that were not looked up due to resource constraints. The - * order of results in this field is undefined and has no relation to the - * order of the keys in the input. - * - * Generated from protobuf field repeated .google.datastore.v1.Key deferred = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDeferred() - { - return $this->deferred; - } - - /** - * A list of keys that were not looked up due to resource constraints. The - * order of results in this field is undefined and has no relation to the - * order of the keys in the input. - * - * Generated from protobuf field repeated .google.datastore.v1.Key deferred = 3; - * @param array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDeferred($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Key::class); - $this->deferred = $arr; - - return $this; - } - - /** - * The identifier of the transaction that was started as part of this Lookup - * request. - * Set only when - * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - * was set in - * [LookupRequest.read_options][google.datastore.v1.LookupRequest.read_options]. - * - * Generated from protobuf field bytes transaction = 5; - * @return string - */ - public function getTransaction() - { - return $this->transaction; - } - - /** - * The identifier of the transaction that was started as part of this Lookup - * request. - * Set only when - * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - * was set in - * [LookupRequest.read_options][google.datastore.v1.LookupRequest.read_options]. - * - * Generated from protobuf field bytes transaction = 5; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->transaction = $var; - - return $this; - } - - /** - * The time at which these entities were read or found missing. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->read_time; - } - - public function hasReadTime() - { - return isset($this->read_time); - } - - public function clearReadTime() - { - unset($this->read_time); - } - - /** - * The time at which these entities were read or found missing. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 7; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->read_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation.php deleted file mode 100644 index 8721321c562a..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation.php +++ /dev/null @@ -1,429 +0,0 @@ -google.datastore.v1.Mutation - */ -class Mutation extends \Google\Protobuf\Internal\Message -{ - /** - * The strategy to use when a conflict is detected. Defaults to - * `SERVER_VALUE`. - * If this is set, then `conflict_detection_strategy` must also be set. - * - * Generated from protobuf field .google.datastore.v1.Mutation.ConflictResolutionStrategy conflict_resolution_strategy = 10; - */ - protected $conflict_resolution_strategy = 0; - /** - * The properties to write in this mutation. - * None of the properties in the mask may have a reserved name, except for - * `__key__`. - * This field is ignored for `delete`. - * If the entity already exists, only properties referenced in the mask are - * updated, others are left untouched. - * Properties referenced in the mask but not in the entity are deleted. - * - * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 9; - */ - protected $property_mask = null; - /** - * Optional. The transforms to perform on the entity. - * This field can be set only when the operation is `insert`, `update`, - * or `upsert`. If present, the transforms are be applied to the entity - * regardless of the property mask, in order, after the operation. - * - * Generated from protobuf field repeated .google.datastore.v1.PropertyTransform property_transforms = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - private $property_transforms; - protected $operation; - protected $conflict_detection_strategy; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\Entity $insert - * The entity to insert. The entity must not already exist. - * The entity key's final path element may be incomplete. - * @type \Google\Cloud\Datastore\V1\Entity $update - * The entity to update. The entity must already exist. - * Must have a complete key path. - * @type \Google\Cloud\Datastore\V1\Entity $upsert - * The entity to upsert. The entity may or may not already exist. - * The entity key's final path element may be incomplete. - * @type \Google\Cloud\Datastore\V1\Key $delete - * The key of the entity to delete. The entity may or may not already exist. - * Must have a complete key path and must not be reserved/read-only. - * @type int|string $base_version - * The version of the entity that this mutation is being applied - * to. If this does not match the current version on the server, the - * mutation conflicts. - * @type \Google\Protobuf\Timestamp $update_time - * The update time of the entity that this mutation is being applied - * to. If this does not match the current update time on the server, the - * mutation conflicts. - * @type int $conflict_resolution_strategy - * The strategy to use when a conflict is detected. Defaults to - * `SERVER_VALUE`. - * If this is set, then `conflict_detection_strategy` must also be set. - * @type \Google\Cloud\Datastore\V1\PropertyMask $property_mask - * The properties to write in this mutation. - * None of the properties in the mask may have a reserved name, except for - * `__key__`. - * This field is ignored for `delete`. - * If the entity already exists, only properties referenced in the mask are - * updated, others are left untouched. - * Properties referenced in the mask but not in the entity are deleted. - * @type array<\Google\Cloud\Datastore\V1\PropertyTransform>|\Google\Protobuf\Internal\RepeatedField $property_transforms - * Optional. The transforms to perform on the entity. - * This field can be set only when the operation is `insert`, `update`, - * or `upsert`. If present, the transforms are be applied to the entity - * regardless of the property mask, in order, after the operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * The entity to insert. The entity must not already exist. - * The entity key's final path element may be incomplete. - * - * Generated from protobuf field .google.datastore.v1.Entity insert = 4; - * @return \Google\Cloud\Datastore\V1\Entity|null - */ - public function getInsert() - { - return $this->readOneof(4); - } - - public function hasInsert() - { - return $this->hasOneof(4); - } - - /** - * The entity to insert. The entity must not already exist. - * The entity key's final path element may be incomplete. - * - * Generated from protobuf field .google.datastore.v1.Entity insert = 4; - * @param \Google\Cloud\Datastore\V1\Entity $var - * @return $this - */ - public function setInsert($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Entity::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * The entity to update. The entity must already exist. - * Must have a complete key path. - * - * Generated from protobuf field .google.datastore.v1.Entity update = 5; - * @return \Google\Cloud\Datastore\V1\Entity|null - */ - public function getUpdate() - { - return $this->readOneof(5); - } - - public function hasUpdate() - { - return $this->hasOneof(5); - } - - /** - * The entity to update. The entity must already exist. - * Must have a complete key path. - * - * Generated from protobuf field .google.datastore.v1.Entity update = 5; - * @param \Google\Cloud\Datastore\V1\Entity $var - * @return $this - */ - public function setUpdate($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Entity::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * The entity to upsert. The entity may or may not already exist. - * The entity key's final path element may be incomplete. - * - * Generated from protobuf field .google.datastore.v1.Entity upsert = 6; - * @return \Google\Cloud\Datastore\V1\Entity|null - */ - public function getUpsert() - { - return $this->readOneof(6); - } - - public function hasUpsert() - { - return $this->hasOneof(6); - } - - /** - * The entity to upsert. The entity may or may not already exist. - * The entity key's final path element may be incomplete. - * - * Generated from protobuf field .google.datastore.v1.Entity upsert = 6; - * @param \Google\Cloud\Datastore\V1\Entity $var - * @return $this - */ - public function setUpsert($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Entity::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * The key of the entity to delete. The entity may or may not already exist. - * Must have a complete key path and must not be reserved/read-only. - * - * Generated from protobuf field .google.datastore.v1.Key delete = 7; - * @return \Google\Cloud\Datastore\V1\Key|null - */ - public function getDelete() - { - return $this->readOneof(7); - } - - public function hasDelete() - { - return $this->hasOneof(7); - } - - /** - * The key of the entity to delete. The entity may or may not already exist. - * Must have a complete key path and must not be reserved/read-only. - * - * Generated from protobuf field .google.datastore.v1.Key delete = 7; - * @param \Google\Cloud\Datastore\V1\Key $var - * @return $this - */ - public function setDelete($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Key::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * The version of the entity that this mutation is being applied - * to. If this does not match the current version on the server, the - * mutation conflicts. - * - * Generated from protobuf field int64 base_version = 8; - * @return int|string - */ - public function getBaseVersion() - { - return $this->readOneof(8); - } - - public function hasBaseVersion() - { - return $this->hasOneof(8); - } - - /** - * The version of the entity that this mutation is being applied - * to. If this does not match the current version on the server, the - * mutation conflicts. - * - * Generated from protobuf field int64 base_version = 8; - * @param int|string $var - * @return $this - */ - public function setBaseVersion($var) - { - GPBUtil::checkInt64($var); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * The update time of the entity that this mutation is being applied - * to. If this does not match the current update time on the server, the - * mutation conflicts. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->readOneof(11); - } - - public function hasUpdateTime() - { - return $this->hasOneof(11); - } - - /** - * The update time of the entity that this mutation is being applied - * to. If this does not match the current update time on the server, the - * mutation conflicts. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 11; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * The strategy to use when a conflict is detected. Defaults to - * `SERVER_VALUE`. - * If this is set, then `conflict_detection_strategy` must also be set. - * - * Generated from protobuf field .google.datastore.v1.Mutation.ConflictResolutionStrategy conflict_resolution_strategy = 10; - * @return int - */ - public function getConflictResolutionStrategy() - { - return $this->conflict_resolution_strategy; - } - - /** - * The strategy to use when a conflict is detected. Defaults to - * `SERVER_VALUE`. - * If this is set, then `conflict_detection_strategy` must also be set. - * - * Generated from protobuf field .google.datastore.v1.Mutation.ConflictResolutionStrategy conflict_resolution_strategy = 10; - * @param int $var - * @return $this - */ - public function setConflictResolutionStrategy($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\Mutation\ConflictResolutionStrategy::class); - $this->conflict_resolution_strategy = $var; - - return $this; - } - - /** - * The properties to write in this mutation. - * None of the properties in the mask may have a reserved name, except for - * `__key__`. - * This field is ignored for `delete`. - * If the entity already exists, only properties referenced in the mask are - * updated, others are left untouched. - * Properties referenced in the mask but not in the entity are deleted. - * - * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 9; - * @return \Google\Cloud\Datastore\V1\PropertyMask|null - */ - public function getPropertyMask() - { - return $this->property_mask; - } - - public function hasPropertyMask() - { - return isset($this->property_mask); - } - - public function clearPropertyMask() - { - unset($this->property_mask); - } - - /** - * The properties to write in this mutation. - * None of the properties in the mask may have a reserved name, except for - * `__key__`. - * This field is ignored for `delete`. - * If the entity already exists, only properties referenced in the mask are - * updated, others are left untouched. - * Properties referenced in the mask but not in the entity are deleted. - * - * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 9; - * @param \Google\Cloud\Datastore\V1\PropertyMask $var - * @return $this - */ - public function setPropertyMask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyMask::class); - $this->property_mask = $var; - - return $this; - } - - /** - * Optional. The transforms to perform on the entity. - * This field can be set only when the operation is `insert`, `update`, - * or `upsert`. If present, the transforms are be applied to the entity - * regardless of the property mask, in order, after the operation. - * - * Generated from protobuf field repeated .google.datastore.v1.PropertyTransform property_transforms = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPropertyTransforms() - { - return $this->property_transforms; - } - - /** - * Optional. The transforms to perform on the entity. - * This field can be set only when the operation is `insert`, `update`, - * or `upsert`. If present, the transforms are be applied to the entity - * regardless of the property mask, in order, after the operation. - * - * Generated from protobuf field repeated .google.datastore.v1.PropertyTransform property_transforms = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param array<\Google\Cloud\Datastore\V1\PropertyTransform>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPropertyTransforms($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\PropertyTransform::class); - $this->property_transforms = $arr; - - return $this; - } - - /** - * @return string - */ - public function getOperation() - { - return $this->whichOneof("operation"); - } - - /** - * @return string - */ - public function getConflictDetectionStrategy() - { - return $this->whichOneof("conflict_detection_strategy"); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation/ConflictResolutionStrategy.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation/ConflictResolutionStrategy.php deleted file mode 100644 index f2809890ebe1..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Mutation/ConflictResolutionStrategy.php +++ /dev/null @@ -1,64 +0,0 @@ -google.datastore.v1.Mutation.ConflictResolutionStrategy - */ -class ConflictResolutionStrategy -{ - /** - * Unspecified. Defaults to `SERVER_VALUE`. - * - * Generated from protobuf enum STRATEGY_UNSPECIFIED = 0; - */ - const STRATEGY_UNSPECIFIED = 0; - /** - * The server entity is kept. - * - * Generated from protobuf enum SERVER_VALUE = 1; - */ - const SERVER_VALUE = 1; - /** - * The whole commit request fails. - * - * Generated from protobuf enum FAIL = 3; - */ - const FAIL = 3; - - private static $valueToName = [ - self::STRATEGY_UNSPECIFIED => 'STRATEGY_UNSPECIFIED', - self::SERVER_VALUE => 'SERVER_VALUE', - self::FAIL => 'FAIL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ConflictResolutionStrategy::class, \Google\Cloud\Datastore\V1\Mutation_ConflictResolutionStrategy::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/MutationResult.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/MutationResult.php deleted file mode 100644 index 8dad8eba89fa..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/MutationResult.php +++ /dev/null @@ -1,311 +0,0 @@ -google.datastore.v1.MutationResult - */ -class MutationResult extends \Google\Protobuf\Internal\Message -{ - /** - * The automatically allocated key. - * Set only when the mutation allocated a key. - * - * Generated from protobuf field .google.datastore.v1.Key key = 3; - */ - protected $key = null; - /** - * The version of the entity on the server after processing the mutation. If - * the mutation doesn't change anything on the server, then the version will - * be the version of the current entity or, if no entity is present, a version - * that is strictly greater than the version of any previous entity and less - * than the version of any possible future entity. - * - * Generated from protobuf field int64 version = 4; - */ - protected $version = 0; - /** - * The create time of the entity. This field will not be set after a 'delete'. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; - */ - protected $create_time = null; - /** - * The update time of the entity on the server after processing the mutation. - * If the mutation doesn't change anything on the server, then the timestamp - * will be the update timestamp of the current entity. This field will not be - * set after a 'delete'. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - */ - protected $update_time = null; - /** - * Whether a conflict was detected for this mutation. Always false when a - * conflict detection strategy field is not set in the mutation. - * - * Generated from protobuf field bool conflict_detected = 5; - */ - protected $conflict_detected = false; - /** - * The results of applying each - * [PropertyTransform][google.datastore.v1.PropertyTransform], in the same - * order of the request. - * - * Generated from protobuf field repeated .google.datastore.v1.Value transform_results = 8; - */ - private $transform_results; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\Key $key - * The automatically allocated key. - * Set only when the mutation allocated a key. - * @type int|string $version - * The version of the entity on the server after processing the mutation. If - * the mutation doesn't change anything on the server, then the version will - * be the version of the current entity or, if no entity is present, a version - * that is strictly greater than the version of any previous entity and less - * than the version of any possible future entity. - * @type \Google\Protobuf\Timestamp $create_time - * The create time of the entity. This field will not be set after a 'delete'. - * @type \Google\Protobuf\Timestamp $update_time - * The update time of the entity on the server after processing the mutation. - * If the mutation doesn't change anything on the server, then the timestamp - * will be the update timestamp of the current entity. This field will not be - * set after a 'delete'. - * @type bool $conflict_detected - * Whether a conflict was detected for this mutation. Always false when a - * conflict detection strategy field is not set in the mutation. - * @type array<\Google\Cloud\Datastore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $transform_results - * The results of applying each - * [PropertyTransform][google.datastore.v1.PropertyTransform], in the same - * order of the request. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * The automatically allocated key. - * Set only when the mutation allocated a key. - * - * Generated from protobuf field .google.datastore.v1.Key key = 3; - * @return \Google\Cloud\Datastore\V1\Key|null - */ - public function getKey() - { - return $this->key; - } - - public function hasKey() - { - return isset($this->key); - } - - public function clearKey() - { - unset($this->key); - } - - /** - * The automatically allocated key. - * Set only when the mutation allocated a key. - * - * Generated from protobuf field .google.datastore.v1.Key key = 3; - * @param \Google\Cloud\Datastore\V1\Key $var - * @return $this - */ - public function setKey($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Key::class); - $this->key = $var; - - return $this; - } - - /** - * The version of the entity on the server after processing the mutation. If - * the mutation doesn't change anything on the server, then the version will - * be the version of the current entity or, if no entity is present, a version - * that is strictly greater than the version of any previous entity and less - * than the version of any possible future entity. - * - * Generated from protobuf field int64 version = 4; - * @return int|string - */ - public function getVersion() - { - return $this->version; - } - - /** - * The version of the entity on the server after processing the mutation. If - * the mutation doesn't change anything on the server, then the version will - * be the version of the current entity or, if no entity is present, a version - * that is strictly greater than the version of any previous entity and less - * than the version of any possible future entity. - * - * Generated from protobuf field int64 version = 4; - * @param int|string $var - * @return $this - */ - public function setVersion($var) - { - GPBUtil::checkInt64($var); - $this->version = $var; - - return $this; - } - - /** - * The create time of the entity. This field will not be set after a 'delete'. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; - * @return \Google\Protobuf\Timestamp|null - */ - public function getCreateTime() - { - return $this->create_time; - } - - public function hasCreateTime() - { - return isset($this->create_time); - } - - public function clearCreateTime() - { - unset($this->create_time); - } - - /** - * The create time of the entity. This field will not be set after a 'delete'. - * - * Generated from protobuf field .google.protobuf.Timestamp create_time = 7; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setCreateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->create_time = $var; - - return $this; - } - - /** - * The update time of the entity on the server after processing the mutation. - * If the mutation doesn't change anything on the server, then the timestamp - * will be the update timestamp of the current entity. This field will not be - * set after a 'delete'. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @return \Google\Protobuf\Timestamp|null - */ - public function getUpdateTime() - { - return $this->update_time; - } - - public function hasUpdateTime() - { - return isset($this->update_time); - } - - public function clearUpdateTime() - { - unset($this->update_time); - } - - /** - * The update time of the entity on the server after processing the mutation. - * If the mutation doesn't change anything on the server, then the timestamp - * will be the update timestamp of the current entity. This field will not be - * set after a 'delete'. - * - * Generated from protobuf field .google.protobuf.Timestamp update_time = 6; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setUpdateTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->update_time = $var; - - return $this; - } - - /** - * Whether a conflict was detected for this mutation. Always false when a - * conflict detection strategy field is not set in the mutation. - * - * Generated from protobuf field bool conflict_detected = 5; - * @return bool - */ - public function getConflictDetected() - { - return $this->conflict_detected; - } - - /** - * Whether a conflict was detected for this mutation. Always false when a - * conflict detection strategy field is not set in the mutation. - * - * Generated from protobuf field bool conflict_detected = 5; - * @param bool $var - * @return $this - */ - public function setConflictDetected($var) - { - GPBUtil::checkBool($var); - $this->conflict_detected = $var; - - return $this; - } - - /** - * The results of applying each - * [PropertyTransform][google.datastore.v1.PropertyTransform], in the same - * order of the request. - * - * Generated from protobuf field repeated .google.datastore.v1.Value transform_results = 8; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getTransformResults() - { - return $this->transform_results; - } - - /** - * The results of applying each - * [PropertyTransform][google.datastore.v1.PropertyTransform], in the same - * order of the request. - * - * Generated from protobuf field repeated .google.datastore.v1.Value transform_results = 8; - * @param array<\Google\Cloud\Datastore\V1\Value>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setTransformResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Value::class); - $this->transform_results = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PartitionId.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PartitionId.php deleted file mode 100644 index c2f4e7864f4b..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PartitionId.php +++ /dev/null @@ -1,154 +0,0 @@ -google.datastore.v1.PartitionId - */ -class PartitionId extends \Google\Protobuf\Internal\Message -{ - /** - * The ID of the project to which the entities belong. - * - * Generated from protobuf field string project_id = 2; - */ - protected $project_id = ''; - /** - * If not empty, the ID of the database to which the entities - * belong. - * - * Generated from protobuf field string database_id = 3; - */ - protected $database_id = ''; - /** - * If not empty, the ID of the namespace to which the entities belong. - * - * Generated from protobuf field string namespace_id = 4; - */ - protected $namespace_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * The ID of the project to which the entities belong. - * @type string $database_id - * If not empty, the ID of the database to which the entities - * belong. - * @type string $namespace_id - * If not empty, the ID of the namespace to which the entities belong. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Entity::initOnce(); - parent::__construct($data); - } - - /** - * The ID of the project to which the entities belong. - * - * Generated from protobuf field string project_id = 2; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * The ID of the project to which the entities belong. - * - * Generated from protobuf field string project_id = 2; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * If not empty, the ID of the database to which the entities - * belong. - * - * Generated from protobuf field string database_id = 3; - * @return string - */ - public function getDatabaseId() - { - return $this->database_id; - } - - /** - * If not empty, the ID of the database to which the entities - * belong. - * - * Generated from protobuf field string database_id = 3; - * @param string $var - * @return $this - */ - public function setDatabaseId($var) - { - GPBUtil::checkString($var, True); - $this->database_id = $var; - - return $this; - } - - /** - * If not empty, the ID of the namespace to which the entities belong. - * - * Generated from protobuf field string namespace_id = 4; - * @return string - */ - public function getNamespaceId() - { - return $this->namespace_id; - } - - /** - * If not empty, the ID of the namespace to which the entities belong. - * - * Generated from protobuf field string namespace_id = 4; - * @param string $var - * @return $this - */ - public function setNamespaceId($var) - { - GPBUtil::checkString($var, True); - $this->namespace_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PlanSummary.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PlanSummary.php deleted file mode 100644 index 92b12043c889..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PlanSummary.php +++ /dev/null @@ -1,83 +0,0 @@ -google.datastore.v1.PlanSummary - */ -class PlanSummary extends \Google\Protobuf\Internal\Message -{ - /** - * The indexes selected for the query. For example: - * [ - * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, - * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} - * ] - * - * Generated from protobuf field repeated .google.protobuf.Struct indexes_used = 1; - */ - private $indexes_used; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Protobuf\Struct>|\Google\Protobuf\Internal\RepeatedField $indexes_used - * The indexes selected for the query. For example: - * [ - * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, - * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} - * ] - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\QueryProfile::initOnce(); - parent::__construct($data); - } - - /** - * The indexes selected for the query. For example: - * [ - * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, - * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} - * ] - * - * Generated from protobuf field repeated .google.protobuf.Struct indexes_used = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIndexesUsed() - { - return $this->indexes_used; - } - - /** - * The indexes selected for the query. For example: - * [ - * {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, - * {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} - * ] - * - * Generated from protobuf field repeated .google.protobuf.Struct indexes_used = 1; - * @param array<\Google\Protobuf\Struct>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIndexesUsed($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Struct::class); - $this->indexes_used = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Projection.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Projection.php deleted file mode 100644 index 614ebde6d27f..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Projection.php +++ /dev/null @@ -1,77 +0,0 @@ -google.datastore.v1.Projection - */ -class Projection extends \Google\Protobuf\Internal\Message -{ - /** - * The property to project. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - */ - protected $property = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\PropertyReference $property - * The property to project. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The property to project. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - * @return \Google\Cloud\Datastore\V1\PropertyReference|null - */ - public function getProperty() - { - return $this->property; - } - - public function hasProperty() - { - return isset($this->property); - } - - public function clearProperty() - { - unset($this->property); - } - - /** - * The property to project. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - * @param \Google\Cloud\Datastore\V1\PropertyReference $var - * @return $this - */ - public function setProperty($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyReference::class); - $this->property = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter.php deleted file mode 100644 index 9e303711f8aa..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter.php +++ /dev/null @@ -1,155 +0,0 @@ -google.datastore.v1.PropertyFilter - */ -class PropertyFilter extends \Google\Protobuf\Internal\Message -{ - /** - * The property to filter by. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - */ - protected $property = null; - /** - * The operator to filter by. - * - * Generated from protobuf field .google.datastore.v1.PropertyFilter.Operator op = 2; - */ - protected $op = 0; - /** - * The value to compare the property to. - * - * Generated from protobuf field .google.datastore.v1.Value value = 3; - */ - protected $value = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\PropertyReference $property - * The property to filter by. - * @type int $op - * The operator to filter by. - * @type \Google\Cloud\Datastore\V1\Value $value - * The value to compare the property to. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The property to filter by. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - * @return \Google\Cloud\Datastore\V1\PropertyReference|null - */ - public function getProperty() - { - return $this->property; - } - - public function hasProperty() - { - return isset($this->property); - } - - public function clearProperty() - { - unset($this->property); - } - - /** - * The property to filter by. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - * @param \Google\Cloud\Datastore\V1\PropertyReference $var - * @return $this - */ - public function setProperty($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyReference::class); - $this->property = $var; - - return $this; - } - - /** - * The operator to filter by. - * - * Generated from protobuf field .google.datastore.v1.PropertyFilter.Operator op = 2; - * @return int - */ - public function getOp() - { - return $this->op; - } - - /** - * The operator to filter by. - * - * Generated from protobuf field .google.datastore.v1.PropertyFilter.Operator op = 2; - * @param int $var - * @return $this - */ - public function setOp($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\PropertyFilter\Operator::class); - $this->op = $var; - - return $this; - } - - /** - * The value to compare the property to. - * - * Generated from protobuf field .google.datastore.v1.Value value = 3; - * @return \Google\Cloud\Datastore\V1\Value|null - */ - public function getValue() - { - return $this->value; - } - - public function hasValue() - { - return isset($this->value); - } - - public function clearValue() - { - unset($this->value); - } - - /** - * The value to compare the property to. - * - * Generated from protobuf field .google.datastore.v1.Value value = 3; - * @param \Google\Cloud\Datastore\V1\Value $var - * @return $this - */ - public function setValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); - $this->value = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter/Operator.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter/Operator.php deleted file mode 100644 index b1188ff2d39a..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyFilter/Operator.php +++ /dev/null @@ -1,135 +0,0 @@ -google.datastore.v1.PropertyFilter.Operator - */ -class Operator -{ - /** - * Unspecified. This value must not be used. - * - * Generated from protobuf enum OPERATOR_UNSPECIFIED = 0; - */ - const OPERATOR_UNSPECIFIED = 0; - /** - * The given `property` is less than the given `value`. - * Requires: - * * That `property` comes first in `order_by`. - * - * Generated from protobuf enum LESS_THAN = 1; - */ - const LESS_THAN = 1; - /** - * The given `property` is less than or equal to the given `value`. - * Requires: - * * That `property` comes first in `order_by`. - * - * Generated from protobuf enum LESS_THAN_OR_EQUAL = 2; - */ - const LESS_THAN_OR_EQUAL = 2; - /** - * The given `property` is greater than the given `value`. - * Requires: - * * That `property` comes first in `order_by`. - * - * Generated from protobuf enum GREATER_THAN = 3; - */ - const GREATER_THAN = 3; - /** - * The given `property` is greater than or equal to the given `value`. - * Requires: - * * That `property` comes first in `order_by`. - * - * Generated from protobuf enum GREATER_THAN_OR_EQUAL = 4; - */ - const GREATER_THAN_OR_EQUAL = 4; - /** - * The given `property` is equal to the given `value`. - * - * Generated from protobuf enum EQUAL = 5; - */ - const EQUAL = 5; - /** - * The given `property` is equal to at least one value in the given array. - * Requires: - * * That `value` is a non-empty `ArrayValue`, subject to disjunction - * limits. - * * No `NOT_IN` is in the same query. - * - * Generated from protobuf enum IN = 6; - */ - const IN = 6; - /** - * The given `property` is not equal to the given `value`. - * Requires: - * * No other `NOT_EQUAL` or `NOT_IN` is in the same query. - * * That `property` comes first in the `order_by`. - * - * Generated from protobuf enum NOT_EQUAL = 9; - */ - const NOT_EQUAL = 9; - /** - * Limit the result set to the given entity and its descendants. - * Requires: - * * That `value` is an entity key. - * * All evaluated disjunctions must have the same `HAS_ANCESTOR` filter. - * - * Generated from protobuf enum HAS_ANCESTOR = 11; - */ - const HAS_ANCESTOR = 11; - /** - * The value of the `property` is not in the given array. - * Requires: - * * That `value` is a non-empty `ArrayValue` with at most 10 values. - * * No other `OR`, `IN`, `NOT_IN`, `NOT_EQUAL` is in the same query. - * * That `field` comes first in the `order_by`. - * - * Generated from protobuf enum NOT_IN = 13; - */ - const NOT_IN = 13; - - private static $valueToName = [ - self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED', - self::LESS_THAN => 'LESS_THAN', - self::LESS_THAN_OR_EQUAL => 'LESS_THAN_OR_EQUAL', - self::GREATER_THAN => 'GREATER_THAN', - self::GREATER_THAN_OR_EQUAL => 'GREATER_THAN_OR_EQUAL', - self::EQUAL => 'EQUAL', - self::IN => 'IN', - self::NOT_EQUAL => 'NOT_EQUAL', - self::HAS_ANCESTOR => 'HAS_ANCESTOR', - self::NOT_IN => 'NOT_IN', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Operator::class, \Google\Cloud\Datastore\V1\PropertyFilter_Operator::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyMask.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyMask.php deleted file mode 100644 index 1768924cdfb4..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyMask.php +++ /dev/null @@ -1,96 +0,0 @@ -google.datastore.v1.PropertyMask - */ -class PropertyMask extends \Google\Protobuf\Internal\Message -{ - /** - * The paths to the properties covered by this mask. - * A path is a list of property names separated by dots (`.`), for example - * `foo.bar` means the property `bar` inside the entity property `foo` inside - * the entity associated with this path. - * If a property name contains a dot `.` or a backslash `\`, then that - * name must be escaped. - * A path must not be empty, and may not reference a value inside an - * [array value][google.datastore.v1.Value.array_value]. - * - * Generated from protobuf field repeated string paths = 1; - */ - private $paths; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $paths - * The paths to the properties covered by this mask. - * A path is a list of property names separated by dots (`.`), for example - * `foo.bar` means the property `bar` inside the entity property `foo` inside - * the entity associated with this path. - * If a property name contains a dot `.` or a backslash `\`, then that - * name must be escaped. - * A path must not be empty, and may not reference a value inside an - * [array value][google.datastore.v1.Value.array_value]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * The paths to the properties covered by this mask. - * A path is a list of property names separated by dots (`.`), for example - * `foo.bar` means the property `bar` inside the entity property `foo` inside - * the entity associated with this path. - * If a property name contains a dot `.` or a backslash `\`, then that - * name must be escaped. - * A path must not be empty, and may not reference a value inside an - * [array value][google.datastore.v1.Value.array_value]. - * - * Generated from protobuf field repeated string paths = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getPaths() - { - return $this->paths; - } - - /** - * The paths to the properties covered by this mask. - * A path is a list of property names separated by dots (`.`), for example - * `foo.bar` means the property `bar` inside the entity property `foo` inside - * the entity associated with this path. - * If a property name contains a dot `.` or a backslash `\`, then that - * name must be escaped. - * A path must not be empty, and may not reference a value inside an - * [array value][google.datastore.v1.Value.array_value]. - * - * Generated from protobuf field repeated string paths = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setPaths($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->paths = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder.php deleted file mode 100644 index 836cc807daf0..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder.php +++ /dev/null @@ -1,111 +0,0 @@ -google.datastore.v1.PropertyOrder - */ -class PropertyOrder extends \Google\Protobuf\Internal\Message -{ - /** - * The property to order by. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - */ - protected $property = null; - /** - * The direction to order by. Defaults to `ASCENDING`. - * - * Generated from protobuf field .google.datastore.v1.PropertyOrder.Direction direction = 2; - */ - protected $direction = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\PropertyReference $property - * The property to order by. - * @type int $direction - * The direction to order by. Defaults to `ASCENDING`. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The property to order by. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - * @return \Google\Cloud\Datastore\V1\PropertyReference|null - */ - public function getProperty() - { - return $this->property; - } - - public function hasProperty() - { - return isset($this->property); - } - - public function clearProperty() - { - unset($this->property); - } - - /** - * The property to order by. - * - * Generated from protobuf field .google.datastore.v1.PropertyReference property = 1; - * @param \Google\Cloud\Datastore\V1\PropertyReference $var - * @return $this - */ - public function setProperty($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyReference::class); - $this->property = $var; - - return $this; - } - - /** - * The direction to order by. Defaults to `ASCENDING`. - * - * Generated from protobuf field .google.datastore.v1.PropertyOrder.Direction direction = 2; - * @return int - */ - public function getDirection() - { - return $this->direction; - } - - /** - * The direction to order by. Defaults to `ASCENDING`. - * - * Generated from protobuf field .google.datastore.v1.PropertyOrder.Direction direction = 2; - * @param int $var - * @return $this - */ - public function setDirection($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\PropertyOrder\Direction::class); - $this->direction = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder/Direction.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder/Direction.php deleted file mode 100644 index 6534ba280732..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyOrder/Direction.php +++ /dev/null @@ -1,64 +0,0 @@ -google.datastore.v1.PropertyOrder.Direction - */ -class Direction -{ - /** - * Unspecified. This value must not be used. - * - * Generated from protobuf enum DIRECTION_UNSPECIFIED = 0; - */ - const DIRECTION_UNSPECIFIED = 0; - /** - * Ascending. - * - * Generated from protobuf enum ASCENDING = 1; - */ - const ASCENDING = 1; - /** - * Descending. - * - * Generated from protobuf enum DESCENDING = 2; - */ - const DESCENDING = 2; - - private static $valueToName = [ - self::DIRECTION_UNSPECIFIED => 'DIRECTION_UNSPECIFIED', - self::ASCENDING => 'ASCENDING', - self::DESCENDING => 'DESCENDING', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(Direction::class, \Google\Cloud\Datastore\V1\PropertyOrder_Direction::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyReference.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyReference.php deleted file mode 100644 index ea6acf710a57..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyReference.php +++ /dev/null @@ -1,83 +0,0 @@ -google.datastore.v1.PropertyReference - */ -class PropertyReference extends \Google\Protobuf\Internal\Message -{ - /** - * A reference to a property. - * Requires: - * * MUST be a dot-delimited (`.`) string of segments, where each segment - * conforms to [entity property name][google.datastore.v1.Entity.properties] - * limitations. - * - * Generated from protobuf field string name = 2; - */ - protected $name = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * A reference to a property. - * Requires: - * * MUST be a dot-delimited (`.`) string of segments, where each segment - * conforms to [entity property name][google.datastore.v1.Entity.properties] - * limitations. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * A reference to a property. - * Requires: - * * MUST be a dot-delimited (`.`) string of segments, where each segment - * conforms to [entity property name][google.datastore.v1.Entity.properties] - * limitations. - * - * Generated from protobuf field string name = 2; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * A reference to a property. - * Requires: - * * MUST be a dot-delimited (`.`) string of segments, where each segment - * conforms to [entity property name][google.datastore.v1.Entity.properties] - * limitations. - * - * Generated from protobuf field string name = 2; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform.php deleted file mode 100644 index 1114cd9027ae..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform.php +++ /dev/null @@ -1,432 +0,0 @@ -google.datastore.v1.PropertyTransform - */ -class PropertyTransform extends \Google\Protobuf\Internal\Message -{ - /** - * Optional. The name of the property. - * Property paths (a list of property names separated by dots (`.`)) may be - * used to refer to properties inside entity values. For example `foo.bar` - * means the property `bar` inside the entity property `foo`. - * If a property name contains a dot `.` or a backlslash `\`, then that name - * must be escaped. - * - * Generated from protobuf field string property = 1 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $property = ''; - protected $transform_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $property - * Optional. The name of the property. - * Property paths (a list of property names separated by dots (`.`)) may be - * used to refer to properties inside entity values. For example `foo.bar` - * means the property `bar` inside the entity property `foo`. - * If a property name contains a dot `.` or a backlslash `\`, then that name - * must be escaped. - * @type int $set_to_server_value - * Sets the property to the given server value. - * @type \Google\Cloud\Datastore\V1\Value $increment - * Adds the given value to the property's current value. - * This must be an integer or a double value. - * If the property is not an integer or double, or if the property does not - * yet exist, the transformation will set the property to the given value. - * If either of the given value or the current property value are doubles, - * both values will be interpreted as doubles. Double arithmetic and - * representation of double values follows IEEE 754 semantics. - * If there is positive/negative integer overflow, the property is resolved - * to the largest magnitude positive/negative integer. - * @type \Google\Cloud\Datastore\V1\Value $maximum - * Sets the property to the maximum of its current value and the given - * value. - * This must be an integer or a double value. - * If the property is not an integer or double, or if the property does not - * yet exist, the transformation will set the property to the given value. - * If a maximum operation is applied where the property and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the property takes on the type of the larger operand. If the operands are - * equivalent (e.g. 3 and 3.0), the property does not change. - * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and - * zero input value is always the stored value. - * The maximum of any numeric value x and NaN is NaN. - * @type \Google\Cloud\Datastore\V1\Value $minimum - * Sets the property to the minimum of its current value and the given - * value. - * This must be an integer or a double value. - * If the property is not an integer or double, or if the property does not - * yet exist, the transformation will set the property to the input value. - * If a minimum operation is applied where the property and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the property takes on the type of the smaller operand. If the operands - * are equivalent (e.g. 3 and 3.0), the property does not change. 0, 0.0, - * and -0.0 are all zero. The minimum of a zero stored value and zero input - * value is always the stored value. The minimum of any numeric value x and - * NaN is NaN. - * @type \Google\Cloud\Datastore\V1\ArrayValue $append_missing_elements - * Appends the given elements in order if they are not already present in - * the current property value. - * If the property is not an array, or if the property does not yet exist, - * it is first set to the empty array. - * Equivalent numbers of different types (e.g. 3L and 3.0) are - * considered equal when checking if a value is missing. - * NaN is equal to NaN, and the null value is equal to the null value. - * If the input contains multiple equivalent values, only the first will - * be considered. - * The corresponding transform result will be the null value. - * @type \Google\Cloud\Datastore\V1\ArrayValue $remove_all_from_array - * Removes all of the given elements from the array in the property. - * If the property is not an array, or if the property does not yet exist, - * it is set to the empty array. - * Equivalent numbers of different types (e.g. 3L and 3.0) are - * considered equal when deciding whether an element should be removed. - * NaN is equal to NaN, and the null value is equal to the null value. - * This will remove all equivalent values if there are duplicates. - * The corresponding transform result will be the null value. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * Optional. The name of the property. - * Property paths (a list of property names separated by dots (`.`)) may be - * used to refer to properties inside entity values. For example `foo.bar` - * means the property `bar` inside the entity property `foo`. - * If a property name contains a dot `.` or a backlslash `\`, then that name - * must be escaped. - * - * Generated from protobuf field string property = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @return string - */ - public function getProperty() - { - return $this->property; - } - - /** - * Optional. The name of the property. - * Property paths (a list of property names separated by dots (`.`)) may be - * used to refer to properties inside entity values. For example `foo.bar` - * means the property `bar` inside the entity property `foo`. - * If a property name contains a dot `.` or a backlslash `\`, then that name - * must be escaped. - * - * Generated from protobuf field string property = 1 [(.google.api.field_behavior) = OPTIONAL]; - * @param string $var - * @return $this - */ - public function setProperty($var) - { - GPBUtil::checkString($var, True); - $this->property = $var; - - return $this; - } - - /** - * Sets the property to the given server value. - * - * Generated from protobuf field .google.datastore.v1.PropertyTransform.ServerValue set_to_server_value = 2; - * @return int - */ - public function getSetToServerValue() - { - return $this->readOneof(2); - } - - public function hasSetToServerValue() - { - return $this->hasOneof(2); - } - - /** - * Sets the property to the given server value. - * - * Generated from protobuf field .google.datastore.v1.PropertyTransform.ServerValue set_to_server_value = 2; - * @param int $var - * @return $this - */ - public function setSetToServerValue($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\PropertyTransform\ServerValue::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Adds the given value to the property's current value. - * This must be an integer or a double value. - * If the property is not an integer or double, or if the property does not - * yet exist, the transformation will set the property to the given value. - * If either of the given value or the current property value are doubles, - * both values will be interpreted as doubles. Double arithmetic and - * representation of double values follows IEEE 754 semantics. - * If there is positive/negative integer overflow, the property is resolved - * to the largest magnitude positive/negative integer. - * - * Generated from protobuf field .google.datastore.v1.Value increment = 3; - * @return \Google\Cloud\Datastore\V1\Value|null - */ - public function getIncrement() - { - return $this->readOneof(3); - } - - public function hasIncrement() - { - return $this->hasOneof(3); - } - - /** - * Adds the given value to the property's current value. - * This must be an integer or a double value. - * If the property is not an integer or double, or if the property does not - * yet exist, the transformation will set the property to the given value. - * If either of the given value or the current property value are doubles, - * both values will be interpreted as doubles. Double arithmetic and - * representation of double values follows IEEE 754 semantics. - * If there is positive/negative integer overflow, the property is resolved - * to the largest magnitude positive/negative integer. - * - * Generated from protobuf field .google.datastore.v1.Value increment = 3; - * @param \Google\Cloud\Datastore\V1\Value $var - * @return $this - */ - public function setIncrement($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Sets the property to the maximum of its current value and the given - * value. - * This must be an integer or a double value. - * If the property is not an integer or double, or if the property does not - * yet exist, the transformation will set the property to the given value. - * If a maximum operation is applied where the property and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the property takes on the type of the larger operand. If the operands are - * equivalent (e.g. 3 and 3.0), the property does not change. - * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and - * zero input value is always the stored value. - * The maximum of any numeric value x and NaN is NaN. - * - * Generated from protobuf field .google.datastore.v1.Value maximum = 4; - * @return \Google\Cloud\Datastore\V1\Value|null - */ - public function getMaximum() - { - return $this->readOneof(4); - } - - public function hasMaximum() - { - return $this->hasOneof(4); - } - - /** - * Sets the property to the maximum of its current value and the given - * value. - * This must be an integer or a double value. - * If the property is not an integer or double, or if the property does not - * yet exist, the transformation will set the property to the given value. - * If a maximum operation is applied where the property and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the property takes on the type of the larger operand. If the operands are - * equivalent (e.g. 3 and 3.0), the property does not change. - * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and - * zero input value is always the stored value. - * The maximum of any numeric value x and NaN is NaN. - * - * Generated from protobuf field .google.datastore.v1.Value maximum = 4; - * @param \Google\Cloud\Datastore\V1\Value $var - * @return $this - */ - public function setMaximum($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Sets the property to the minimum of its current value and the given - * value. - * This must be an integer or a double value. - * If the property is not an integer or double, or if the property does not - * yet exist, the transformation will set the property to the input value. - * If a minimum operation is applied where the property and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the property takes on the type of the smaller operand. If the operands - * are equivalent (e.g. 3 and 3.0), the property does not change. 0, 0.0, - * and -0.0 are all zero. The minimum of a zero stored value and zero input - * value is always the stored value. The minimum of any numeric value x and - * NaN is NaN. - * - * Generated from protobuf field .google.datastore.v1.Value minimum = 5; - * @return \Google\Cloud\Datastore\V1\Value|null - */ - public function getMinimum() - { - return $this->readOneof(5); - } - - public function hasMinimum() - { - return $this->hasOneof(5); - } - - /** - * Sets the property to the minimum of its current value and the given - * value. - * This must be an integer or a double value. - * If the property is not an integer or double, or if the property does not - * yet exist, the transformation will set the property to the input value. - * If a minimum operation is applied where the property and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the property takes on the type of the smaller operand. If the operands - * are equivalent (e.g. 3 and 3.0), the property does not change. 0, 0.0, - * and -0.0 are all zero. The minimum of a zero stored value and zero input - * value is always the stored value. The minimum of any numeric value x and - * NaN is NaN. - * - * Generated from protobuf field .google.datastore.v1.Value minimum = 5; - * @param \Google\Cloud\Datastore\V1\Value $var - * @return $this - */ - public function setMinimum($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Value::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * Appends the given elements in order if they are not already present in - * the current property value. - * If the property is not an array, or if the property does not yet exist, - * it is first set to the empty array. - * Equivalent numbers of different types (e.g. 3L and 3.0) are - * considered equal when checking if a value is missing. - * NaN is equal to NaN, and the null value is equal to the null value. - * If the input contains multiple equivalent values, only the first will - * be considered. - * The corresponding transform result will be the null value. - * - * Generated from protobuf field .google.datastore.v1.ArrayValue append_missing_elements = 6; - * @return \Google\Cloud\Datastore\V1\ArrayValue|null - */ - public function getAppendMissingElements() - { - return $this->readOneof(6); - } - - public function hasAppendMissingElements() - { - return $this->hasOneof(6); - } - - /** - * Appends the given elements in order if they are not already present in - * the current property value. - * If the property is not an array, or if the property does not yet exist, - * it is first set to the empty array. - * Equivalent numbers of different types (e.g. 3L and 3.0) are - * considered equal when checking if a value is missing. - * NaN is equal to NaN, and the null value is equal to the null value. - * If the input contains multiple equivalent values, only the first will - * be considered. - * The corresponding transform result will be the null value. - * - * Generated from protobuf field .google.datastore.v1.ArrayValue append_missing_elements = 6; - * @param \Google\Cloud\Datastore\V1\ArrayValue $var - * @return $this - */ - public function setAppendMissingElements($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ArrayValue::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * Removes all of the given elements from the array in the property. - * If the property is not an array, or if the property does not yet exist, - * it is set to the empty array. - * Equivalent numbers of different types (e.g. 3L and 3.0) are - * considered equal when deciding whether an element should be removed. - * NaN is equal to NaN, and the null value is equal to the null value. - * This will remove all equivalent values if there are duplicates. - * The corresponding transform result will be the null value. - * - * Generated from protobuf field .google.datastore.v1.ArrayValue remove_all_from_array = 7; - * @return \Google\Cloud\Datastore\V1\ArrayValue|null - */ - public function getRemoveAllFromArray() - { - return $this->readOneof(7); - } - - public function hasRemoveAllFromArray() - { - return $this->hasOneof(7); - } - - /** - * Removes all of the given elements from the array in the property. - * If the property is not an array, or if the property does not yet exist, - * it is set to the empty array. - * Equivalent numbers of different types (e.g. 3L and 3.0) are - * considered equal when deciding whether an element should be removed. - * NaN is equal to NaN, and the null value is equal to the null value. - * This will remove all equivalent values if there are duplicates. - * The corresponding transform result will be the null value. - * - * Generated from protobuf field .google.datastore.v1.ArrayValue remove_all_from_array = 7; - * @param \Google\Cloud\Datastore\V1\ArrayValue $var - * @return $this - */ - public function setRemoveAllFromArray($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ArrayValue::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * @return string - */ - public function getTransformType() - { - return $this->whichOneof("transform_type"); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform/ServerValue.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform/ServerValue.php deleted file mode 100644 index 6162f10f4c4d..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/PropertyTransform/ServerValue.php +++ /dev/null @@ -1,59 +0,0 @@ -google.datastore.v1.PropertyTransform.ServerValue - */ -class ServerValue -{ - /** - * Unspecified. This value must not be used. - * - * Generated from protobuf enum SERVER_VALUE_UNSPECIFIED = 0; - */ - const SERVER_VALUE_UNSPECIFIED = 0; - /** - * The time at which the server processed the request, with millisecond - * precision. If used on multiple properties (same or different entities) - * in a transaction, all the properties will get the same server timestamp. - * - * Generated from protobuf enum REQUEST_TIME = 1; - */ - const REQUEST_TIME = 1; - - private static $valueToName = [ - self::SERVER_VALUE_UNSPECIFIED => 'SERVER_VALUE_UNSPECIFIED', - self::REQUEST_TIME => 'REQUEST_TIME', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ServerValue::class, \Google\Cloud\Datastore\V1\PropertyTransform_ServerValue::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Query.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Query.php deleted file mode 100644 index 5d1def8847b7..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Query.php +++ /dev/null @@ -1,516 +0,0 @@ -google.datastore.v1.Query - */ -class Query extends \Google\Protobuf\Internal\Message -{ - /** - * The projection to return. Defaults to returning all properties. - * - * Generated from protobuf field repeated .google.datastore.v1.Projection projection = 2; - */ - private $projection; - /** - * The kinds to query (if empty, returns entities of all kinds). - * Currently at most 1 kind may be specified. - * - * Generated from protobuf field repeated .google.datastore.v1.KindExpression kind = 3; - */ - private $kind; - /** - * The filter to apply. - * - * Generated from protobuf field .google.datastore.v1.Filter filter = 4; - */ - protected $filter = null; - /** - * The order to apply to the query results (if empty, order is unspecified). - * - * Generated from protobuf field repeated .google.datastore.v1.PropertyOrder order = 5; - */ - private $order; - /** - * The properties to make distinct. The query results will contain the first - * result for each distinct combination of values for the given properties - * (if empty, all results are returned). - * Requires: - * * If `order` is specified, the set of distinct on properties must appear - * before the non-distinct on properties in `order`. - * - * Generated from protobuf field repeated .google.datastore.v1.PropertyReference distinct_on = 6; - */ - private $distinct_on; - /** - * A starting point for the query results. Query cursors are - * returned in query result batches and - * [can only be used to continue the same - * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - * - * Generated from protobuf field bytes start_cursor = 7; - */ - protected $start_cursor = ''; - /** - * An ending point for the query results. Query cursors are - * returned in query result batches and - * [can only be used to limit the same - * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - * - * Generated from protobuf field bytes end_cursor = 8; - */ - protected $end_cursor = ''; - /** - * The number of results to skip. Applies before limit, but after all other - * constraints. Optional. Must be >= 0 if specified. - * - * Generated from protobuf field int32 offset = 10; - */ - protected $offset = 0; - /** - * The maximum number of results to return. Applies after all other - * constraints. Optional. - * Unspecified is interpreted as no limit. - * Must be >= 0 if specified. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 12; - */ - protected $limit = null; - /** - * Optional. A potential Nearest Neighbors Search. - * Applies after all other filters and ordering. - * Finds the closest vector embeddings to the given query vector. - * - * Generated from protobuf field .google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $find_nearest = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Datastore\V1\Projection>|\Google\Protobuf\Internal\RepeatedField $projection - * The projection to return. Defaults to returning all properties. - * @type array<\Google\Cloud\Datastore\V1\KindExpression>|\Google\Protobuf\Internal\RepeatedField $kind - * The kinds to query (if empty, returns entities of all kinds). - * Currently at most 1 kind may be specified. - * @type \Google\Cloud\Datastore\V1\Filter $filter - * The filter to apply. - * @type array<\Google\Cloud\Datastore\V1\PropertyOrder>|\Google\Protobuf\Internal\RepeatedField $order - * The order to apply to the query results (if empty, order is unspecified). - * @type array<\Google\Cloud\Datastore\V1\PropertyReference>|\Google\Protobuf\Internal\RepeatedField $distinct_on - * The properties to make distinct. The query results will contain the first - * result for each distinct combination of values for the given properties - * (if empty, all results are returned). - * Requires: - * * If `order` is specified, the set of distinct on properties must appear - * before the non-distinct on properties in `order`. - * @type string $start_cursor - * A starting point for the query results. Query cursors are - * returned in query result batches and - * [can only be used to continue the same - * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - * @type string $end_cursor - * An ending point for the query results. Query cursors are - * returned in query result batches and - * [can only be used to limit the same - * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - * @type int $offset - * The number of results to skip. Applies before limit, but after all other - * constraints. Optional. Must be >= 0 if specified. - * @type \Google\Protobuf\Int32Value $limit - * The maximum number of results to return. Applies after all other - * constraints. Optional. - * Unspecified is interpreted as no limit. - * Must be >= 0 if specified. - * @type \Google\Cloud\Datastore\V1\FindNearest $find_nearest - * Optional. A potential Nearest Neighbors Search. - * Applies after all other filters and ordering. - * Finds the closest vector embeddings to the given query vector. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The projection to return. Defaults to returning all properties. - * - * Generated from protobuf field repeated .google.datastore.v1.Projection projection = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProjection() - { - return $this->projection; - } - - /** - * The projection to return. Defaults to returning all properties. - * - * Generated from protobuf field repeated .google.datastore.v1.Projection projection = 2; - * @param array<\Google\Cloud\Datastore\V1\Projection>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProjection($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Projection::class); - $this->projection = $arr; - - return $this; - } - - /** - * The kinds to query (if empty, returns entities of all kinds). - * Currently at most 1 kind may be specified. - * - * Generated from protobuf field repeated .google.datastore.v1.KindExpression kind = 3; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getKind() - { - return $this->kind; - } - - /** - * The kinds to query (if empty, returns entities of all kinds). - * Currently at most 1 kind may be specified. - * - * Generated from protobuf field repeated .google.datastore.v1.KindExpression kind = 3; - * @param array<\Google\Cloud\Datastore\V1\KindExpression>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setKind($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\KindExpression::class); - $this->kind = $arr; - - return $this; - } - - /** - * The filter to apply. - * - * Generated from protobuf field .google.datastore.v1.Filter filter = 4; - * @return \Google\Cloud\Datastore\V1\Filter|null - */ - public function getFilter() - { - return $this->filter; - } - - public function hasFilter() - { - return isset($this->filter); - } - - public function clearFilter() - { - unset($this->filter); - } - - /** - * The filter to apply. - * - * Generated from protobuf field .google.datastore.v1.Filter filter = 4; - * @param \Google\Cloud\Datastore\V1\Filter $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Filter::class); - $this->filter = $var; - - return $this; - } - - /** - * The order to apply to the query results (if empty, order is unspecified). - * - * Generated from protobuf field repeated .google.datastore.v1.PropertyOrder order = 5; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getOrder() - { - return $this->order; - } - - /** - * The order to apply to the query results (if empty, order is unspecified). - * - * Generated from protobuf field repeated .google.datastore.v1.PropertyOrder order = 5; - * @param array<\Google\Cloud\Datastore\V1\PropertyOrder>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setOrder($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\PropertyOrder::class); - $this->order = $arr; - - return $this; - } - - /** - * The properties to make distinct. The query results will contain the first - * result for each distinct combination of values for the given properties - * (if empty, all results are returned). - * Requires: - * * If `order` is specified, the set of distinct on properties must appear - * before the non-distinct on properties in `order`. - * - * Generated from protobuf field repeated .google.datastore.v1.PropertyReference distinct_on = 6; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getDistinctOn() - { - return $this->distinct_on; - } - - /** - * The properties to make distinct. The query results will contain the first - * result for each distinct combination of values for the given properties - * (if empty, all results are returned). - * Requires: - * * If `order` is specified, the set of distinct on properties must appear - * before the non-distinct on properties in `order`. - * - * Generated from protobuf field repeated .google.datastore.v1.PropertyReference distinct_on = 6; - * @param array<\Google\Cloud\Datastore\V1\PropertyReference>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setDistinctOn($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\PropertyReference::class); - $this->distinct_on = $arr; - - return $this; - } - - /** - * A starting point for the query results. Query cursors are - * returned in query result batches and - * [can only be used to continue the same - * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - * - * Generated from protobuf field bytes start_cursor = 7; - * @return string - */ - public function getStartCursor() - { - return $this->start_cursor; - } - - /** - * A starting point for the query results. Query cursors are - * returned in query result batches and - * [can only be used to continue the same - * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - * - * Generated from protobuf field bytes start_cursor = 7; - * @param string $var - * @return $this - */ - public function setStartCursor($var) - { - GPBUtil::checkString($var, False); - $this->start_cursor = $var; - - return $this; - } - - /** - * An ending point for the query results. Query cursors are - * returned in query result batches and - * [can only be used to limit the same - * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - * - * Generated from protobuf field bytes end_cursor = 8; - * @return string - */ - public function getEndCursor() - { - return $this->end_cursor; - } - - /** - * An ending point for the query results. Query cursors are - * returned in query result batches and - * [can only be used to limit the same - * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - * - * Generated from protobuf field bytes end_cursor = 8; - * @param string $var - * @return $this - */ - public function setEndCursor($var) - { - GPBUtil::checkString($var, False); - $this->end_cursor = $var; - - return $this; - } - - /** - * The number of results to skip. Applies before limit, but after all other - * constraints. Optional. Must be >= 0 if specified. - * - * Generated from protobuf field int32 offset = 10; - * @return int - */ - public function getOffset() - { - return $this->offset; - } - - /** - * The number of results to skip. Applies before limit, but after all other - * constraints. Optional. Must be >= 0 if specified. - * - * Generated from protobuf field int32 offset = 10; - * @param int $var - * @return $this - */ - public function setOffset($var) - { - GPBUtil::checkInt32($var); - $this->offset = $var; - - return $this; - } - - /** - * The maximum number of results to return. Applies after all other - * constraints. Optional. - * Unspecified is interpreted as no limit. - * Must be >= 0 if specified. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 12; - * @return \Google\Protobuf\Int32Value|null - */ - public function getLimit() - { - return $this->limit; - } - - public function hasLimit() - { - return isset($this->limit); - } - - public function clearLimit() - { - unset($this->limit); - } - - /** - * Returns the unboxed value from getLimit() - - * The maximum number of results to return. Applies after all other - * constraints. Optional. - * Unspecified is interpreted as no limit. - * Must be >= 0 if specified. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 12; - * @return int|null - */ - public function getLimitUnwrapped() - { - return $this->readWrapperValue("limit"); - } - - /** - * The maximum number of results to return. Applies after all other - * constraints. Optional. - * Unspecified is interpreted as no limit. - * Must be >= 0 if specified. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 12; - * @param \Google\Protobuf\Int32Value $var - * @return $this - */ - public function setLimit($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class); - $this->limit = $var; - - return $this; - } - - /** - * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. - - * The maximum number of results to return. Applies after all other - * constraints. Optional. - * Unspecified is interpreted as no limit. - * Must be >= 0 if specified. - * - * Generated from protobuf field .google.protobuf.Int32Value limit = 12; - * @param int|null $var - * @return $this - */ - public function setLimitUnwrapped($var) - { - $this->writeWrapperValue("limit", $var); - return $this;} - - /** - * Optional. A potential Nearest Neighbors Search. - * Applies after all other filters and ordering. - * Finds the closest vector embeddings to the given query vector. - * - * Generated from protobuf field .google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Datastore\V1\FindNearest|null - */ - public function getFindNearest() - { - return $this->find_nearest; - } - - public function hasFindNearest() - { - return isset($this->find_nearest); - } - - public function clearFindNearest() - { - unset($this->find_nearest); - } - - /** - * Optional. A potential Nearest Neighbors Search. - * Applies after all other filters and ordering. - * Finds the closest vector embeddings to the given query vector. - * - * Generated from protobuf field .google.datastore.v1.FindNearest find_nearest = 13 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Datastore\V1\FindNearest $var - * @return $this - */ - public function setFindNearest($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\FindNearest::class); - $this->find_nearest = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch.php deleted file mode 100644 index 04cc35cb4ad8..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch.php +++ /dev/null @@ -1,379 +0,0 @@ -google.datastore.v1.QueryResultBatch - */ -class QueryResultBatch extends \Google\Protobuf\Internal\Message -{ - /** - * The number of results skipped, typically because of an offset. - * - * Generated from protobuf field int32 skipped_results = 6; - */ - protected $skipped_results = 0; - /** - * A cursor that points to the position after the last skipped result. - * Will be set when `skipped_results` != 0. - * - * Generated from protobuf field bytes skipped_cursor = 3; - */ - protected $skipped_cursor = ''; - /** - * The result type for every entity in `entity_results`. - * - * Generated from protobuf field .google.datastore.v1.EntityResult.ResultType entity_result_type = 1; - */ - protected $entity_result_type = 0; - /** - * The results for this batch. - * - * Generated from protobuf field repeated .google.datastore.v1.EntityResult entity_results = 2; - */ - private $entity_results; - /** - * A cursor that points to the position after the last result in the batch. - * - * Generated from protobuf field bytes end_cursor = 4; - */ - protected $end_cursor = ''; - /** - * The state of the query after the current batch. - * - * Generated from protobuf field .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5; - */ - protected $more_results = 0; - /** - * The version number of the snapshot this batch was returned from. - * This applies to the range of results from the query's `start_cursor` (or - * the beginning of the query if no cursor was given) to this batch's - * `end_cursor` (not the query's `end_cursor`). - * In a single transaction, subsequent query result batches for the same query - * can have a greater snapshot version number. Each batch's snapshot version - * is valid for all preceding batches. - * The value will be zero for eventually consistent queries. - * - * Generated from protobuf field int64 snapshot_version = 7; - */ - protected $snapshot_version = 0; - /** - * Read timestamp this batch was returned from. - * This applies to the range of results from the query's `start_cursor` (or - * the beginning of the query if no cursor was given) to this batch's - * `end_cursor` (not the query's `end_cursor`). - * In a single transaction, subsequent query result batches for the same query - * can have a greater timestamp. Each batch's read timestamp - * is valid for all preceding batches. - * This value will not be set for eventually consistent queries in Cloud - * Datastore. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 8; - */ - protected $read_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $skipped_results - * The number of results skipped, typically because of an offset. - * @type string $skipped_cursor - * A cursor that points to the position after the last skipped result. - * Will be set when `skipped_results` != 0. - * @type int $entity_result_type - * The result type for every entity in `entity_results`. - * @type array<\Google\Cloud\Datastore\V1\EntityResult>|\Google\Protobuf\Internal\RepeatedField $entity_results - * The results for this batch. - * @type string $end_cursor - * A cursor that points to the position after the last result in the batch. - * @type int $more_results - * The state of the query after the current batch. - * @type int|string $snapshot_version - * The version number of the snapshot this batch was returned from. - * This applies to the range of results from the query's `start_cursor` (or - * the beginning of the query if no cursor was given) to this batch's - * `end_cursor` (not the query's `end_cursor`). - * In a single transaction, subsequent query result batches for the same query - * can have a greater snapshot version number. Each batch's snapshot version - * is valid for all preceding batches. - * The value will be zero for eventually consistent queries. - * @type \Google\Protobuf\Timestamp $read_time - * Read timestamp this batch was returned from. - * This applies to the range of results from the query's `start_cursor` (or - * the beginning of the query if no cursor was given) to this batch's - * `end_cursor` (not the query's `end_cursor`). - * In a single transaction, subsequent query result batches for the same query - * can have a greater timestamp. Each batch's read timestamp - * is valid for all preceding batches. - * This value will not be set for eventually consistent queries in Cloud - * Datastore. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Query::initOnce(); - parent::__construct($data); - } - - /** - * The number of results skipped, typically because of an offset. - * - * Generated from protobuf field int32 skipped_results = 6; - * @return int - */ - public function getSkippedResults() - { - return $this->skipped_results; - } - - /** - * The number of results skipped, typically because of an offset. - * - * Generated from protobuf field int32 skipped_results = 6; - * @param int $var - * @return $this - */ - public function setSkippedResults($var) - { - GPBUtil::checkInt32($var); - $this->skipped_results = $var; - - return $this; - } - - /** - * A cursor that points to the position after the last skipped result. - * Will be set when `skipped_results` != 0. - * - * Generated from protobuf field bytes skipped_cursor = 3; - * @return string - */ - public function getSkippedCursor() - { - return $this->skipped_cursor; - } - - /** - * A cursor that points to the position after the last skipped result. - * Will be set when `skipped_results` != 0. - * - * Generated from protobuf field bytes skipped_cursor = 3; - * @param string $var - * @return $this - */ - public function setSkippedCursor($var) - { - GPBUtil::checkString($var, False); - $this->skipped_cursor = $var; - - return $this; - } - - /** - * The result type for every entity in `entity_results`. - * - * Generated from protobuf field .google.datastore.v1.EntityResult.ResultType entity_result_type = 1; - * @return int - */ - public function getEntityResultType() - { - return $this->entity_result_type; - } - - /** - * The result type for every entity in `entity_results`. - * - * Generated from protobuf field .google.datastore.v1.EntityResult.ResultType entity_result_type = 1; - * @param int $var - * @return $this - */ - public function setEntityResultType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\EntityResult\ResultType::class); - $this->entity_result_type = $var; - - return $this; - } - - /** - * The results for this batch. - * - * Generated from protobuf field repeated .google.datastore.v1.EntityResult entity_results = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getEntityResults() - { - return $this->entity_results; - } - - /** - * The results for this batch. - * - * Generated from protobuf field repeated .google.datastore.v1.EntityResult entity_results = 2; - * @param array<\Google\Cloud\Datastore\V1\EntityResult>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setEntityResults($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\EntityResult::class); - $this->entity_results = $arr; - - return $this; - } - - /** - * A cursor that points to the position after the last result in the batch. - * - * Generated from protobuf field bytes end_cursor = 4; - * @return string - */ - public function getEndCursor() - { - return $this->end_cursor; - } - - /** - * A cursor that points to the position after the last result in the batch. - * - * Generated from protobuf field bytes end_cursor = 4; - * @param string $var - * @return $this - */ - public function setEndCursor($var) - { - GPBUtil::checkString($var, False); - $this->end_cursor = $var; - - return $this; - } - - /** - * The state of the query after the current batch. - * - * Generated from protobuf field .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5; - * @return int - */ - public function getMoreResults() - { - return $this->more_results; - } - - /** - * The state of the query after the current batch. - * - * Generated from protobuf field .google.datastore.v1.QueryResultBatch.MoreResultsType more_results = 5; - * @param int $var - * @return $this - */ - public function setMoreResults($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\QueryResultBatch\MoreResultsType::class); - $this->more_results = $var; - - return $this; - } - - /** - * The version number of the snapshot this batch was returned from. - * This applies to the range of results from the query's `start_cursor` (or - * the beginning of the query if no cursor was given) to this batch's - * `end_cursor` (not the query's `end_cursor`). - * In a single transaction, subsequent query result batches for the same query - * can have a greater snapshot version number. Each batch's snapshot version - * is valid for all preceding batches. - * The value will be zero for eventually consistent queries. - * - * Generated from protobuf field int64 snapshot_version = 7; - * @return int|string - */ - public function getSnapshotVersion() - { - return $this->snapshot_version; - } - - /** - * The version number of the snapshot this batch was returned from. - * This applies to the range of results from the query's `start_cursor` (or - * the beginning of the query if no cursor was given) to this batch's - * `end_cursor` (not the query's `end_cursor`). - * In a single transaction, subsequent query result batches for the same query - * can have a greater snapshot version number. Each batch's snapshot version - * is valid for all preceding batches. - * The value will be zero for eventually consistent queries. - * - * Generated from protobuf field int64 snapshot_version = 7; - * @param int|string $var - * @return $this - */ - public function setSnapshotVersion($var) - { - GPBUtil::checkInt64($var); - $this->snapshot_version = $var; - - return $this; - } - - /** - * Read timestamp this batch was returned from. - * This applies to the range of results from the query's `start_cursor` (or - * the beginning of the query if no cursor was given) to this batch's - * `end_cursor` (not the query's `end_cursor`). - * In a single transaction, subsequent query result batches for the same query - * can have a greater timestamp. Each batch's read timestamp - * is valid for all preceding batches. - * This value will not be set for eventually consistent queries in Cloud - * Datastore. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 8; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->read_time; - } - - public function hasReadTime() - { - return isset($this->read_time); - } - - public function clearReadTime() - { - unset($this->read_time); - } - - /** - * Read timestamp this batch was returned from. - * This applies to the range of results from the query's `start_cursor` (or - * the beginning of the query if no cursor was given) to this batch's - * `end_cursor` (not the query's `end_cursor`). - * In a single transaction, subsequent query result batches for the same query - * can have a greater timestamp. Each batch's read timestamp - * is valid for all preceding batches. - * This value will not be set for eventually consistent queries in Cloud - * Datastore. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 8; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->read_time = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch/MoreResultsType.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch/MoreResultsType.php deleted file mode 100644 index 6f4a9d2dd046..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/QueryResultBatch/MoreResultsType.php +++ /dev/null @@ -1,79 +0,0 @@ -google.datastore.v1.QueryResultBatch.MoreResultsType - */ -class MoreResultsType -{ - /** - * Unspecified. This value is never used. - * - * Generated from protobuf enum MORE_RESULTS_TYPE_UNSPECIFIED = 0; - */ - const MORE_RESULTS_TYPE_UNSPECIFIED = 0; - /** - * There may be additional batches to fetch from this query. - * - * Generated from protobuf enum NOT_FINISHED = 1; - */ - const NOT_FINISHED = 1; - /** - * The query is finished, but there may be more results after the limit. - * - * Generated from protobuf enum MORE_RESULTS_AFTER_LIMIT = 2; - */ - const MORE_RESULTS_AFTER_LIMIT = 2; - /** - * The query is finished, but there may be more results after the end - * cursor. - * - * Generated from protobuf enum MORE_RESULTS_AFTER_CURSOR = 4; - */ - const MORE_RESULTS_AFTER_CURSOR = 4; - /** - * The query is finished, and there are no more results. - * - * Generated from protobuf enum NO_MORE_RESULTS = 3; - */ - const NO_MORE_RESULTS = 3; - - private static $valueToName = [ - self::MORE_RESULTS_TYPE_UNSPECIFIED => 'MORE_RESULTS_TYPE_UNSPECIFIED', - self::NOT_FINISHED => 'NOT_FINISHED', - self::MORE_RESULTS_AFTER_LIMIT => 'MORE_RESULTS_AFTER_LIMIT', - self::MORE_RESULTS_AFTER_CURSOR => 'MORE_RESULTS_AFTER_CURSOR', - self::NO_MORE_RESULTS => 'NO_MORE_RESULTS', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(MoreResultsType::class, \Google\Cloud\Datastore\V1\QueryResultBatch_MoreResultsType::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions.php deleted file mode 100644 index 8de51a5f93b4..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions.php +++ /dev/null @@ -1,207 +0,0 @@ -google.datastore.v1.ReadOptions - */ -class ReadOptions extends \Google\Protobuf\Internal\Message -{ - protected $consistency_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $read_consistency - * The non-transactional read consistency to use. - * @type string $transaction - * The identifier of the transaction in which to read. A - * transaction identifier is returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * @type \Google\Cloud\Datastore\V1\TransactionOptions $new_transaction - * Options for beginning a new transaction for this request. - * The new transaction identifier will be returned in the corresponding - * response as either - * [LookupResponse.transaction][google.datastore.v1.LookupResponse.transaction] - * or - * [RunQueryResponse.transaction][google.datastore.v1.RunQueryResponse.transaction]. - * @type \Google\Protobuf\Timestamp $read_time - * Reads entities as they were at the given time. This value is only - * supported for Cloud Firestore in Datastore mode. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * The non-transactional read consistency to use. - * - * Generated from protobuf field .google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1; - * @return int - */ - public function getReadConsistency() - { - return $this->readOneof(1); - } - - public function hasReadConsistency() - { - return $this->hasOneof(1); - } - - /** - * The non-transactional read consistency to use. - * - * Generated from protobuf field .google.datastore.v1.ReadOptions.ReadConsistency read_consistency = 1; - * @param int $var - * @return $this - */ - public function setReadConsistency($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\V1\ReadOptions\ReadConsistency::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * The identifier of the transaction in which to read. A - * transaction identifier is returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * - * Generated from protobuf field bytes transaction = 2; - * @return string - */ - public function getTransaction() - { - return $this->readOneof(2); - } - - public function hasTransaction() - { - return $this->hasOneof(2); - } - - /** - * The identifier of the transaction in which to read. A - * transaction identifier is returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * - * Generated from protobuf field bytes transaction = 2; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Options for beginning a new transaction for this request. - * The new transaction identifier will be returned in the corresponding - * response as either - * [LookupResponse.transaction][google.datastore.v1.LookupResponse.transaction] - * or - * [RunQueryResponse.transaction][google.datastore.v1.RunQueryResponse.transaction]. - * - * Generated from protobuf field .google.datastore.v1.TransactionOptions new_transaction = 3; - * @return \Google\Cloud\Datastore\V1\TransactionOptions|null - */ - public function getNewTransaction() - { - return $this->readOneof(3); - } - - public function hasNewTransaction() - { - return $this->hasOneof(3); - } - - /** - * Options for beginning a new transaction for this request. - * The new transaction identifier will be returned in the corresponding - * response as either - * [LookupResponse.transaction][google.datastore.v1.LookupResponse.transaction] - * or - * [RunQueryResponse.transaction][google.datastore.v1.RunQueryResponse.transaction]. - * - * Generated from protobuf field .google.datastore.v1.TransactionOptions new_transaction = 3; - * @param \Google\Cloud\Datastore\V1\TransactionOptions $var - * @return $this - */ - public function setNewTransaction($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\TransactionOptions::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * Reads entities as they were at the given time. This value is only - * supported for Cloud Firestore in Datastore mode. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->readOneof(4); - } - - public function hasReadTime() - { - return $this->hasOneof(4); - } - - /** - * Reads entities as they were at the given time. This value is only - * supported for Cloud Firestore in Datastore mode. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 4; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * @return string - */ - public function getConsistencyType() - { - return $this->whichOneof("consistency_type"); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions/ReadConsistency.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions/ReadConsistency.php deleted file mode 100644 index 631a403de9f1..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReadOptions/ReadConsistency.php +++ /dev/null @@ -1,64 +0,0 @@ -google.datastore.v1.ReadOptions.ReadConsistency - */ -class ReadConsistency -{ - /** - * Unspecified. This value must not be used. - * - * Generated from protobuf enum READ_CONSISTENCY_UNSPECIFIED = 0; - */ - const READ_CONSISTENCY_UNSPECIFIED = 0; - /** - * Strong consistency. - * - * Generated from protobuf enum STRONG = 1; - */ - const STRONG = 1; - /** - * Eventual consistency. - * - * Generated from protobuf enum EVENTUAL = 2; - */ - const EVENTUAL = 2; - - private static $valueToName = [ - self::READ_CONSISTENCY_UNSPECIFIED => 'READ_CONSISTENCY_UNSPECIFIED', - self::STRONG => 'STRONG', - self::EVENTUAL => 'EVENTUAL', - ]; - - public static function name($value) - { - if (!isset(self::$valueToName[$value])) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no name defined for value %s', __CLASS__, $value)); - } - return self::$valueToName[$value]; - } - - - public static function value($name) - { - $const = __CLASS__ . '::' . strtoupper($name); - if (!defined($const)) { - throw new UnexpectedValueException(sprintf( - 'Enum %s has no value defined for name %s', __CLASS__, $name)); - } - return constant($const); - } -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReadConsistency::class, \Google\Cloud\Datastore\V1\ReadOptions_ReadConsistency::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsRequest.php deleted file mode 100644 index 756b9acee543..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsRequest.php +++ /dev/null @@ -1,164 +0,0 @@ -google.datastore.v1.ReserveIdsRequest - */ -class ReserveIdsRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project_id = ''; - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - */ - protected $database_id = ''; - /** - * Required. A list of keys with complete key paths whose numeric IDs should - * not be auto-allocated. - * - * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - private $keys; - - /** - * @param string $projectId Required. The ID of the project against which to make the request. - * @param \Google\Cloud\Datastore\V1\Key[] $keys Required. A list of keys with complete key paths whose numeric IDs should - * not be auto-allocated. - * - * @return \Google\Cloud\Datastore\V1\ReserveIdsRequest - * - * @experimental - */ - public static function build(string $projectId, array $keys): self - { - return (new self()) - ->setProjectId($projectId) - ->setKeys($keys); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Required. The ID of the project against which to make the request. - * @type string $database_id - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $keys - * Required. A list of keys with complete key paths whose numeric IDs should - * not be auto-allocated. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @return string - */ - public function getDatabaseId() - { - return $this->database_id; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @param string $var - * @return $this - */ - public function setDatabaseId($var) - { - GPBUtil::checkString($var, True); - $this->database_id = $var; - - return $this; - } - - /** - * Required. A list of keys with complete key paths whose numeric IDs should - * not be auto-allocated. - * - * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getKeys() - { - return $this->keys; - } - - /** - * Required. A list of keys with complete key paths whose numeric IDs should - * not be auto-allocated. - * - * Generated from protobuf field repeated .google.datastore.v1.Key keys = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Datastore\V1\Key>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setKeys($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\V1\Key::class); - $this->keys = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsResponse.php deleted file mode 100644 index d890d0cbb735..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/ReserveIdsResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -google.datastore.v1.ReserveIdsResponse - */ -class ReserveIdsResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackRequest.php deleted file mode 100644 index 8e823c1778c8..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackRequest.php +++ /dev/null @@ -1,163 +0,0 @@ -google.datastore.v1.RollbackRequest - */ -class RollbackRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project_id = ''; - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - */ - protected $database_id = ''; - /** - * Required. The transaction identifier, returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * - * Generated from protobuf field bytes transaction = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $transaction = ''; - - /** - * @param string $projectId Required. The ID of the project against which to make the request. - * @param string $transaction Required. The transaction identifier, returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * - * @return \Google\Cloud\Datastore\V1\RollbackRequest - * - * @experimental - */ - public static function build(string $projectId, string $transaction): self - { - return (new self()) - ->setProjectId($projectId) - ->setTransaction($transaction); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Required. The ID of the project against which to make the request. - * @type string $database_id - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type string $transaction - * Required. The transaction identifier, returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @return string - */ - public function getDatabaseId() - { - return $this->database_id; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @param string $var - * @return $this - */ - public function setDatabaseId($var) - { - GPBUtil::checkString($var, True); - $this->database_id = $var; - - return $this; - } - - /** - * Required. The transaction identifier, returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * - * Generated from protobuf field bytes transaction = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getTransaction() - { - return $this->transaction; - } - - /** - * Required. The transaction identifier, returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * - * Generated from protobuf field bytes transaction = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->transaction = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackResponse.php deleted file mode 100644 index 4a043aebfbd5..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RollbackResponse.php +++ /dev/null @@ -1,35 +0,0 @@ -google.datastore.v1.RollbackResponse - */ -class RollbackResponse extends \Google\Protobuf\Internal\Message -{ - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryRequest.php deleted file mode 100644 index 85f561b5e40b..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryRequest.php +++ /dev/null @@ -1,333 +0,0 @@ -google.datastore.v1.RunAggregationQueryRequest - */ -class RunAggregationQueryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project_id = ''; - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - */ - protected $database_id = ''; - /** - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * - * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 2; - */ - protected $partition_id = null; - /** - * The options for this query. - * - * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; - */ - protected $read_options = null; - /** - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * - * Generated from protobuf field .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $explain_options = null; - protected $query_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Required. The ID of the project against which to make the request. - * @type string $database_id - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type \Google\Cloud\Datastore\V1\PartitionId $partition_id - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * @type \Google\Cloud\Datastore\V1\ReadOptions $read_options - * The options for this query. - * @type \Google\Cloud\Datastore\V1\AggregationQuery $aggregation_query - * The query to run. - * @type \Google\Cloud\Datastore\V1\GqlQuery $gql_query - * The GQL query to run. This query must be an aggregation query. - * @type \Google\Cloud\Datastore\V1\ExplainOptions $explain_options - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @return string - */ - public function getDatabaseId() - { - return $this->database_id; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @param string $var - * @return $this - */ - public function setDatabaseId($var) - { - GPBUtil::checkString($var, True); - $this->database_id = $var; - - return $this; - } - - /** - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * - * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 2; - * @return \Google\Cloud\Datastore\V1\PartitionId|null - */ - public function getPartitionId() - { - return $this->partition_id; - } - - public function hasPartitionId() - { - return isset($this->partition_id); - } - - public function clearPartitionId() - { - unset($this->partition_id); - } - - /** - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * - * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 2; - * @param \Google\Cloud\Datastore\V1\PartitionId $var - * @return $this - */ - public function setPartitionId($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PartitionId::class); - $this->partition_id = $var; - - return $this; - } - - /** - * The options for this query. - * - * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; - * @return \Google\Cloud\Datastore\V1\ReadOptions|null - */ - public function getReadOptions() - { - return $this->read_options; - } - - public function hasReadOptions() - { - return isset($this->read_options); - } - - public function clearReadOptions() - { - unset($this->read_options); - } - - /** - * The options for this query. - * - * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; - * @param \Google\Cloud\Datastore\V1\ReadOptions $var - * @return $this - */ - public function setReadOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ReadOptions::class); - $this->read_options = $var; - - return $this; - } - - /** - * The query to run. - * - * Generated from protobuf field .google.datastore.v1.AggregationQuery aggregation_query = 3; - * @return \Google\Cloud\Datastore\V1\AggregationQuery|null - */ - public function getAggregationQuery() - { - return $this->readOneof(3); - } - - public function hasAggregationQuery() - { - return $this->hasOneof(3); - } - - /** - * The query to run. - * - * Generated from protobuf field .google.datastore.v1.AggregationQuery aggregation_query = 3; - * @param \Google\Cloud\Datastore\V1\AggregationQuery $var - * @return $this - */ - public function setAggregationQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\AggregationQuery::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * The GQL query to run. This query must be an aggregation query. - * - * Generated from protobuf field .google.datastore.v1.GqlQuery gql_query = 7; - * @return \Google\Cloud\Datastore\V1\GqlQuery|null - */ - public function getGqlQuery() - { - return $this->readOneof(7); - } - - public function hasGqlQuery() - { - return $this->hasOneof(7); - } - - /** - * The GQL query to run. This query must be an aggregation query. - * - * Generated from protobuf field .google.datastore.v1.GqlQuery gql_query = 7; - * @param \Google\Cloud\Datastore\V1\GqlQuery $var - * @return $this - */ - public function setGqlQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\GqlQuery::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * - * Generated from protobuf field .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Datastore\V1\ExplainOptions|null - */ - public function getExplainOptions() - { - return $this->explain_options; - } - - public function hasExplainOptions() - { - return isset($this->explain_options); - } - - public function clearExplainOptions() - { - unset($this->explain_options); - } - - /** - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * - * Generated from protobuf field .google.datastore.v1.ExplainOptions explain_options = 11 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Datastore\V1\ExplainOptions $var - * @return $this - */ - public function setExplainOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ExplainOptions::class); - $this->explain_options = $var; - - return $this; - } - - /** - * @return string - */ - public function getQueryType() - { - return $this->whichOneof("query_type"); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryResponse.php deleted file mode 100644 index 0ebff5e68fa2..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunAggregationQueryResponse.php +++ /dev/null @@ -1,228 +0,0 @@ -google.datastore.v1.RunAggregationQueryResponse - */ -class RunAggregationQueryResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A batch of aggregation results. Always present. - * - * Generated from protobuf field .google.datastore.v1.AggregationResultBatch batch = 1; - */ - protected $batch = null; - /** - * The parsed form of the `GqlQuery` from the request, if it was set. - * - * Generated from protobuf field .google.datastore.v1.AggregationQuery query = 2; - */ - protected $query = null; - /** - * The identifier of the transaction that was started as part of this - * RunAggregationQuery request. - * Set only when - * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - * was set in - * [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options]. - * - * Generated from protobuf field bytes transaction = 5; - */ - protected $transaction = ''; - /** - * Query explain metrics. This is only present when the - * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.datastore.v1.ExplainMetrics explain_metrics = 9; - */ - protected $explain_metrics = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\AggregationResultBatch $batch - * A batch of aggregation results. Always present. - * @type \Google\Cloud\Datastore\V1\AggregationQuery $query - * The parsed form of the `GqlQuery` from the request, if it was set. - * @type string $transaction - * The identifier of the transaction that was started as part of this - * RunAggregationQuery request. - * Set only when - * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - * was set in - * [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options]. - * @type \Google\Cloud\Datastore\V1\ExplainMetrics $explain_metrics - * Query explain metrics. This is only present when the - * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * A batch of aggregation results. Always present. - * - * Generated from protobuf field .google.datastore.v1.AggregationResultBatch batch = 1; - * @return \Google\Cloud\Datastore\V1\AggregationResultBatch|null - */ - public function getBatch() - { - return $this->batch; - } - - public function hasBatch() - { - return isset($this->batch); - } - - public function clearBatch() - { - unset($this->batch); - } - - /** - * A batch of aggregation results. Always present. - * - * Generated from protobuf field .google.datastore.v1.AggregationResultBatch batch = 1; - * @param \Google\Cloud\Datastore\V1\AggregationResultBatch $var - * @return $this - */ - public function setBatch($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\AggregationResultBatch::class); - $this->batch = $var; - - return $this; - } - - /** - * The parsed form of the `GqlQuery` from the request, if it was set. - * - * Generated from protobuf field .google.datastore.v1.AggregationQuery query = 2; - * @return \Google\Cloud\Datastore\V1\AggregationQuery|null - */ - public function getQuery() - { - return $this->query; - } - - public function hasQuery() - { - return isset($this->query); - } - - public function clearQuery() - { - unset($this->query); - } - - /** - * The parsed form of the `GqlQuery` from the request, if it was set. - * - * Generated from protobuf field .google.datastore.v1.AggregationQuery query = 2; - * @param \Google\Cloud\Datastore\V1\AggregationQuery $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\AggregationQuery::class); - $this->query = $var; - - return $this; - } - - /** - * The identifier of the transaction that was started as part of this - * RunAggregationQuery request. - * Set only when - * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - * was set in - * [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options]. - * - * Generated from protobuf field bytes transaction = 5; - * @return string - */ - public function getTransaction() - { - return $this->transaction; - } - - /** - * The identifier of the transaction that was started as part of this - * RunAggregationQuery request. - * Set only when - * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - * was set in - * [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options]. - * - * Generated from protobuf field bytes transaction = 5; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->transaction = $var; - - return $this; - } - - /** - * Query explain metrics. This is only present when the - * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.datastore.v1.ExplainMetrics explain_metrics = 9; - * @return \Google\Cloud\Datastore\V1\ExplainMetrics|null - */ - public function getExplainMetrics() - { - return $this->explain_metrics; - } - - public function hasExplainMetrics() - { - return isset($this->explain_metrics); - } - - public function clearExplainMetrics() - { - unset($this->explain_metrics); - } - - /** - * Query explain metrics. This is only present when the - * [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.datastore.v1.ExplainMetrics explain_metrics = 9; - * @param \Google\Cloud\Datastore\V1\ExplainMetrics $var - * @return $this - */ - public function setExplainMetrics($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ExplainMetrics::class); - $this->explain_metrics = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryRequest.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryRequest.php deleted file mode 100644 index a622f98a1e1e..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryRequest.php +++ /dev/null @@ -1,388 +0,0 @@ -google.datastore.v1.RunQueryRequest - */ -class RunQueryRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project_id = ''; - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - */ - protected $database_id = ''; - /** - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * - * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 2; - */ - protected $partition_id = null; - /** - * The options for this query. - * - * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; - */ - protected $read_options = null; - /** - * The properties to return. - * This field must not be set for a projection query. - * See - * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. - * - * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 10; - */ - protected $property_mask = null; - /** - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * - * Generated from protobuf field .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; - */ - protected $explain_options = null; - protected $query_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Required. The ID of the project against which to make the request. - * @type string $database_id - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type \Google\Cloud\Datastore\V1\PartitionId $partition_id - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * @type \Google\Cloud\Datastore\V1\ReadOptions $read_options - * The options for this query. - * @type \Google\Cloud\Datastore\V1\Query $query - * The query to run. - * @type \Google\Cloud\Datastore\V1\GqlQuery $gql_query - * The GQL query to run. This query must be a non-aggregation query. - * @type \Google\Cloud\Datastore\V1\PropertyMask $property_mask - * The properties to return. - * This field must not be set for a projection query. - * See - * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. - * @type \Google\Cloud\Datastore\V1\ExplainOptions $explain_options - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. The ID of the project against which to make the request. - * - * Generated from protobuf field string project_id = 8 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @return string - */ - public function getDatabaseId() - { - return $this->database_id; - } - - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * - * Generated from protobuf field string database_id = 9; - * @param string $var - * @return $this - */ - public function setDatabaseId($var) - { - GPBUtil::checkString($var, True); - $this->database_id = $var; - - return $this; - } - - /** - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * - * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 2; - * @return \Google\Cloud\Datastore\V1\PartitionId|null - */ - public function getPartitionId() - { - return $this->partition_id; - } - - public function hasPartitionId() - { - return isset($this->partition_id); - } - - public function clearPartitionId() - { - unset($this->partition_id); - } - - /** - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * - * Generated from protobuf field .google.datastore.v1.PartitionId partition_id = 2; - * @param \Google\Cloud\Datastore\V1\PartitionId $var - * @return $this - */ - public function setPartitionId($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PartitionId::class); - $this->partition_id = $var; - - return $this; - } - - /** - * The options for this query. - * - * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; - * @return \Google\Cloud\Datastore\V1\ReadOptions|null - */ - public function getReadOptions() - { - return $this->read_options; - } - - public function hasReadOptions() - { - return isset($this->read_options); - } - - public function clearReadOptions() - { - unset($this->read_options); - } - - /** - * The options for this query. - * - * Generated from protobuf field .google.datastore.v1.ReadOptions read_options = 1; - * @param \Google\Cloud\Datastore\V1\ReadOptions $var - * @return $this - */ - public function setReadOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ReadOptions::class); - $this->read_options = $var; - - return $this; - } - - /** - * The query to run. - * - * Generated from protobuf field .google.datastore.v1.Query query = 3; - * @return \Google\Cloud\Datastore\V1\Query|null - */ - public function getQuery() - { - return $this->readOneof(3); - } - - public function hasQuery() - { - return $this->hasOneof(3); - } - - /** - * The query to run. - * - * Generated from protobuf field .google.datastore.v1.Query query = 3; - * @param \Google\Cloud\Datastore\V1\Query $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Query::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * The GQL query to run. This query must be a non-aggregation query. - * - * Generated from protobuf field .google.datastore.v1.GqlQuery gql_query = 7; - * @return \Google\Cloud\Datastore\V1\GqlQuery|null - */ - public function getGqlQuery() - { - return $this->readOneof(7); - } - - public function hasGqlQuery() - { - return $this->hasOneof(7); - } - - /** - * The GQL query to run. This query must be a non-aggregation query. - * - * Generated from protobuf field .google.datastore.v1.GqlQuery gql_query = 7; - * @param \Google\Cloud\Datastore\V1\GqlQuery $var - * @return $this - */ - public function setGqlQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\GqlQuery::class); - $this->writeOneof(7, $var); - - return $this; - } - - /** - * The properties to return. - * This field must not be set for a projection query. - * See - * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. - * - * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 10; - * @return \Google\Cloud\Datastore\V1\PropertyMask|null - */ - public function getPropertyMask() - { - return $this->property_mask; - } - - public function hasPropertyMask() - { - return isset($this->property_mask); - } - - public function clearPropertyMask() - { - unset($this->property_mask); - } - - /** - * The properties to return. - * This field must not be set for a projection query. - * See - * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. - * - * Generated from protobuf field .google.datastore.v1.PropertyMask property_mask = 10; - * @param \Google\Cloud\Datastore\V1\PropertyMask $var - * @return $this - */ - public function setPropertyMask($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\PropertyMask::class); - $this->property_mask = $var; - - return $this; - } - - /** - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * - * Generated from protobuf field .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @return \Google\Cloud\Datastore\V1\ExplainOptions|null - */ - public function getExplainOptions() - { - return $this->explain_options; - } - - public function hasExplainOptions() - { - return isset($this->explain_options); - } - - public function clearExplainOptions() - { - unset($this->explain_options); - } - - /** - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * - * Generated from protobuf field .google.datastore.v1.ExplainOptions explain_options = 12 [(.google.api.field_behavior) = OPTIONAL]; - * @param \Google\Cloud\Datastore\V1\ExplainOptions $var - * @return $this - */ - public function setExplainOptions($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ExplainOptions::class); - $this->explain_options = $var; - - return $this; - } - - /** - * @return string - */ - public function getQueryType() - { - return $this->whichOneof("query_type"); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryResponse.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryResponse.php deleted file mode 100644 index 752570362949..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/RunQueryResponse.php +++ /dev/null @@ -1,228 +0,0 @@ -google.datastore.v1.RunQueryResponse - */ -class RunQueryResponse extends \Google\Protobuf\Internal\Message -{ - /** - * A batch of query results (always present). - * - * Generated from protobuf field .google.datastore.v1.QueryResultBatch batch = 1; - */ - protected $batch = null; - /** - * The parsed form of the `GqlQuery` from the request, if it was set. - * - * Generated from protobuf field .google.datastore.v1.Query query = 2; - */ - protected $query = null; - /** - * The identifier of the transaction that was started as part of this - * RunQuery request. - * Set only when - * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - * was set in - * [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options]. - * - * Generated from protobuf field bytes transaction = 5; - */ - protected $transaction = ''; - /** - * Query explain metrics. This is only present when the - * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.datastore.v1.ExplainMetrics explain_metrics = 9; - */ - protected $explain_metrics = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\QueryResultBatch $batch - * A batch of query results (always present). - * @type \Google\Cloud\Datastore\V1\Query $query - * The parsed form of the `GqlQuery` from the request, if it was set. - * @type string $transaction - * The identifier of the transaction that was started as part of this - * RunQuery request. - * Set only when - * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - * was set in - * [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options]. - * @type \Google\Cloud\Datastore\V1\ExplainMetrics $explain_metrics - * Query explain metrics. This is only present when the - * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * A batch of query results (always present). - * - * Generated from protobuf field .google.datastore.v1.QueryResultBatch batch = 1; - * @return \Google\Cloud\Datastore\V1\QueryResultBatch|null - */ - public function getBatch() - { - return $this->batch; - } - - public function hasBatch() - { - return isset($this->batch); - } - - public function clearBatch() - { - unset($this->batch); - } - - /** - * A batch of query results (always present). - * - * Generated from protobuf field .google.datastore.v1.QueryResultBatch batch = 1; - * @param \Google\Cloud\Datastore\V1\QueryResultBatch $var - * @return $this - */ - public function setBatch($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\QueryResultBatch::class); - $this->batch = $var; - - return $this; - } - - /** - * The parsed form of the `GqlQuery` from the request, if it was set. - * - * Generated from protobuf field .google.datastore.v1.Query query = 2; - * @return \Google\Cloud\Datastore\V1\Query|null - */ - public function getQuery() - { - return $this->query; - } - - public function hasQuery() - { - return isset($this->query); - } - - public function clearQuery() - { - unset($this->query); - } - - /** - * The parsed form of the `GqlQuery` from the request, if it was set. - * - * Generated from protobuf field .google.datastore.v1.Query query = 2; - * @param \Google\Cloud\Datastore\V1\Query $var - * @return $this - */ - public function setQuery($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Query::class); - $this->query = $var; - - return $this; - } - - /** - * The identifier of the transaction that was started as part of this - * RunQuery request. - * Set only when - * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - * was set in - * [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options]. - * - * Generated from protobuf field bytes transaction = 5; - * @return string - */ - public function getTransaction() - { - return $this->transaction; - } - - /** - * The identifier of the transaction that was started as part of this - * RunQuery request. - * Set only when - * [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - * was set in - * [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options]. - * - * Generated from protobuf field bytes transaction = 5; - * @param string $var - * @return $this - */ - public function setTransaction($var) - { - GPBUtil::checkString($var, False); - $this->transaction = $var; - - return $this; - } - - /** - * Query explain metrics. This is only present when the - * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.datastore.v1.ExplainMetrics explain_metrics = 9; - * @return \Google\Cloud\Datastore\V1\ExplainMetrics|null - */ - public function getExplainMetrics() - { - return $this->explain_metrics; - } - - public function hasExplainMetrics() - { - return isset($this->explain_metrics); - } - - public function clearExplainMetrics() - { - unset($this->explain_metrics); - } - - /** - * Query explain metrics. This is only present when the - * [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options] - * is provided, and it is sent only once with the last response in the stream. - * - * Generated from protobuf field .google.datastore.v1.ExplainMetrics explain_metrics = 9; - * @param \Google\Cloud\Datastore\V1\ExplainMetrics $var - * @return $this - */ - public function setExplainMetrics($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ExplainMetrics::class); - $this->explain_metrics = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions.php deleted file mode 100644 index f1d2d422af6d..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions.php +++ /dev/null @@ -1,113 +0,0 @@ -google.datastore.v1.TransactionOptions - */ -class TransactionOptions extends \Google\Protobuf\Internal\Message -{ - protected $mode; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite $read_write - * The transaction should allow both reads and writes. - * @type \Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly $read_only - * The transaction should only allow reads. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * The transaction should allow both reads and writes. - * - * Generated from protobuf field .google.datastore.v1.TransactionOptions.ReadWrite read_write = 1; - * @return \Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite|null - */ - public function getReadWrite() - { - return $this->readOneof(1); - } - - public function hasReadWrite() - { - return $this->hasOneof(1); - } - - /** - * The transaction should allow both reads and writes. - * - * Generated from protobuf field .google.datastore.v1.TransactionOptions.ReadWrite read_write = 1; - * @param \Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite $var - * @return $this - */ - public function setReadWrite($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite::class); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * The transaction should only allow reads. - * - * Generated from protobuf field .google.datastore.v1.TransactionOptions.ReadOnly read_only = 2; - * @return \Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly|null - */ - public function getReadOnly() - { - return $this->readOneof(2); - } - - public function hasReadOnly() - { - return $this->hasOneof(2); - } - - /** - * The transaction should only allow reads. - * - * Generated from protobuf field .google.datastore.v1.TransactionOptions.ReadOnly read_only = 2; - * @param \Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly $var - * @return $this - */ - public function setReadOnly($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * @return string - */ - public function getMode() - { - return $this->whichOneof("mode"); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/PBReadOnly.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/PBReadOnly.php deleted file mode 100644 index 77e0b253f413..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/PBReadOnly.php +++ /dev/null @@ -1,95 +0,0 @@ -google.datastore.v1.TransactionOptions.ReadOnly - */ -class PBReadOnly extends \Google\Protobuf\Internal\Message -{ - /** - * Reads entities at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 1; - */ - protected $read_time = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $read_time - * Reads entities at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * Reads entities at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getReadTime() - { - return $this->read_time; - } - - public function hasReadTime() - { - return isset($this->read_time); - } - - public function clearReadTime() - { - unset($this->read_time); - } - - /** - * Reads entities at the given time. - * This must be a microsecond precision timestamp within the past one hour, - * or if Point-in-Time Recovery is enabled, can additionally be a whole - * minute timestamp within the past 7 days. - * - * Generated from protobuf field .google.protobuf.Timestamp read_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setReadTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->read_time = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PBReadOnly::class, \Google\Cloud\Datastore\V1\TransactionOptions_ReadOnly::class); - -// Adding a class alias for backwards compatibility with the "readonly" keyword. -class_alias(PBReadOnly::class, __NAMESPACE__ . '\ReadOnly'); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/ReadOnly.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/ReadOnly.php deleted file mode 100644 index f6ef4bbabdcc..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/ReadOnly.php +++ /dev/null @@ -1,9 +0,0 @@ -google.datastore.v1.TransactionOptions.ReadWrite - */ -class ReadWrite extends \Google\Protobuf\Internal\Message -{ - /** - * The transaction identifier of the transaction being retried. - * - * Generated from protobuf field bytes previous_transaction = 1; - */ - protected $previous_transaction = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $previous_transaction - * The transaction identifier of the transaction being retried. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Datastore::initOnce(); - parent::__construct($data); - } - - /** - * The transaction identifier of the transaction being retried. - * - * Generated from protobuf field bytes previous_transaction = 1; - * @return string - */ - public function getPreviousTransaction() - { - return $this->previous_transaction; - } - - /** - * The transaction identifier of the transaction being retried. - * - * Generated from protobuf field bytes previous_transaction = 1; - * @param string $var - * @return $this - */ - public function setPreviousTransaction($var) - { - GPBUtil::checkString($var, False); - $this->previous_transaction = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(ReadWrite::class, \Google\Cloud\Datastore\V1\TransactionOptions_ReadWrite::class); - diff --git a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Value.php b/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Value.php deleted file mode 100644 index 2b2ef2edcd88..000000000000 --- a/owl-bot-staging/Datastore/v1/proto/src/Google/Cloud/Datastore/V1/Value.php +++ /dev/null @@ -1,517 +0,0 @@ -google.datastore.v1.Value - */ -class Value extends \Google\Protobuf\Internal\Message -{ - /** - * The `meaning` field should only be populated for backwards compatibility. - * - * Generated from protobuf field int32 meaning = 14; - */ - protected $meaning = 0; - /** - * If the value should be excluded from all indexes including those defined - * explicitly. - * - * Generated from protobuf field bool exclude_from_indexes = 19; - */ - protected $exclude_from_indexes = false; - protected $value_type; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $null_value - * A null value. - * @type bool $boolean_value - * A boolean value. - * @type int|string $integer_value - * An integer value. - * @type float $double_value - * A double value. - * @type \Google\Protobuf\Timestamp $timestamp_value - * A timestamp value. - * When stored in the Datastore, precise only to microseconds; - * any additional precision is rounded down. - * @type \Google\Cloud\Datastore\V1\Key $key_value - * A key value. - * @type string $string_value - * A UTF-8 encoded string value. - * When `exclude_from_indexes` is false (it is indexed) , may have at most - * 1500 bytes. Otherwise, may be set to at most 1,000,000 bytes. - * @type string $blob_value - * A blob value. - * May have at most 1,000,000 bytes. - * When `exclude_from_indexes` is false, may have at most 1500 bytes. - * In JSON requests, must be base64-encoded. - * @type \Google\Type\LatLng $geo_point_value - * A geo point value representing a point on the surface of Earth. - * @type \Google\Cloud\Datastore\V1\Entity $entity_value - * An entity value. - * - May have no key. - * - May have a key with an incomplete key path. - * - May have a reserved/read-only key. - * @type \Google\Cloud\Datastore\V1\ArrayValue $array_value - * An array value. - * Cannot contain another array value. - * A `Value` instance that sets field `array_value` must not set fields - * `meaning` or `exclude_from_indexes`. - * @type int $meaning - * The `meaning` field should only be populated for backwards compatibility. - * @type bool $exclude_from_indexes - * If the value should be excluded from all indexes including those defined - * explicitly. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\V1\Entity::initOnce(); - parent::__construct($data); - } - - /** - * A null value. - * - * Generated from protobuf field .google.protobuf.NullValue null_value = 11; - * @return int - */ - public function getNullValue() - { - return $this->readOneof(11); - } - - public function hasNullValue() - { - return $this->hasOneof(11); - } - - /** - * A null value. - * - * Generated from protobuf field .google.protobuf.NullValue null_value = 11; - * @param int $var - * @return $this - */ - public function setNullValue($var) - { - GPBUtil::checkEnum($var, \Google\Protobuf\NullValue::class); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * A boolean value. - * - * Generated from protobuf field bool boolean_value = 1; - * @return bool - */ - public function getBooleanValue() - { - return $this->readOneof(1); - } - - public function hasBooleanValue() - { - return $this->hasOneof(1); - } - - /** - * A boolean value. - * - * Generated from protobuf field bool boolean_value = 1; - * @param bool $var - * @return $this - */ - public function setBooleanValue($var) - { - GPBUtil::checkBool($var); - $this->writeOneof(1, $var); - - return $this; - } - - /** - * An integer value. - * - * Generated from protobuf field int64 integer_value = 2; - * @return int|string - */ - public function getIntegerValue() - { - return $this->readOneof(2); - } - - public function hasIntegerValue() - { - return $this->hasOneof(2); - } - - /** - * An integer value. - * - * Generated from protobuf field int64 integer_value = 2; - * @param int|string $var - * @return $this - */ - public function setIntegerValue($var) - { - GPBUtil::checkInt64($var); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * A double value. - * - * Generated from protobuf field double double_value = 3; - * @return float - */ - public function getDoubleValue() - { - return $this->readOneof(3); - } - - public function hasDoubleValue() - { - return $this->hasOneof(3); - } - - /** - * A double value. - * - * Generated from protobuf field double double_value = 3; - * @param float $var - * @return $this - */ - public function setDoubleValue($var) - { - GPBUtil::checkDouble($var); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * A timestamp value. - * When stored in the Datastore, precise only to microseconds; - * any additional precision is rounded down. - * - * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 10; - * @return \Google\Protobuf\Timestamp|null - */ - public function getTimestampValue() - { - return $this->readOneof(10); - } - - public function hasTimestampValue() - { - return $this->hasOneof(10); - } - - /** - * A timestamp value. - * When stored in the Datastore, precise only to microseconds; - * any additional precision is rounded down. - * - * Generated from protobuf field .google.protobuf.Timestamp timestamp_value = 10; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setTimestampValue($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->writeOneof(10, $var); - - return $this; - } - - /** - * A key value. - * - * Generated from protobuf field .google.datastore.v1.Key key_value = 5; - * @return \Google\Cloud\Datastore\V1\Key|null - */ - public function getKeyValue() - { - return $this->readOneof(5); - } - - public function hasKeyValue() - { - return $this->hasOneof(5); - } - - /** - * A key value. - * - * Generated from protobuf field .google.datastore.v1.Key key_value = 5; - * @param \Google\Cloud\Datastore\V1\Key $var - * @return $this - */ - public function setKeyValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Key::class); - $this->writeOneof(5, $var); - - return $this; - } - - /** - * A UTF-8 encoded string value. - * When `exclude_from_indexes` is false (it is indexed) , may have at most - * 1500 bytes. Otherwise, may be set to at most 1,000,000 bytes. - * - * Generated from protobuf field string string_value = 17; - * @return string - */ - public function getStringValue() - { - return $this->readOneof(17); - } - - public function hasStringValue() - { - return $this->hasOneof(17); - } - - /** - * A UTF-8 encoded string value. - * When `exclude_from_indexes` is false (it is indexed) , may have at most - * 1500 bytes. Otherwise, may be set to at most 1,000,000 bytes. - * - * Generated from protobuf field string string_value = 17; - * @param string $var - * @return $this - */ - public function setStringValue($var) - { - GPBUtil::checkString($var, True); - $this->writeOneof(17, $var); - - return $this; - } - - /** - * A blob value. - * May have at most 1,000,000 bytes. - * When `exclude_from_indexes` is false, may have at most 1500 bytes. - * In JSON requests, must be base64-encoded. - * - * Generated from protobuf field bytes blob_value = 18; - * @return string - */ - public function getBlobValue() - { - return $this->readOneof(18); - } - - public function hasBlobValue() - { - return $this->hasOneof(18); - } - - /** - * A blob value. - * May have at most 1,000,000 bytes. - * When `exclude_from_indexes` is false, may have at most 1500 bytes. - * In JSON requests, must be base64-encoded. - * - * Generated from protobuf field bytes blob_value = 18; - * @param string $var - * @return $this - */ - public function setBlobValue($var) - { - GPBUtil::checkString($var, False); - $this->writeOneof(18, $var); - - return $this; - } - - /** - * A geo point value representing a point on the surface of Earth. - * - * Generated from protobuf field .google.type.LatLng geo_point_value = 8; - * @return \Google\Type\LatLng|null - */ - public function getGeoPointValue() - { - return $this->readOneof(8); - } - - public function hasGeoPointValue() - { - return $this->hasOneof(8); - } - - /** - * A geo point value representing a point on the surface of Earth. - * - * Generated from protobuf field .google.type.LatLng geo_point_value = 8; - * @param \Google\Type\LatLng $var - * @return $this - */ - public function setGeoPointValue($var) - { - GPBUtil::checkMessage($var, \Google\Type\LatLng::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * An entity value. - * - May have no key. - * - May have a key with an incomplete key path. - * - May have a reserved/read-only key. - * - * Generated from protobuf field .google.datastore.v1.Entity entity_value = 6; - * @return \Google\Cloud\Datastore\V1\Entity|null - */ - public function getEntityValue() - { - return $this->readOneof(6); - } - - public function hasEntityValue() - { - return $this->hasOneof(6); - } - - /** - * An entity value. - * - May have no key. - * - May have a key with an incomplete key path. - * - May have a reserved/read-only key. - * - * Generated from protobuf field .google.datastore.v1.Entity entity_value = 6; - * @param \Google\Cloud\Datastore\V1\Entity $var - * @return $this - */ - public function setEntityValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\Entity::class); - $this->writeOneof(6, $var); - - return $this; - } - - /** - * An array value. - * Cannot contain another array value. - * A `Value` instance that sets field `array_value` must not set fields - * `meaning` or `exclude_from_indexes`. - * - * Generated from protobuf field .google.datastore.v1.ArrayValue array_value = 9; - * @return \Google\Cloud\Datastore\V1\ArrayValue|null - */ - public function getArrayValue() - { - return $this->readOneof(9); - } - - public function hasArrayValue() - { - return $this->hasOneof(9); - } - - /** - * An array value. - * Cannot contain another array value. - * A `Value` instance that sets field `array_value` must not set fields - * `meaning` or `exclude_from_indexes`. - * - * Generated from protobuf field .google.datastore.v1.ArrayValue array_value = 9; - * @param \Google\Cloud\Datastore\V1\ArrayValue $var - * @return $this - */ - public function setArrayValue($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\V1\ArrayValue::class); - $this->writeOneof(9, $var); - - return $this; - } - - /** - * The `meaning` field should only be populated for backwards compatibility. - * - * Generated from protobuf field int32 meaning = 14; - * @return int - */ - public function getMeaning() - { - return $this->meaning; - } - - /** - * The `meaning` field should only be populated for backwards compatibility. - * - * Generated from protobuf field int32 meaning = 14; - * @param int $var - * @return $this - */ - public function setMeaning($var) - { - GPBUtil::checkInt32($var); - $this->meaning = $var; - - return $this; - } - - /** - * If the value should be excluded from all indexes including those defined - * explicitly. - * - * Generated from protobuf field bool exclude_from_indexes = 19; - * @return bool - */ - public function getExcludeFromIndexes() - { - return $this->exclude_from_indexes; - } - - /** - * If the value should be excluded from all indexes including those defined - * explicitly. - * - * Generated from protobuf field bool exclude_from_indexes = 19; - * @param bool $var - * @return $this - */ - public function setExcludeFromIndexes($var) - { - GPBUtil::checkBool($var); - $this->exclude_from_indexes = $var; - - return $this; - } - - /** - * @return string - */ - public function getValueType() - { - return $this->whichOneof("value_type"); - } - -} - diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/allocate_ids.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/allocate_ids.php deleted file mode 100644 index f7de5fa7ff80..000000000000 --- a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/allocate_ids.php +++ /dev/null @@ -1,74 +0,0 @@ -setProjectId($projectId) - ->setKeys($keys); - - // Call the API and handle any network failures. - try { - /** @var AllocateIdsResponse $response */ - $response = $datastoreClient->allocateIds($request); - 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 -{ - $projectId = '[PROJECT_ID]'; - - allocate_ids_sample($projectId); -} -// [END datastore_v1_generated_Datastore_AllocateIds_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/begin_transaction.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/begin_transaction.php deleted file mode 100644 index ab644ee65011..000000000000 --- a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/begin_transaction.php +++ /dev/null @@ -1,70 +0,0 @@ -setProjectId($projectId); - - // Call the API and handle any network failures. - try { - /** @var BeginTransactionResponse $response */ - $response = $datastoreClient->beginTransaction($request); - 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 -{ - $projectId = '[PROJECT_ID]'; - - begin_transaction_sample($projectId); -} -// [END datastore_v1_generated_Datastore_BeginTransaction_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/commit.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/commit.php deleted file mode 100644 index fd3d7d4a7577..000000000000 --- a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/commit.php +++ /dev/null @@ -1,78 +0,0 @@ -setProjectId($projectId) - ->setMode($mode) - ->setMutations($mutations); - - // Call the API and handle any network failures. - try { - /** @var CommitResponse $response */ - $response = $datastoreClient->commit($request); - 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 -{ - $projectId = '[PROJECT_ID]'; - $mode = Mode::MODE_UNSPECIFIED; - - commit_sample($projectId, $mode); -} -// [END datastore_v1_generated_Datastore_Commit_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/lookup.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/lookup.php deleted file mode 100644 index ecfeb42175fa..000000000000 --- a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/lookup.php +++ /dev/null @@ -1,73 +0,0 @@ -setProjectId($projectId) - ->setKeys($keys); - - // Call the API and handle any network failures. - try { - /** @var LookupResponse $response */ - $response = $datastoreClient->lookup($request); - 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 -{ - $projectId = '[PROJECT_ID]'; - - lookup_sample($projectId); -} -// [END datastore_v1_generated_Datastore_Lookup_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/reserve_ids.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/reserve_ids.php deleted file mode 100644 index 3fce8684f055..000000000000 --- a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/reserve_ids.php +++ /dev/null @@ -1,74 +0,0 @@ -setProjectId($projectId) - ->setKeys($keys); - - // Call the API and handle any network failures. - try { - /** @var ReserveIdsResponse $response */ - $response = $datastoreClient->reserveIds($request); - 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 -{ - $projectId = '[PROJECT_ID]'; - - reserve_ids_sample($projectId); -} -// [END datastore_v1_generated_Datastore_ReserveIds_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/rollback.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/rollback.php deleted file mode 100644 index 657d32ada50e..000000000000 --- a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/rollback.php +++ /dev/null @@ -1,74 +0,0 @@ -setProjectId($projectId) - ->setTransaction($transaction); - - // Call the API and handle any network failures. - try { - /** @var RollbackResponse $response */ - $response = $datastoreClient->rollback($request); - 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 -{ - $projectId = '[PROJECT_ID]'; - $transaction = '...'; - - rollback_sample($projectId, $transaction); -} -// [END datastore_v1_generated_Datastore_Rollback_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_aggregation_query.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_aggregation_query.php deleted file mode 100644 index f7c99caf4ac4..000000000000 --- a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_aggregation_query.php +++ /dev/null @@ -1,70 +0,0 @@ -setProjectId($projectId); - - // Call the API and handle any network failures. - try { - /** @var RunAggregationQueryResponse $response */ - $response = $datastoreClient->runAggregationQuery($request); - 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 -{ - $projectId = '[PROJECT_ID]'; - - run_aggregation_query_sample($projectId); -} -// [END datastore_v1_generated_Datastore_RunAggregationQuery_sync] diff --git a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_query.php b/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_query.php deleted file mode 100644 index 0fe2c0b5e241..000000000000 --- a/owl-bot-staging/Datastore/v1/samples/V1/DatastoreClient/run_query.php +++ /dev/null @@ -1,73 +0,0 @@ -setProjectId($projectId) - ->setPartitionId($partitionId); - - // Call the API and handle any network failures. - try { - /** @var RunQueryResponse $response */ - $response = $datastoreClient->runQuery($request); - 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 -{ - $projectId = '[PROJECT_ID]'; - - run_query_sample($projectId); -} -// [END datastore_v1_generated_Datastore_RunQuery_sync] diff --git a/owl-bot-staging/Datastore/v1/src/V1/Client/DatastoreClient.php b/owl-bot-staging/Datastore/v1/src/V1/Client/DatastoreClient.php deleted file mode 100644 index 4a343ecaca14..000000000000 --- a/owl-bot-staging/Datastore/v1/src/V1/Client/DatastoreClient.php +++ /dev/null @@ -1,403 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/datastore_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/datastore_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/datastore_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/datastore_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'datastore.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** Handles execution of the async variants for each documented method. */ - public function __call($method, $args) - { - if (substr($method, -5) !== 'Async') { - trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); - } - - array_unshift($args, substr($method, 0, -5)); - return call_user_func_array([$this, 'startAsyncCall'], $args); - } - - /** - * Allocates IDs for the given keys, which is useful for referencing an entity - * before it is inserted. - * - * The async variant is {@see DatastoreClient::allocateIdsAsync()} . - * - * @example samples/V1/DatastoreClient/allocate_ids.php - * - * @param AllocateIdsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return AllocateIdsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function allocateIds(AllocateIdsRequest $request, array $callOptions = []): AllocateIdsResponse - { - return $this->startApiCall('AllocateIds', $request, $callOptions)->wait(); - } - - /** - * Begins a new transaction. - * - * The async variant is {@see DatastoreClient::beginTransactionAsync()} . - * - * @example samples/V1/DatastoreClient/begin_transaction.php - * - * @param BeginTransactionRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return BeginTransactionResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function beginTransaction(BeginTransactionRequest $request, array $callOptions = []): BeginTransactionResponse - { - return $this->startApiCall('BeginTransaction', $request, $callOptions)->wait(); - } - - /** - * Commits a transaction, optionally creating, deleting or modifying some - * entities. - * - * The async variant is {@see DatastoreClient::commitAsync()} . - * - * @example samples/V1/DatastoreClient/commit.php - * - * @param CommitRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return CommitResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function commit(CommitRequest $request, array $callOptions = []): CommitResponse - { - return $this->startApiCall('Commit', $request, $callOptions)->wait(); - } - - /** - * Looks up entities by key. - * - * The async variant is {@see DatastoreClient::lookupAsync()} . - * - * @example samples/V1/DatastoreClient/lookup.php - * - * @param LookupRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return LookupResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function lookup(LookupRequest $request, array $callOptions = []): LookupResponse - { - return $this->startApiCall('Lookup', $request, $callOptions)->wait(); - } - - /** - * Prevents the supplied keys' IDs from being auto-allocated by Cloud - * Datastore. - * - * The async variant is {@see DatastoreClient::reserveIdsAsync()} . - * - * @example samples/V1/DatastoreClient/reserve_ids.php - * - * @param ReserveIdsRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return ReserveIdsResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function reserveIds(ReserveIdsRequest $request, array $callOptions = []): ReserveIdsResponse - { - return $this->startApiCall('ReserveIds', $request, $callOptions)->wait(); - } - - /** - * Rolls back a transaction. - * - * The async variant is {@see DatastoreClient::rollbackAsync()} . - * - * @example samples/V1/DatastoreClient/rollback.php - * - * @param RollbackRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return RollbackResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function rollback(RollbackRequest $request, array $callOptions = []): RollbackResponse - { - return $this->startApiCall('Rollback', $request, $callOptions)->wait(); - } - - /** - * Runs an aggregation query. - * - * The async variant is {@see DatastoreClient::runAggregationQueryAsync()} . - * - * @example samples/V1/DatastoreClient/run_aggregation_query.php - * - * @param RunAggregationQueryRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return RunAggregationQueryResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function runAggregationQuery(RunAggregationQueryRequest $request, array $callOptions = []): RunAggregationQueryResponse - { - return $this->startApiCall('RunAggregationQuery', $request, $callOptions)->wait(); - } - - /** - * Queries for entities. - * - * The async variant is {@see DatastoreClient::runQueryAsync()} . - * - * @example samples/V1/DatastoreClient/run_query.php - * - * @param RunQueryRequest $request A request to house fields associated with the call. - * @param array $callOptions { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return RunQueryResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function runQuery(RunQueryRequest $request, array $callOptions = []): RunQueryResponse - { - return $this->startApiCall('RunQuery', $request, $callOptions)->wait(); - } -} diff --git a/owl-bot-staging/Datastore/v1/src/V1/DatastoreClient.php b/owl-bot-staging/Datastore/v1/src/V1/DatastoreClient.php deleted file mode 100644 index 5e5ff92d748a..000000000000 --- a/owl-bot-staging/Datastore/v1/src/V1/DatastoreClient.php +++ /dev/null @@ -1,34 +0,0 @@ -allocateIds($projectId, $keys); - * } finally { - * $datastoreClient->close(); - * } - * ``` - * - * @deprecated Please use the new service client {@see \Google\Cloud\Datastore\V1\Client\DatastoreClient}. - */ -class DatastoreGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.datastore.v1.Datastore'; - - /** - * The default address of the service. - * - * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. - */ - const SERVICE_ADDRESS = 'datastore.googleapis.com'; - - /** The address template of the service. */ - private const SERVICE_ADDRESS_TEMPLATE = 'datastore.UNIVERSE_DOMAIN'; - - /** The default port of the service. */ - const DEFAULT_SERVICE_PORT = 443; - - /** The name of the code generator, to be included in the agent header. */ - const CODEGEN_NAME = 'gapic'; - - /** The default scopes required by the service. */ - public static $serviceScopes = [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/datastore', - ]; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/datastore_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/datastore_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/datastore_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/datastore_rest_client_config.php', - ], - ], - ]; - } - - /** - * Constructor. - * - * @param array $options { - * Optional. Options for configuring the service API wrapper. - * - * @type string $apiEndpoint - * The address of the API remote host. May optionally include the port, formatted - * as ":". Default 'datastore.googleapis.com:443'. - * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials - * The credentials to be used by the client to authorize API calls. This option - * accepts either a path to a credentials file, or a decoded credentials file as a - * PHP array. - * *Advanced usage*: In addition, this option can also accept a pre-constructed - * {@see \Google\Auth\FetchAuthTokenInterface} object or - * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these - * objects are provided, any settings in $credentialsConfig will be ignored. - * @type array $credentialsConfig - * Options used to configure credentials, including auth token caching, for the - * client. For a full list of supporting configuration options, see - * {@see \Google\ApiCore\CredentialsWrapper::build()} . - * @type bool $disableRetries - * Determines whether or not retries defined by the client configuration should be - * disabled. Defaults to `false`. - * @type string|array $clientConfig - * Client method configuration, including retry settings. This option can be either - * a path to a JSON file, or a PHP array containing the decoded JSON data. By - * default this settings points to the default client config file, which is - * provided in the resources folder. - * @type string|TransportInterface $transport - * The transport used for executing network requests. May be either the string - * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. - * *Advanced usage*: Additionally, it is possible to pass in an already - * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note - * that when this object is provided, any settings in $transportConfig, and any - * $apiEndpoint setting, will be ignored. - * @type array $transportConfig - * Configuration options that will be used to construct the transport. Options for - * each supported transport type should be passed in a key for that transport. For - * example: - * $transportConfig = [ - * 'grpc' => [...], - * 'rest' => [...], - * ]; - * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and - * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the - * supported options. - * @type callable $clientCertSource - * A callable which returns the client cert as a string. This can be used to - * provide a certificate and private key to the transport layer for mTLS. - * } - * - * @throws ValidationException - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Allocates IDs for the given keys, which is useful for referencing an entity - * before it is inserted. - * - * Sample code: - * ``` - * $datastoreClient = new DatastoreClient(); - * try { - * $projectId = 'project_id'; - * $keys = []; - * $response = $datastoreClient->allocateIds($projectId, $keys); - * } finally { - * $datastoreClient->close(); - * } - * ``` - * - * @param string $projectId Required. The ID of the project against which to make the request. - * @param Key[] $keys Required. A list of keys with incomplete key paths for which to allocate - * IDs. No key may be reserved/read-only. - * @param array $optionalArgs { - * Optional. - * - * @type string $databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Datastore\V1\AllocateIdsResponse - * - * @throws ApiException if the remote call fails - */ - public function allocateIds($projectId, $keys, array $optionalArgs = []) - { - $request = new AllocateIdsRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setKeys($keys); - $requestParamHeaders['project_id'] = $projectId; - if (isset($optionalArgs['databaseId'])) { - $request->setDatabaseId($optionalArgs['databaseId']); - $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('AllocateIds', AllocateIdsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Begins a new transaction. - * - * Sample code: - * ``` - * $datastoreClient = new DatastoreClient(); - * try { - * $projectId = 'project_id'; - * $response = $datastoreClient->beginTransaction($projectId); - * } finally { - * $datastoreClient->close(); - * } - * ``` - * - * @param string $projectId Required. The ID of the project against which to make the request. - * @param array $optionalArgs { - * Optional. - * - * @type string $databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type TransactionOptions $transactionOptions - * Options for a new transaction. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Datastore\V1\BeginTransactionResponse - * - * @throws ApiException if the remote call fails - */ - public function beginTransaction($projectId, array $optionalArgs = []) - { - $request = new BeginTransactionRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $requestParamHeaders['project_id'] = $projectId; - if (isset($optionalArgs['databaseId'])) { - $request->setDatabaseId($optionalArgs['databaseId']); - $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; - } - - if (isset($optionalArgs['transactionOptions'])) { - $request->setTransactionOptions($optionalArgs['transactionOptions']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('BeginTransaction', BeginTransactionResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Commits a transaction, optionally creating, deleting or modifying some - * entities. - * - * Sample code: - * ``` - * $datastoreClient = new DatastoreClient(); - * try { - * $projectId = 'project_id'; - * $mode = Mode::MODE_UNSPECIFIED; - * $mutations = []; - * $response = $datastoreClient->commit($projectId, $mode, $mutations); - * } finally { - * $datastoreClient->close(); - * } - * ``` - * - * @param string $projectId Required. The ID of the project against which to make the request. - * @param int $mode The type of commit to perform. Defaults to `TRANSACTIONAL`. - * For allowed values, use constants defined on {@see \Google\Cloud\Datastore\V1\CommitRequest\Mode} - * @param Mutation[] $mutations The mutations to perform. - * - * When mode is `TRANSACTIONAL`, mutations affecting a single entity are - * applied in order. The following sequences of mutations affecting a single - * entity are not permitted in a single `Commit` request: - * - * - `insert` followed by `insert` - * - `update` followed by `insert` - * - `upsert` followed by `insert` - * - `delete` followed by `update` - * - * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - * entity. - * @param array $optionalArgs { - * Optional. - * - * @type string $databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type string $transaction - * The identifier of the transaction associated with the commit. A - * transaction identifier is returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * @type TransactionOptions $singleUseTransaction - * Options for beginning a new transaction for this request. - * The transaction is committed when the request completes. If specified, - * [TransactionOptions.mode][google.datastore.v1.TransactionOptions] must be - * [TransactionOptions.ReadWrite][google.datastore.v1.TransactionOptions.ReadWrite]. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Datastore\V1\CommitResponse - * - * @throws ApiException if the remote call fails - */ - public function commit($projectId, $mode, $mutations, array $optionalArgs = []) - { - $request = new CommitRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setMode($mode); - $request->setMutations($mutations); - $requestParamHeaders['project_id'] = $projectId; - if (isset($optionalArgs['databaseId'])) { - $request->setDatabaseId($optionalArgs['databaseId']); - $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; - } - - if (isset($optionalArgs['transaction'])) { - $request->setTransaction($optionalArgs['transaction']); - } - - if (isset($optionalArgs['singleUseTransaction'])) { - $request->setSingleUseTransaction($optionalArgs['singleUseTransaction']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('Commit', CommitResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Looks up entities by key. - * - * Sample code: - * ``` - * $datastoreClient = new DatastoreClient(); - * try { - * $projectId = 'project_id'; - * $keys = []; - * $response = $datastoreClient->lookup($projectId, $keys); - * } finally { - * $datastoreClient->close(); - * } - * ``` - * - * @param string $projectId Required. The ID of the project against which to make the request. - * @param Key[] $keys Required. Keys of entities to look up. - * @param array $optionalArgs { - * Optional. - * - * @type string $databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type ReadOptions $readOptions - * The options for this lookup request. - * @type PropertyMask $propertyMask - * The properties to return. Defaults to returning all properties. - * - * If this field is set and an entity has a property not referenced in the - * mask, it will be absent from [LookupResponse.found.entity.properties][]. - * - * The entity's key is always returned. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Datastore\V1\LookupResponse - * - * @throws ApiException if the remote call fails - */ - public function lookup($projectId, $keys, array $optionalArgs = []) - { - $request = new LookupRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setKeys($keys); - $requestParamHeaders['project_id'] = $projectId; - if (isset($optionalArgs['databaseId'])) { - $request->setDatabaseId($optionalArgs['databaseId']); - $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; - } - - if (isset($optionalArgs['readOptions'])) { - $request->setReadOptions($optionalArgs['readOptions']); - } - - if (isset($optionalArgs['propertyMask'])) { - $request->setPropertyMask($optionalArgs['propertyMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('Lookup', LookupResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Prevents the supplied keys' IDs from being auto-allocated by Cloud - * Datastore. - * - * Sample code: - * ``` - * $datastoreClient = new DatastoreClient(); - * try { - * $projectId = 'project_id'; - * $keys = []; - * $response = $datastoreClient->reserveIds($projectId, $keys); - * } finally { - * $datastoreClient->close(); - * } - * ``` - * - * @param string $projectId Required. The ID of the project against which to make the request. - * @param Key[] $keys Required. A list of keys with complete key paths whose numeric IDs should - * not be auto-allocated. - * @param array $optionalArgs { - * Optional. - * - * @type string $databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Datastore\V1\ReserveIdsResponse - * - * @throws ApiException if the remote call fails - */ - public function reserveIds($projectId, $keys, array $optionalArgs = []) - { - $request = new ReserveIdsRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setKeys($keys); - $requestParamHeaders['project_id'] = $projectId; - if (isset($optionalArgs['databaseId'])) { - $request->setDatabaseId($optionalArgs['databaseId']); - $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('ReserveIds', ReserveIdsResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Rolls back a transaction. - * - * Sample code: - * ``` - * $datastoreClient = new DatastoreClient(); - * try { - * $projectId = 'project_id'; - * $transaction = '...'; - * $response = $datastoreClient->rollback($projectId, $transaction); - * } finally { - * $datastoreClient->close(); - * } - * ``` - * - * @param string $projectId Required. The ID of the project against which to make the request. - * @param string $transaction Required. The transaction identifier, returned by a call to - * [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - * @param array $optionalArgs { - * Optional. - * - * @type string $databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Datastore\V1\RollbackResponse - * - * @throws ApiException if the remote call fails - */ - public function rollback($projectId, $transaction, array $optionalArgs = []) - { - $request = new RollbackRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setTransaction($transaction); - $requestParamHeaders['project_id'] = $projectId; - if (isset($optionalArgs['databaseId'])) { - $request->setDatabaseId($optionalArgs['databaseId']); - $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('Rollback', RollbackResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Runs an aggregation query. - * - * Sample code: - * ``` - * $datastoreClient = new DatastoreClient(); - * try { - * $projectId = 'project_id'; - * $response = $datastoreClient->runAggregationQuery($projectId); - * } finally { - * $datastoreClient->close(); - * } - * ``` - * - * @param string $projectId Required. The ID of the project against which to make the request. - * @param array $optionalArgs { - * Optional. - * - * @type string $databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type PartitionId $partitionId - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * @type ReadOptions $readOptions - * The options for this query. - * @type AggregationQuery $aggregationQuery - * The query to run. - * @type GqlQuery $gqlQuery - * The GQL query to run. This query must be an aggregation query. - * @type ExplainOptions $explainOptions - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Datastore\V1\RunAggregationQueryResponse - * - * @throws ApiException if the remote call fails - */ - public function runAggregationQuery($projectId, array $optionalArgs = []) - { - $request = new RunAggregationQueryRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $requestParamHeaders['project_id'] = $projectId; - if (isset($optionalArgs['databaseId'])) { - $request->setDatabaseId($optionalArgs['databaseId']); - $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; - } - - if (isset($optionalArgs['partitionId'])) { - $request->setPartitionId($optionalArgs['partitionId']); - } - - if (isset($optionalArgs['readOptions'])) { - $request->setReadOptions($optionalArgs['readOptions']); - } - - if (isset($optionalArgs['aggregationQuery'])) { - $request->setAggregationQuery($optionalArgs['aggregationQuery']); - } - - if (isset($optionalArgs['gqlQuery'])) { - $request->setGqlQuery($optionalArgs['gqlQuery']); - } - - if (isset($optionalArgs['explainOptions'])) { - $request->setExplainOptions($optionalArgs['explainOptions']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RunAggregationQuery', RunAggregationQueryResponse::class, $optionalArgs, $request)->wait(); - } - - /** - * Queries for entities. - * - * Sample code: - * ``` - * $datastoreClient = new DatastoreClient(); - * try { - * $projectId = 'project_id'; - * $partitionId = new PartitionId(); - * $response = $datastoreClient->runQuery($projectId, $partitionId); - * } finally { - * $datastoreClient->close(); - * } - * ``` - * - * @param string $projectId Required. The ID of the project against which to make the request. - * @param PartitionId $partitionId Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * @param array $optionalArgs { - * Optional. - * - * @type string $databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @type ReadOptions $readOptions - * The options for this query. - * @type Query $query - * The query to run. - * @type GqlQuery $gqlQuery - * The GQL query to run. This query must be a non-aggregation query. - * @type PropertyMask $propertyMask - * The properties to return. - * This field must not be set for a projection query. - * - * See - * [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. - * @type ExplainOptions $explainOptions - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Datastore\V1\RunQueryResponse - * - * @throws ApiException if the remote call fails - */ - public function runQuery($projectId, $partitionId, array $optionalArgs = []) - { - $request = new RunQueryRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setPartitionId($partitionId); - $requestParamHeaders['project_id'] = $projectId; - if (isset($optionalArgs['databaseId'])) { - $request->setDatabaseId($optionalArgs['databaseId']); - $requestParamHeaders['database_id'] = $optionalArgs['databaseId']; - } - - if (isset($optionalArgs['readOptions'])) { - $request->setReadOptions($optionalArgs['readOptions']); - } - - if (isset($optionalArgs['query'])) { - $request->setQuery($optionalArgs['query']); - } - - if (isset($optionalArgs['gqlQuery'])) { - $request->setGqlQuery($optionalArgs['gqlQuery']); - } - - if (isset($optionalArgs['propertyMask'])) { - $request->setPropertyMask($optionalArgs['propertyMask']); - } - - if (isset($optionalArgs['explainOptions'])) { - $request->setExplainOptions($optionalArgs['explainOptions']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('RunQuery', RunQueryResponse::class, $optionalArgs, $request)->wait(); - } -} diff --git a/owl-bot-staging/Datastore/v1/src/V1/gapic_metadata.json b/owl-bot-staging/Datastore/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 7cfff6525f13..000000000000 --- a/owl-bot-staging/Datastore/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.datastore.v1", - "libraryPackage": "Google\\Cloud\\Datastore\\V1", - "services": { - "Datastore": { - "clients": { - "grpc": { - "libraryClient": "DatastoreGapicClient", - "rpcs": { - "AllocateIds": { - "methods": [ - "allocateIds" - ] - }, - "BeginTransaction": { - "methods": [ - "beginTransaction" - ] - }, - "Commit": { - "methods": [ - "commit" - ] - }, - "Lookup": { - "methods": [ - "lookup" - ] - }, - "ReserveIds": { - "methods": [ - "reserveIds" - ] - }, - "Rollback": { - "methods": [ - "rollback" - ] - }, - "RunAggregationQuery": { - "methods": [ - "runAggregationQuery" - ] - }, - "RunQuery": { - "methods": [ - "runQuery" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_client_config.json b/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_client_config.json deleted file mode 100644 index 081d5f9f6b62..000000000000 --- a/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_client_config.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "interfaces": { - "google.datastore.v1.Datastore": { - "retry_codes": { - "no_retry_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ], - "no_retry_1_codes": [], - "no_retry_2_codes": [] - }, - "retry_params": { - "no_retry_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - }, - "retry_policy_1_params": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_1_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000 - }, - "no_retry_2_params": { - "initial_retry_delay_millis": 0, - "retry_delay_multiplier": 0.0, - "max_retry_delay_millis": 0, - "initial_rpc_timeout_millis": 0, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 0, - "total_timeout_millis": 0 - } - }, - "methods": { - "AllocateIds": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "BeginTransaction": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "Commit": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "Lookup": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ReserveIds": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "Rollback": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "RunAggregationQuery": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "RunQuery": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_descriptor_config.php b/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_descriptor_config.php deleted file mode 100644 index 533cf81dbb42..000000000000 --- a/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_descriptor_config.php +++ /dev/null @@ -1,172 +0,0 @@ - [ - 'google.datastore.v1.Datastore' => [ - 'AllocateIds' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Datastore\V1\AllocateIdsResponse', - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - [ - 'keyName' => 'database_id', - 'fieldAccessors' => [ - 'getDatabaseId', - ], - ], - ], - ], - 'BeginTransaction' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Datastore\V1\BeginTransactionResponse', - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - [ - 'keyName' => 'database_id', - 'fieldAccessors' => [ - 'getDatabaseId', - ], - ], - ], - ], - 'Commit' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Datastore\V1\CommitResponse', - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - [ - 'keyName' => 'database_id', - 'fieldAccessors' => [ - 'getDatabaseId', - ], - ], - ], - ], - 'Lookup' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Datastore\V1\LookupResponse', - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - [ - 'keyName' => 'database_id', - 'fieldAccessors' => [ - 'getDatabaseId', - ], - ], - ], - ], - 'ReserveIds' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Datastore\V1\ReserveIdsResponse', - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - [ - 'keyName' => 'database_id', - 'fieldAccessors' => [ - 'getDatabaseId', - ], - ], - ], - ], - 'Rollback' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Datastore\V1\RollbackResponse', - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - [ - 'keyName' => 'database_id', - 'fieldAccessors' => [ - 'getDatabaseId', - ], - ], - ], - ], - 'RunAggregationQuery' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Datastore\V1\RunAggregationQueryResponse', - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - [ - 'keyName' => 'database_id', - 'fieldAccessors' => [ - 'getDatabaseId', - ], - ], - ], - ], - 'RunQuery' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Datastore\V1\RunQueryResponse', - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - [ - 'keyName' => 'database_id', - 'fieldAccessors' => [ - 'getDatabaseId', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_rest_client_config.php b/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_rest_client_config.php deleted file mode 100644 index b3e9cc385e70..000000000000 --- a/owl-bot-staging/Datastore/v1/src/V1/resources/datastore_rest_client_config.php +++ /dev/null @@ -1,171 +0,0 @@ - [ - 'google.datastore.v1.Datastore' => [ - 'AllocateIds' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}:allocateIds', - 'body' => '*', - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'BeginTransaction' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}:beginTransaction', - 'body' => '*', - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'Commit' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}:commit', - 'body' => '*', - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'Lookup' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}:lookup', - 'body' => '*', - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'ReserveIds' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}:reserveIds', - 'body' => '*', - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'Rollback' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}:rollback', - 'body' => '*', - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'RunAggregationQuery' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}:runAggregationQuery', - 'body' => '*', - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'RunQuery' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}:runQuery', - 'body' => '*', - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - ], - 'google.longrunning.Operations' => [ - 'CancelOperation' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/{name=projects/*/operations/*}:cancel', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'DeleteOperation' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/{name=projects/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'GetOperation' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*/operations/*}', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - 'ListOperations' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{name=projects/*}/operations', - 'placeholders' => [ - 'name' => [ - 'getters' => [ - 'getName', - ], - ], - ], - ], - ], - ], - 'numericEnums' => true, -]; diff --git a/owl-bot-staging/Datastore/v1/tests/Unit/V1/Client/DatastoreClientTest.php b/owl-bot-staging/Datastore/v1/tests/Unit/V1/Client/DatastoreClientTest.php deleted file mode 100644 index 57ffe283b6f1..000000000000 --- a/owl-bot-staging/Datastore/v1/tests/Unit/V1/Client/DatastoreClientTest.php +++ /dev/null @@ -1,657 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DatastoreClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DatastoreClient($options); - } - - /** @test */ - public function allocateIdsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AllocateIdsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - $request = (new AllocateIdsRequest()) - ->setProjectId($projectId) - ->setKeys($keys); - $response = $gapicClient->allocateIds($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/AllocateIds', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getKeys(); - $this->assertProtobufEquals($keys, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function allocateIdsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - $request = (new AllocateIdsRequest()) - ->setProjectId($projectId) - ->setKeys($keys); - try { - $gapicClient->allocateIds($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function beginTransactionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction = '-34'; - $expectedResponse = new BeginTransactionResponse(); - $expectedResponse->setTransaction($transaction); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $request = (new BeginTransactionRequest()) - ->setProjectId($projectId); - $response = $gapicClient->beginTransaction($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/BeginTransaction', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function beginTransactionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $request = (new BeginTransactionRequest()) - ->setProjectId($projectId); - try { - $gapicClient->beginTransaction($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $indexUpdates = 1425228195; - $expectedResponse = new CommitResponse(); - $expectedResponse->setIndexUpdates($indexUpdates); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $mode = Mode::MODE_UNSPECIFIED; - $mutations = []; - $request = (new CommitRequest()) - ->setProjectId($projectId) - ->setMode($mode) - ->setMutations($mutations); - $response = $gapicClient->commit($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/Commit', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getMode(); - $this->assertProtobufEquals($mode, $actualValue); - $actualValue = $actualRequestObject->getMutations(); - $this->assertProtobufEquals($mutations, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $mode = Mode::MODE_UNSPECIFIED; - $mutations = []; - $request = (new CommitRequest()) - ->setProjectId($projectId) - ->setMode($mode) - ->setMutations($mutations); - try { - $gapicClient->commit($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function lookupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction = '-34'; - $expectedResponse = new LookupResponse(); - $expectedResponse->setTransaction($transaction); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - $request = (new LookupRequest()) - ->setProjectId($projectId) - ->setKeys($keys); - $response = $gapicClient->lookup($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/Lookup', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getKeys(); - $this->assertProtobufEquals($keys, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function lookupExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - $request = (new LookupRequest()) - ->setProjectId($projectId) - ->setKeys($keys); - try { - $gapicClient->lookup($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function reserveIdsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReserveIdsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - $request = (new ReserveIdsRequest()) - ->setProjectId($projectId) - ->setKeys($keys); - $response = $gapicClient->reserveIds($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/ReserveIds', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getKeys(); - $this->assertProtobufEquals($keys, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function reserveIdsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - $request = (new ReserveIdsRequest()) - ->setProjectId($projectId) - ->setKeys($keys); - try { - $gapicClient->reserveIds($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rollbackTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new RollbackResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $transaction = '-34'; - $request = (new RollbackRequest()) - ->setProjectId($projectId) - ->setTransaction($transaction); - $response = $gapicClient->rollback($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/Rollback', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getTransaction(); - $this->assertProtobufEquals($transaction, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rollbackExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $transaction = '-34'; - $request = (new RollbackRequest()) - ->setProjectId($projectId) - ->setTransaction($transaction); - try { - $gapicClient->rollback($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runAggregationQueryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction = '-34'; - $expectedResponse = new RunAggregationQueryResponse(); - $expectedResponse->setTransaction($transaction); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $request = (new RunAggregationQueryRequest()) - ->setProjectId($projectId); - $response = $gapicClient->runAggregationQuery($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/RunAggregationQuery', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runAggregationQueryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $request = (new RunAggregationQueryRequest()) - ->setProjectId($projectId); - try { - $gapicClient->runAggregationQuery($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runQueryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction = '-34'; - $expectedResponse = new RunQueryResponse(); - $expectedResponse->setTransaction($transaction); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $partitionId = new PartitionId(); - $request = (new RunQueryRequest()) - ->setProjectId($projectId) - ->setPartitionId($partitionId); - $response = $gapicClient->runQuery($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/RunQuery', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getPartitionId(); - $this->assertProtobufEquals($partitionId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runQueryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $partitionId = new PartitionId(); - $request = (new RunQueryRequest()) - ->setProjectId($projectId) - ->setPartitionId($partitionId); - try { - $gapicClient->runQuery($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function allocateIdsAsyncTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AllocateIdsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - $request = (new AllocateIdsRequest()) - ->setProjectId($projectId) - ->setKeys($keys); - $response = $gapicClient->allocateIdsAsync($request)->wait(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/AllocateIds', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getKeys(); - $this->assertProtobufEquals($keys, $actualValue); - $this->assertTrue($transport->isExhausted()); - } -} diff --git a/owl-bot-staging/Datastore/v1/tests/Unit/V1/DatastoreClientTest.php b/owl-bot-staging/Datastore/v1/tests/Unit/V1/DatastoreClientTest.php deleted file mode 100644 index fa2f88b51f95..000000000000 --- a/owl-bot-staging/Datastore/v1/tests/Unit/V1/DatastoreClientTest.php +++ /dev/null @@ -1,572 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DatastoreClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DatastoreClient($options); - } - - /** @test */ - public function allocateIdsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new AllocateIdsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - $response = $gapicClient->allocateIds($projectId, $keys); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/AllocateIds', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getKeys(); - $this->assertProtobufEquals($keys, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function allocateIdsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - try { - $gapicClient->allocateIds($projectId, $keys); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function beginTransactionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction = '-34'; - $expectedResponse = new BeginTransactionResponse(); - $expectedResponse->setTransaction($transaction); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $response = $gapicClient->beginTransaction($projectId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/BeginTransaction', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function beginTransactionExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - try { - $gapicClient->beginTransaction($projectId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $indexUpdates = 1425228195; - $expectedResponse = new CommitResponse(); - $expectedResponse->setIndexUpdates($indexUpdates); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $mode = Mode::MODE_UNSPECIFIED; - $mutations = []; - $response = $gapicClient->commit($projectId, $mode, $mutations); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/Commit', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getMode(); - $this->assertProtobufEquals($mode, $actualValue); - $actualValue = $actualRequestObject->getMutations(); - $this->assertProtobufEquals($mutations, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function commitExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $mode = Mode::MODE_UNSPECIFIED; - $mutations = []; - try { - $gapicClient->commit($projectId, $mode, $mutations); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function lookupTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction = '-34'; - $expectedResponse = new LookupResponse(); - $expectedResponse->setTransaction($transaction); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - $response = $gapicClient->lookup($projectId, $keys); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/Lookup', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getKeys(); - $this->assertProtobufEquals($keys, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function lookupExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - try { - $gapicClient->lookup($projectId, $keys); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function reserveIdsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new ReserveIdsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - $response = $gapicClient->reserveIds($projectId, $keys); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/ReserveIds', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getKeys(); - $this->assertProtobufEquals($keys, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function reserveIdsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $keys = []; - try { - $gapicClient->reserveIds($projectId, $keys); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rollbackTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new RollbackResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $transaction = '-34'; - $response = $gapicClient->rollback($projectId, $transaction); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/Rollback', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getTransaction(); - $this->assertProtobufEquals($transaction, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function rollbackExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $transaction = '-34'; - try { - $gapicClient->rollback($projectId, $transaction); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runAggregationQueryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction = '-34'; - $expectedResponse = new RunAggregationQueryResponse(); - $expectedResponse->setTransaction($transaction); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $response = $gapicClient->runAggregationQuery($projectId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/RunAggregationQuery', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runAggregationQueryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - try { - $gapicClient->runAggregationQuery($projectId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runQueryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $transaction = '-34'; - $expectedResponse = new RunQueryResponse(); - $expectedResponse->setTransaction($transaction); - $transport->addResponse($expectedResponse); - // Mock request - $projectId = 'projectId-1969970175'; - $partitionId = new PartitionId(); - $response = $gapicClient->runQuery($projectId, $partitionId); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.v1.Datastore/RunQuery', $actualFuncCall); - $actualValue = $actualRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualRequestObject->getPartitionId(); - $this->assertProtobufEquals($partitionId, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function runQueryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $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); - $transport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $partitionId = new PartitionId(); - try { - $gapicClient->runQuery($projectId, $partitionId); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}