From c8e16dbe2498a66602b68cd4cf46d1d82828b8e0 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 28 Jul 2023 13:58:16 +0000 Subject: [PATCH 1/2] docs: Specify limit for `properties` in `Index` message in Datastore Admin API docs: Minor formatting in Datastore Admin API PiperOrigin-RevId: 551819875 Source-Link: https://github.com/googleapis/googleapis/commit/3db8b015f79d0d2b495c40ad6f0320e9d88c5275 Source-Link: https://github.com/googleapis/googleapis-gen/commit/7ebf1137639b93613e6a6206654a5ba8f21e9321 Copy-Tag: eyJwIjoiRGF0YXN0b3JlQWRtaW4vLk93bEJvdC55YW1sIiwiaCI6IjdlYmYxMTM3NjM5YjkzNjEzZTZhNjIwNjY1NGE1YmE4ZjIxZTkzMjEifQ== --- .../Datastore/Admin/V1/DatastoreAdmin.php | Bin 0 -> 5468 bytes .../Google/Datastore/Admin/V1/Index.php | Bin 0 -> 1509 bytes .../Google/Datastore/Admin/V1/Migration.php | Bin 0 -> 1926 bytes .../Datastore/Admin/V1/CommonMetadata.php | 231 ++++++ .../Admin/V1/CommonMetadata/State.php | 101 +++ .../Datastore/Admin/V1/CreateIndexRequest.php | 116 +++ .../DatastoreFirestoreMigrationMetadata.php | 114 +++ .../Datastore/Admin/V1/DeleteIndexRequest.php | 102 +++ .../Cloud/Datastore/Admin/V1/EntityFilter.php | 134 +++ .../Admin/V1/ExportEntitiesMetadata.php | 259 ++++++ .../Admin/V1/ExportEntitiesRequest.php | 272 +++++++ .../Admin/V1/ExportEntitiesResponse.php | 80 ++ .../Datastore/Admin/V1/GetIndexRequest.php | 102 +++ .../Admin/V1/ImportEntitiesMetadata.php | 255 ++++++ .../Admin/V1/ImportEntitiesRequest.php | 275 +++++++ .../Google/Cloud/Datastore/Admin/V1/Index.php | 249 ++++++ .../Datastore/Admin/V1/Index/AncestorMode.php | 65 ++ .../Datastore/Admin/V1/Index/Direction.php | 66 ++ .../Admin/V1/Index/IndexedProperty.php | 108 +++ .../Cloud/Datastore/Admin/V1/Index/State.php | 91 +++ .../Admin/V1/IndexOperationMetadata.php | 155 ++++ .../Datastore/Admin/V1/ListIndexesRequest.php | 167 ++++ .../Admin/V1/ListIndexesResponse.php | 102 +++ .../Admin/V1/MigrationProgressEvent.php | 152 ++++ .../ConcurrencyMode.php | 71 ++ .../PrepareStepDetails.php | 74 ++ .../RedirectWritesStepDetails.php | 70 ++ .../Datastore/Admin/V1/MigrationState.php | 68 ++ .../Admin/V1/MigrationStateEvent.php | 69 ++ .../Datastore/Admin/V1/MigrationStep.php | 97 +++ .../Datastore/Admin/V1/OperationType.php | 75 ++ .../Cloud/Datastore/Admin/V1/Progress.php | 109 +++ .../V1/DatastoreAdminClient/create_index.php | 82 ++ .../V1/DatastoreAdminClient/delete_index.php | 79 ++ .../DatastoreAdminClient/export_entities.php | 109 +++ .../V1/DatastoreAdminClient/get_index.php | 57 ++ .../DatastoreAdminClient/import_entities.php | 99 +++ .../V1/DatastoreAdminClient/list_indexes.php | 64 ++ .../BaseClient/DatastoreAdminBaseClient.php | 449 ++++++++++ .../v1/src/V1/Client/DatastoreAdminClient.php | 40 + .../v1/src/V1/DatastoreAdminClient.php | 34 + .../V1/Gapic/DatastoreAdminGapicClient.php | 769 ++++++++++++++++++ .../v1/src/V1/gapic_metadata.json | 48 ++ .../datastore_admin_client_config.json | 75 ++ .../datastore_admin_descriptor_config.php | 128 +++ .../datastore_admin_rest_client_config.php | 134 +++ .../V1/Client/DatastoreAdminClientTest.php | 757 +++++++++++++++++ .../Unit/V1/DatastoreAdminClientTest.php | 666 +++++++++++++++ 48 files changed, 7419 insertions(+) create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/DatastoreAdmin.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/Index.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/Migration.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CommonMetadata.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CommonMetadata/State.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CreateIndexRequest.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DatastoreFirestoreMigrationMetadata.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DeleteIndexRequest.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/EntityFilter.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesMetadata.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesRequest.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesResponse.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/GetIndexRequest.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesMetadata.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesRequest.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/AncestorMode.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/Direction.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/IndexedProperty.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/State.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/IndexOperationMetadata.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesRequest.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesResponse.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/ConcurrencyMode.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/PrepareStepDetails.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/RedirectWritesStepDetails.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationState.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStateEvent.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStep.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/OperationType.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Progress.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/create_index.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/delete_index.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/export_entities.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/get_index.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/import_entities.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/list_indexes.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/BaseClient/DatastoreAdminBaseClient.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/DatastoreAdminClient.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/DatastoreAdminClient.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/Gapic/DatastoreAdminGapicClient.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_client_config.json create mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_descriptor_config.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_rest_client_config.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/Client/DatastoreAdminClientTest.php create mode 100644 owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/DatastoreAdminClientTest.php diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/DatastoreAdmin.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/DatastoreAdmin.php new file mode 100644 index 0000000000000000000000000000000000000000..b83cde9487af95457e7c98cd6a8742c835835524 GIT binary patch literal 5468 zcmeHLL2nyX5XN?$#xJdtY}Gc6)OK-NHHi{$6N;dlw&2*C$dc<=i5s<*rPaoMPL`~9 zm)++irpg7u0U94zn~XLgnxE(%h0Q$OEdz1Zt1S7n>x`oL;nDR zdMMU4!^L3YxNN;?R*7zzB2`#3t9W`w^lVbuTebxtJQM@JN)#8sq>?uYc1+Ev3$s%JMNMABx0j;_%x=(ZQtYm`luWYT%InuhIjx zjICEPrfE?WEYp?cc1&#(Cn;tP9h>BAIx9LhYRh;>+tV#)a8;f{o?XDRh7VrJ!ef0K zN*LlE+)BYRx1FYG>gIN3&88i2HrRMIly#_OqBZQ^?`Bmr|48?1CR3~N5?O(+n&wHR zDZYdLN+Ict?Ic|D6wA&x+&ksm5hTSIo$^JEHu93ik?-=05d}1xL;`p{fz%%{l+0R>2JP`w(1Kqoj51Pz_&O1Xm*B{E-*dCBu-0sgyNJx@I;)wUmD!X234D!M{wp`gSDsX#~ZYqHr0FZ&0bCf=3GsUb@DA4B^eO}2I1Nn3GdE-fz%C9^rjKu|n zhE_890$3jcj}pEvJf2UaFwXKXC<*5`y~?<3Or>|ma+$Z!0u_fD{~it zUUkw^>$(B6gH_PTV&zUht4skX0_24oXxwTNyGhihW2m-+>-qr{6Qqi{d)Cx`41nYt z{~91YO?Lot1toOT4~K!_!~O_$0Yzgx15jrLVh&yD&Yo+-^uz+xVjFRh*-PWWaBcC($J-j7x;a? zfX=fJplvALBa5fv14Cof#0NwTy@E~6)He|*c)A<$@&8{a_~S`>89`Hg4PVh=rqYi# zzC&}Tm(eKS;Z$$+pvzTqu^+o}Gv4k1+f&#Ewi&hc-=0DyuswT-E^<8CI&}k0u9cMa zOgX<+RLjpw-FwL;G^#u;t*w_;rC5gjMA?AV1P=3$I}f9DgUPNdbhF79bIMcLP~aq| z6cm1PZt)|8k{m4d*(v-PLCMasA>8fLRh^=Kt4>}IG(ziedv8pA5&7`PU%!mrPKoq0 z+HY!CdeLt0Lm9K3Mvlz>lv!w>&w0D%T*t;S*B)m6`f!xF+da+J;hUTdzpkOk3*vVO zypz%U2Hq(;VBnt&5V+2E7Z&);@xb|J(Fws(MnadnKMItFOnCPd@~KJo82l)66U7<9fXBUg=6mosMBaTp4#^GZ@h0;)Jv(=* z$I=VtIt+%x0lfY^f`)^!Al`J(a9e_dJ({Gr25$1u%xDMPC?0a)DdvJ|T37 zd;ON0VNOm7r&q${-ce?vU433T!^gdwhV}D@%+no0Y*&_~{r!F4hu}v^Ymyzf1F)L4 zdE3xP-Etapr-}17E&m)r*Wnc>2ey2vlO;>^wyYF+exJQE&;t{2z0tlF^lu8mNnkm4 zYhiCK`G3ES-dtrjg6S;vI?e5;84ag57mfmnN`;A3LU)J$^%C43{uZ6`?8q{cl4Wj5 rmYFG8-dxxk0wy8W8+Z7H%$#>87rMfuGf=PgxV~eO-Zk4HIz;GilV1v| literal 0 HcmV?d00001 diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/Index.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/Index.php new file mode 100644 index 0000000000000000000000000000000000000000..b0ddf381e8df6f69af67fa019b0a635fcf8b6486 GIT binary patch literal 1509 zcma)6T~E_c7=ke{Ar2Gb5m1Ja&f%3sG~HTA4Q$IcNizwD+n{X7uIy%5Uj%Y5DYzBacyeHG>CA;c29_3IjvTR z@8ZvjPz3Pp6C8)OgV8~&c7&u%B=8X@G<^q`w@{+Vu^VB)I^ILma$0-{ zYyg(&QylrWXX!Y0A`-IxS`4bHLrl}r@kn`Vl9tPn0V*dos_L~O_YjT7_;PlHB234T zzboqI0_W*J>mS3?LSpR`?71~OvQJ46sp>^n7b2pm?bl?|g66tu#rtfdO> zYDp4Vp5B^8pE5+1Yj0ux@)YD%SkW4Fqtk7+dq+*(=)G%nT1MU6Hx0dbN1lURquDTu z8CK7Nc6ivEf;&ZN&45CxF0a6{Znlkj*K9Vfh%7)s>(q^gZZ-~>(jtIvr0>#N3-V$V zZ23!_uGYO;!#vE@+lJOn*agV57yW%vlGz8{I5fnEtjs?aOAiy1QtCn?wJJqem2zDDF-2IG zfLNF8Y~p9k(Edp4iH@oYl&Ypmsw$*Z^|;!fVYh|`FE-QL`7H5^OZIZ3wFqQl0OxQH F@E2iu&aMCe literal 0 HcmV?d00001 diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/Migration.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/Migration.php new file mode 100644 index 0000000000000000000000000000000000000000..53596831cf26ce0da4d8498da618d631c07c1f87 GIT binary patch literal 1926 zcmcJQQE!`86vu0)N!ODuwdho}S-ak*(dtwimOE+c$g+t5anNEwfSq}>gfLvYNEqk^ zr|YJCn7!_!>;vp+Z+qLP*a2+fB#o3l%r6*p&hP)f=N_H&?f1#+1fG!&jVN<7>XXqs zlD(!RVR06FaY#n9@t88=#nU7RDdP!|b)xAuQDoJAim7QlV;&XAB#tK`ZTW8IrdiBr z%k`&0)H-RmrojZ+K^*Y~6(Dk_G)-KOl8&+8rJ0*24Lb#3C@%m*F$WC$?Ogybbkme{ z7a;fz2>z1UC=5K3W=QwQc91$j6l8%L2EXD-_Q==`Q;OM_W5=_|%N>zCL61Dz+#w}1 zkKImUJoz43STgcrU?GNTlu;JB;ZUZj$ASdUX<(=zOlVe>F#pornak$5U`(2&M?tt` za*t$eMwitIVKkeuXt(g415T@dg|jce3+6sV->+m3@Oqk6V4n6I{s!2&_PuZq%TT_$ zLcX{{{-nL7!@a8b7M7bTCp5~qSFoBNj6SH5T65#&4u2(qKcBw!`zqY8K4E<)jHYP` z{Tgnj8BONQ=Jl8~;e7ZcVKi|Wb@F`2$Hof6^g$iHt-qA7!#QV!H%gj?Fu7zM-r!Pr z#Hb%I>SfMb7GyL%ueMUC{qW&x=A3$5K+lP8z5(vC8SZCjcyZ*-7^9K*&Y8yk;v&Qk zmzT~+T?B3Z0uQfr^uH=^y@k6M%y0xANxCNWOjFUMfz#Dx#p!95p-Ae1s>qES++A2V z6w6Y(s%5KEqsDCj=!U&`uX9h~@!7j`tlEc;qS>lFa5|>mGpxqS{s!DxZk!iC!ba7i zMbmRn;M1Wu^ellNr$Gc={@Uc z(746j!(!^jz!5ds=_{ssFhDa+*fw!|n~G#RN*~M66ORyqCAP49`0kjBC}T;u&ta>I zv~1*d-WPW>m#N}PCymwpziRLp_r}$|xPMmPV#FG?pT6google.datastore.admin.v1.CommonMetadata + */ +class CommonMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The time that work began on the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + */ + protected $start_time = null; + /** + * The time the operation ended, either successfully or otherwise. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + */ + protected $end_time = null; + /** + * The type of the operation. Can be used as a filter in + * ListOperationsRequest. + * + * Generated from protobuf field .google.datastore.admin.v1.OperationType operation_type = 3; + */ + protected $operation_type = 0; + /** + * The client-assigned labels which were provided when the operation was + * created. May also include additional labels. + * + * Generated from protobuf field map labels = 4; + */ + private $labels; + /** + * The current state of the Operation. + * + * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata.State state = 5; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $start_time + * The time that work began on the operation. + * @type \Google\Protobuf\Timestamp $end_time + * The time the operation ended, either successfully or otherwise. + * @type int $operation_type + * The type of the operation. Can be used as a filter in + * ListOperationsRequest. + * @type array|\Google\Protobuf\Internal\MapField $labels + * The client-assigned labels which were provided when the operation was + * created. May also include additional labels. + * @type int $state + * The current state of the Operation. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The time that work began on the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * The time that work began on the operation. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * The time the operation ended, either successfully or otherwise. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * The time the operation ended, either successfully or otherwise. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * The type of the operation. Can be used as a filter in + * ListOperationsRequest. + * + * Generated from protobuf field .google.datastore.admin.v1.OperationType operation_type = 3; + * @return int + */ + public function getOperationType() + { + return $this->operation_type; + } + + /** + * The type of the operation. Can be used as a filter in + * ListOperationsRequest. + * + * Generated from protobuf field .google.datastore.admin.v1.OperationType operation_type = 3; + * @param int $var + * @return $this + */ + public function setOperationType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\OperationType::class); + $this->operation_type = $var; + + return $this; + } + + /** + * The client-assigned labels which were provided when the operation was + * created. May also include additional labels. + * + * Generated from protobuf field map labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * The client-assigned labels which were provided when the operation was + * created. May also include additional labels. + * + * Generated from protobuf field map labels = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * The current state of the Operation. + * + * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata.State state = 5; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The current state of the Operation. + * + * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata.State state = 5; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\CommonMetadata\State::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CommonMetadata/State.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CommonMetadata/State.php new file mode 100644 index 00000000000..d4285dea144 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CommonMetadata/State.php @@ -0,0 +1,101 @@ +google.datastore.admin.v1.CommonMetadata.State + */ +class State +{ + /** + * Unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Request is being prepared for processing. + * + * Generated from protobuf enum INITIALIZING = 1; + */ + const INITIALIZING = 1; + /** + * Request is actively being processed. + * + * Generated from protobuf enum PROCESSING = 2; + */ + const PROCESSING = 2; + /** + * Request is in the process of being cancelled after user called + * google.longrunning.Operations.CancelOperation on the operation. + * + * Generated from protobuf enum CANCELLING = 3; + */ + const CANCELLING = 3; + /** + * Request has been processed and is in its finalization stage. + * + * Generated from protobuf enum FINALIZING = 4; + */ + const FINALIZING = 4; + /** + * Request has completed successfully. + * + * Generated from protobuf enum SUCCESSFUL = 5; + */ + const SUCCESSFUL = 5; + /** + * Request has finished being processed, but encountered an error. + * + * Generated from protobuf enum FAILED = 6; + */ + const FAILED = 6; + /** + * Request has finished being cancelled after user called + * google.longrunning.Operations.CancelOperation. + * + * Generated from protobuf enum CANCELLED = 7; + */ + const CANCELLED = 7; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::INITIALIZING => 'INITIALIZING', + self::PROCESSING => 'PROCESSING', + self::CANCELLING => 'CANCELLING', + self::FINALIZING => 'FINALIZING', + self::SUCCESSFUL => 'SUCCESSFUL', + self::FAILED => 'FAILED', + self::CANCELLED => 'CANCELLED', + ]; + + 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(State::class, \Google\Cloud\Datastore\Admin\V1\CommonMetadata_State::class); + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CreateIndexRequest.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CreateIndexRequest.php new file mode 100644 index 00000000000..45f67c62b73 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CreateIndexRequest.php @@ -0,0 +1,116 @@ +google.datastore.admin.v1.CreateIndexRequest + */ +class CreateIndexRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1; + */ + protected $project_id = ''; + /** + * The index to create. The name and state fields are output only and will be + * ignored. Single property indexes cannot be created or deleted. + * + * Generated from protobuf field .google.datastore.admin.v1.Index index = 3; + */ + protected $index = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Project ID against which to make the request. + * @type \Google\Cloud\Datastore\Admin\V1\Index $index + * The index to create. The name and state fields are output only and will be + * ignored. Single property indexes cannot be created or deleted. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The index to create. The name and state fields are output only and will be + * ignored. Single property indexes cannot be created or deleted. + * + * Generated from protobuf field .google.datastore.admin.v1.Index index = 3; + * @return \Google\Cloud\Datastore\Admin\V1\Index|null + */ + public function getIndex() + { + return $this->index; + } + + public function hasIndex() + { + return isset($this->index); + } + + public function clearIndex() + { + unset($this->index); + } + + /** + * The index to create. The name and state fields are output only and will be + * ignored. Single property indexes cannot be created or deleted. + * + * Generated from protobuf field .google.datastore.admin.v1.Index index = 3; + * @param \Google\Cloud\Datastore\Admin\V1\Index $var + * @return $this + */ + public function setIndex($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Index::class); + $this->index = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DatastoreFirestoreMigrationMetadata.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DatastoreFirestoreMigrationMetadata.php new file mode 100644 index 00000000000..eac72af5846 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DatastoreFirestoreMigrationMetadata.php @@ -0,0 +1,114 @@ +google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + */ +class DatastoreFirestoreMigrationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * The current state of migration from Cloud Datastore to Cloud Firestore in + * Datastore mode. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationState migration_state = 1; + */ + protected $migration_state = 0; + /** + * The current step of migration from Cloud Datastore to Cloud Firestore in + * Datastore mode. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationStep migration_step = 2; + */ + protected $migration_step = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $migration_state + * The current state of migration from Cloud Datastore to Cloud Firestore in + * Datastore mode. + * @type int $migration_step + * The current step of migration from Cloud Datastore to Cloud Firestore in + * Datastore mode. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The current state of migration from Cloud Datastore to Cloud Firestore in + * Datastore mode. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationState migration_state = 1; + * @return int + */ + public function getMigrationState() + { + return $this->migration_state; + } + + /** + * The current state of migration from Cloud Datastore to Cloud Firestore in + * Datastore mode. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationState migration_state = 1; + * @param int $var + * @return $this + */ + public function setMigrationState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\MigrationState::class); + $this->migration_state = $var; + + return $this; + } + + /** + * The current step of migration from Cloud Datastore to Cloud Firestore in + * Datastore mode. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationStep migration_step = 2; + * @return int + */ + public function getMigrationStep() + { + return $this->migration_step; + } + + /** + * The current step of migration from Cloud Datastore to Cloud Firestore in + * Datastore mode. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationStep migration_step = 2; + * @param int $var + * @return $this + */ + public function setMigrationStep($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\MigrationStep::class); + $this->migration_step = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DeleteIndexRequest.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DeleteIndexRequest.php new file mode 100644 index 00000000000..330322229f4 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DeleteIndexRequest.php @@ -0,0 +1,102 @@ +google.datastore.admin.v1.DeleteIndexRequest + */ +class DeleteIndexRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1; + */ + protected $project_id = ''; + /** + * The resource ID of the index to delete. + * + * Generated from protobuf field string index_id = 3; + */ + protected $index_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Project ID against which to make the request. + * @type string $index_id + * The resource ID of the index to delete. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The resource ID of the index to delete. + * + * Generated from protobuf field string index_id = 3; + * @return string + */ + public function getIndexId() + { + return $this->index_id; + } + + /** + * The resource ID of the index to delete. + * + * Generated from protobuf field string index_id = 3; + * @param string $var + * @return $this + */ + public function setIndexId($var) + { + GPBUtil::checkString($var, True); + $this->index_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/EntityFilter.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/EntityFilter.php new file mode 100644 index 00000000000..c03b62ee37e --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/EntityFilter.php @@ -0,0 +1,134 @@ +google.datastore.admin.v1.EntityFilter + */ +class EntityFilter extends \Google\Protobuf\Internal\Message +{ + /** + * If empty, then this represents all kinds. + * + * Generated from protobuf field repeated string kinds = 1; + */ + private $kinds; + /** + * An empty list represents all namespaces. This is the preferred + * usage for projects that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the project has data in non-default namespaces, but doesn't want to + * include them. + * Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 2; + */ + private $namespace_ids; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $kinds + * If empty, then this represents all kinds. + * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids + * An empty list represents all namespaces. This is the preferred + * usage for projects that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the project has data in non-default namespaces, but doesn't want to + * include them. + * Each namespace in this list must be unique. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * If empty, then this represents all kinds. + * + * Generated from protobuf field repeated string kinds = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getKinds() + { + return $this->kinds; + } + + /** + * If empty, then this represents all kinds. + * + * Generated from protobuf field repeated string kinds = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setKinds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->kinds = $arr; + + return $this; + } + + /** + * An empty list represents all namespaces. This is the preferred + * usage for projects that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the project has data in non-default namespaces, but doesn't want to + * include them. + * Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNamespaceIds() + { + return $this->namespace_ids; + } + + /** + * An empty list represents all namespaces. This is the preferred + * usage for projects that don't use namespaces. + * An empty string element represents the default namespace. This should be + * used if the project has data in non-default namespaces, but doesn't want to + * include them. + * Each namespace in this list must be unique. + * + * Generated from protobuf field repeated string namespace_ids = 2; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNamespaceIds($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->namespace_ids = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesMetadata.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesMetadata.php new file mode 100644 index 00000000000..72554a9ea05 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesMetadata.php @@ -0,0 +1,259 @@ +google.datastore.admin.v1.ExportEntitiesMetadata + */ +class ExportEntitiesMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Metadata common to all Datastore Admin operations. + * + * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; + */ + protected $common = null; + /** + * An estimate of the number of entities processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; + */ + protected $progress_entities = null; + /** + * An estimate of the number of bytes processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + protected $progress_bytes = null; + /** + * Description of which entities are being exported. + * + * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + protected $entity_filter = null; + /** + * Location for the export metadata and data files. This will be the same + * value as the + * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix] + * field. The final output location is provided in + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + * + * Generated from protobuf field string output_url_prefix = 5; + */ + protected $output_url_prefix = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\Admin\V1\CommonMetadata $common + * Metadata common to all Datastore Admin operations. + * @type \Google\Cloud\Datastore\Admin\V1\Progress $progress_entities + * An estimate of the number of entities processed. + * @type \Google\Cloud\Datastore\Admin\V1\Progress $progress_bytes + * An estimate of the number of bytes processed. + * @type \Google\Cloud\Datastore\Admin\V1\EntityFilter $entity_filter + * Description of which entities are being exported. + * @type string $output_url_prefix + * Location for the export metadata and data files. This will be the same + * value as the + * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix] + * field. The final output location is provided in + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Metadata common to all Datastore Admin operations. + * + * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; + * @return \Google\Cloud\Datastore\Admin\V1\CommonMetadata|null + */ + public function getCommon() + { + return $this->common; + } + + public function hasCommon() + { + return isset($this->common); + } + + public function clearCommon() + { + unset($this->common); + } + + /** + * Metadata common to all Datastore Admin operations. + * + * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; + * @param \Google\Cloud\Datastore\Admin\V1\CommonMetadata $var + * @return $this + */ + public function setCommon($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\CommonMetadata::class); + $this->common = $var; + + return $this; + } + + /** + * An estimate of the number of entities processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; + * @return \Google\Cloud\Datastore\Admin\V1\Progress|null + */ + public function getProgressEntities() + { + return $this->progress_entities; + } + + public function hasProgressEntities() + { + return isset($this->progress_entities); + } + + public function clearProgressEntities() + { + unset($this->progress_entities); + } + + /** + * An estimate of the number of entities processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; + * @param \Google\Cloud\Datastore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressEntities($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Progress::class); + $this->progress_entities = $var; + + return $this; + } + + /** + * An estimate of the number of bytes processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_bytes = 3; + * @return \Google\Cloud\Datastore\Admin\V1\Progress|null + */ + public function getProgressBytes() + { + return $this->progress_bytes; + } + + public function hasProgressBytes() + { + return isset($this->progress_bytes); + } + + public function clearProgressBytes() + { + unset($this->progress_bytes); + } + + /** + * An estimate of the number of bytes processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_bytes = 3; + * @param \Google\Cloud\Datastore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressBytes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Progress::class); + $this->progress_bytes = $var; + + return $this; + } + + /** + * Description of which entities are being exported. + * + * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * @return \Google\Cloud\Datastore\Admin\V1\EntityFilter|null + */ + public function getEntityFilter() + { + return $this->entity_filter; + } + + public function hasEntityFilter() + { + return isset($this->entity_filter); + } + + public function clearEntityFilter() + { + unset($this->entity_filter); + } + + /** + * Description of which entities are being exported. + * + * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * @param \Google\Cloud\Datastore\Admin\V1\EntityFilter $var + * @return $this + */ + public function setEntityFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\EntityFilter::class); + $this->entity_filter = $var; + + return $this; + } + + /** + * Location for the export metadata and data files. This will be the same + * value as the + * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix] + * field. The final output location is provided in + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + * + * Generated from protobuf field string output_url_prefix = 5; + * @return string + */ + public function getOutputUrlPrefix() + { + return $this->output_url_prefix; + } + + /** + * Location for the export metadata and data files. This will be the same + * value as the + * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix] + * field. The final output location is provided in + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + * + * Generated from protobuf field string output_url_prefix = 5; + * @param string $var + * @return $this + */ + public function setOutputUrlPrefix($var) + { + GPBUtil::checkString($var, True); + $this->output_url_prefix = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesRequest.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesRequest.php new file mode 100644 index 00000000000..983ecc49e75 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesRequest.php @@ -0,0 +1,272 @@ +google.datastore.admin.v1.ExportEntitiesRequest + */ +class ExportEntitiesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * Client-assigned labels. + * + * Generated from protobuf field map labels = 2; + */ + private $labels; + /** + * Description of what data from the project is included in the export. + * + * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 3; + */ + protected $entity_filter = null; + /** + * Required. Location for the export metadata and data files. + * The full resource URL of the external storage location. Currently, only + * Google Cloud Storage is supported. So output_url_prefix should be of the + * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the + * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud + * Storage namespace path (this is not a Cloud Datastore namespace). For more + * information about Cloud Storage namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * The resulting files will be nested deeper than the specified URL prefix. + * The final output URL will be provided in the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. + * By nesting the data files deeper, the same Cloud Storage bucket can be used + * in multiple ExportEntities operations without conflict. + * + * Generated from protobuf field string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $output_url_prefix = ''; + + /** + * @param string $projectId Required. Project ID against which to make the request. + * @param array $labels Client-assigned labels. + * @param \Google\Cloud\Datastore\Admin\V1\EntityFilter $entityFilter Description of what data from the project is included in the export. + * @param string $outputUrlPrefix Required. Location for the export metadata and data files. + * + * The full resource URL of the external storage location. Currently, only + * Google Cloud Storage is supported. So output_url_prefix should be of the + * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the + * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud + * Storage namespace path (this is not a Cloud Datastore namespace). For more + * information about Cloud Storage namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * + * The resulting files will be nested deeper than the specified URL prefix. + * The final output URL will be provided in the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. + * + * By nesting the data files deeper, the same Cloud Storage bucket can be used + * in multiple ExportEntities operations without conflict. + * + * @return \Google\Cloud\Datastore\Admin\V1\ExportEntitiesRequest + * + * @experimental + */ + public static function build(string $projectId, array $labels, \Google\Cloud\Datastore\Admin\V1\EntityFilter $entityFilter, string $outputUrlPrefix): self + { + return (new self()) + ->setProjectId($projectId) + ->setLabels($labels) + ->setEntityFilter($entityFilter) + ->setOutputUrlPrefix($outputUrlPrefix); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. Project ID against which to make the request. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Client-assigned labels. + * @type \Google\Cloud\Datastore\Admin\V1\EntityFilter $entity_filter + * Description of what data from the project is included in the export. + * @type string $output_url_prefix + * Required. Location for the export metadata and data files. + * The full resource URL of the external storage location. Currently, only + * Google Cloud Storage is supported. So output_url_prefix should be of the + * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the + * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud + * Storage namespace path (this is not a Cloud Datastore namespace). For more + * information about Cloud Storage namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * The resulting files will be nested deeper than the specified URL prefix. + * The final output URL will be provided in the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. + * By nesting the data files deeper, the same Cloud Storage bucket can be used + * in multiple ExportEntities operations without conflict. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * Client-assigned labels. + * + * Generated from protobuf field map labels = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Client-assigned labels. + * + * Generated from protobuf field map labels = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Description of what data from the project is included in the export. + * + * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 3; + * @return \Google\Cloud\Datastore\Admin\V1\EntityFilter|null + */ + public function getEntityFilter() + { + return $this->entity_filter; + } + + public function hasEntityFilter() + { + return isset($this->entity_filter); + } + + public function clearEntityFilter() + { + unset($this->entity_filter); + } + + /** + * Description of what data from the project is included in the export. + * + * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 3; + * @param \Google\Cloud\Datastore\Admin\V1\EntityFilter $var + * @return $this + */ + public function setEntityFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\EntityFilter::class); + $this->entity_filter = $var; + + return $this; + } + + /** + * Required. Location for the export metadata and data files. + * The full resource URL of the external storage location. Currently, only + * Google Cloud Storage is supported. So output_url_prefix should be of the + * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the + * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud + * Storage namespace path (this is not a Cloud Datastore namespace). For more + * information about Cloud Storage namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * The resulting files will be nested deeper than the specified URL prefix. + * The final output URL will be provided in the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. + * By nesting the data files deeper, the same Cloud Storage bucket can be used + * in multiple ExportEntities operations without conflict. + * + * Generated from protobuf field string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getOutputUrlPrefix() + { + return $this->output_url_prefix; + } + + /** + * Required. Location for the export metadata and data files. + * The full resource URL of the external storage location. Currently, only + * Google Cloud Storage is supported. So output_url_prefix should be of the + * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the + * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud + * Storage namespace path (this is not a Cloud Datastore namespace). For more + * information about Cloud Storage namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * The resulting files will be nested deeper than the specified URL prefix. + * The final output URL will be provided in the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. + * By nesting the data files deeper, the same Cloud Storage bucket can be used + * in multiple ExportEntities operations without conflict. + * + * Generated from protobuf field string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setOutputUrlPrefix($var) + { + GPBUtil::checkString($var, True); + $this->output_url_prefix = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesResponse.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesResponse.php new file mode 100644 index 00000000000..f7e9ac10154 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesResponse.php @@ -0,0 +1,80 @@ +google.datastore.admin.v1.ExportEntitiesResponse + */ +class ExportEntitiesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Location of the output metadata file. This can be used to begin an import + * into Cloud Datastore (this project or another project). See + * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url]. + * Only present if the operation completed successfully. + * + * Generated from protobuf field string output_url = 1; + */ + protected $output_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $output_url + * Location of the output metadata file. This can be used to begin an import + * into Cloud Datastore (this project or another project). See + * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url]. + * Only present if the operation completed successfully. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Location of the output metadata file. This can be used to begin an import + * into Cloud Datastore (this project or another project). See + * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url]. + * Only present if the operation completed successfully. + * + * Generated from protobuf field string output_url = 1; + * @return string + */ + public function getOutputUrl() + { + return $this->output_url; + } + + /** + * Location of the output metadata file. This can be used to begin an import + * into Cloud Datastore (this project or another project). See + * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url]. + * Only present if the operation completed successfully. + * + * Generated from protobuf field string output_url = 1; + * @param string $var + * @return $this + */ + public function setOutputUrl($var) + { + GPBUtil::checkString($var, True); + $this->output_url = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/GetIndexRequest.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/GetIndexRequest.php new file mode 100644 index 00000000000..70a5ea9f645 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/GetIndexRequest.php @@ -0,0 +1,102 @@ +google.datastore.admin.v1.GetIndexRequest + */ +class GetIndexRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1; + */ + protected $project_id = ''; + /** + * The resource ID of the index to get. + * + * Generated from protobuf field string index_id = 3; + */ + protected $index_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Project ID against which to make the request. + * @type string $index_id + * The resource ID of the index to get. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * The resource ID of the index to get. + * + * Generated from protobuf field string index_id = 3; + * @return string + */ + public function getIndexId() + { + return $this->index_id; + } + + /** + * The resource ID of the index to get. + * + * Generated from protobuf field string index_id = 3; + * @param string $var + * @return $this + */ + public function setIndexId($var) + { + GPBUtil::checkString($var, True); + $this->index_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesMetadata.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesMetadata.php new file mode 100644 index 00000000000..fbd091964aa --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesMetadata.php @@ -0,0 +1,255 @@ +google.datastore.admin.v1.ImportEntitiesMetadata + */ +class ImportEntitiesMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Metadata common to all Datastore Admin operations. + * + * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; + */ + protected $common = null; + /** + * An estimate of the number of entities processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; + */ + protected $progress_entities = null; + /** + * An estimate of the number of bytes processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_bytes = 3; + */ + protected $progress_bytes = null; + /** + * Description of which entities are being imported. + * + * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + protected $entity_filter = null; + /** + * The location of the import metadata file. This will be the same value as + * the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. + * + * Generated from protobuf field string input_url = 5; + */ + protected $input_url = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\Admin\V1\CommonMetadata $common + * Metadata common to all Datastore Admin operations. + * @type \Google\Cloud\Datastore\Admin\V1\Progress $progress_entities + * An estimate of the number of entities processed. + * @type \Google\Cloud\Datastore\Admin\V1\Progress $progress_bytes + * An estimate of the number of bytes processed. + * @type \Google\Cloud\Datastore\Admin\V1\EntityFilter $entity_filter + * Description of which entities are being imported. + * @type string $input_url + * The location of the import metadata file. This will be the same value as + * the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Metadata common to all Datastore Admin operations. + * + * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; + * @return \Google\Cloud\Datastore\Admin\V1\CommonMetadata|null + */ + public function getCommon() + { + return $this->common; + } + + public function hasCommon() + { + return isset($this->common); + } + + public function clearCommon() + { + unset($this->common); + } + + /** + * Metadata common to all Datastore Admin operations. + * + * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; + * @param \Google\Cloud\Datastore\Admin\V1\CommonMetadata $var + * @return $this + */ + public function setCommon($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\CommonMetadata::class); + $this->common = $var; + + return $this; + } + + /** + * An estimate of the number of entities processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; + * @return \Google\Cloud\Datastore\Admin\V1\Progress|null + */ + public function getProgressEntities() + { + return $this->progress_entities; + } + + public function hasProgressEntities() + { + return isset($this->progress_entities); + } + + public function clearProgressEntities() + { + unset($this->progress_entities); + } + + /** + * An estimate of the number of entities processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; + * @param \Google\Cloud\Datastore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressEntities($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Progress::class); + $this->progress_entities = $var; + + return $this; + } + + /** + * An estimate of the number of bytes processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_bytes = 3; + * @return \Google\Cloud\Datastore\Admin\V1\Progress|null + */ + public function getProgressBytes() + { + return $this->progress_bytes; + } + + public function hasProgressBytes() + { + return isset($this->progress_bytes); + } + + public function clearProgressBytes() + { + unset($this->progress_bytes); + } + + /** + * An estimate of the number of bytes processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_bytes = 3; + * @param \Google\Cloud\Datastore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressBytes($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Progress::class); + $this->progress_bytes = $var; + + return $this; + } + + /** + * Description of which entities are being imported. + * + * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * @return \Google\Cloud\Datastore\Admin\V1\EntityFilter|null + */ + public function getEntityFilter() + { + return $this->entity_filter; + } + + public function hasEntityFilter() + { + return isset($this->entity_filter); + } + + public function clearEntityFilter() + { + unset($this->entity_filter); + } + + /** + * Description of which entities are being imported. + * + * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * @param \Google\Cloud\Datastore\Admin\V1\EntityFilter $var + * @return $this + */ + public function setEntityFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\EntityFilter::class); + $this->entity_filter = $var; + + return $this; + } + + /** + * The location of the import metadata file. This will be the same value as + * the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. + * + * Generated from protobuf field string input_url = 5; + * @return string + */ + public function getInputUrl() + { + return $this->input_url; + } + + /** + * The location of the import metadata file. This will be the same value as + * the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. + * + * Generated from protobuf field string input_url = 5; + * @param string $var + * @return $this + */ + public function setInputUrl($var) + { + GPBUtil::checkString($var, True); + $this->input_url = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesRequest.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesRequest.php new file mode 100644 index 00000000000..2b1c1675a9f --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesRequest.php @@ -0,0 +1,275 @@ +google.datastore.admin.v1.ImportEntitiesRequest + */ +class ImportEntitiesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $project_id = ''; + /** + * Client-assigned labels. + * + * Generated from protobuf field map labels = 2; + */ + private $labels; + /** + * Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: + * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where + * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is + * an optional Cloud Storage namespace path (this is not a Cloud Datastore + * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written + * by the ExportEntities operation. For more information about Cloud Storage + * namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * For more information, see + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + * + * Generated from protobuf field string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $input_url = ''; + /** + * Optionally specify which kinds/namespaces are to be imported. If provided, + * the list must be a subset of the EntityFilter used in creating the export, + * otherwise a FAILED_PRECONDITION error will be returned. If no filter is + * specified then all entities from the export are imported. + * + * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; + */ + protected $entity_filter = null; + + /** + * @param string $projectId Required. Project ID against which to make the request. + * @param array $labels Client-assigned labels. + * @param string $inputUrl Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: + * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where + * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is + * an optional Cloud Storage namespace path (this is not a Cloud Datastore + * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written + * by the ExportEntities operation. For more information about Cloud Storage + * namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * + * For more information, see + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + * @param \Google\Cloud\Datastore\Admin\V1\EntityFilter $entityFilter Optionally specify which kinds/namespaces are to be imported. If provided, + * the list must be a subset of the EntityFilter used in creating the export, + * otherwise a FAILED_PRECONDITION error will be returned. If no filter is + * specified then all entities from the export are imported. + * + * @return \Google\Cloud\Datastore\Admin\V1\ImportEntitiesRequest + * + * @experimental + */ + public static function build(string $projectId, array $labels, string $inputUrl, \Google\Cloud\Datastore\Admin\V1\EntityFilter $entityFilter): self + { + return (new self()) + ->setProjectId($projectId) + ->setLabels($labels) + ->setInputUrl($inputUrl) + ->setEntityFilter($entityFilter); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Required. Project ID against which to make the request. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Client-assigned labels. + * @type string $input_url + * Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: + * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where + * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is + * an optional Cloud Storage namespace path (this is not a Cloud Datastore + * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written + * by the ExportEntities operation. For more information about Cloud Storage + * namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * For more information, see + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + * @type \Google\Cloud\Datastore\Admin\V1\EntityFilter $entity_filter + * Optionally specify which kinds/namespaces are to be imported. If provided, + * the list must be a subset of the EntityFilter used in creating the export, + * otherwise a FAILED_PRECONDITION error will be returned. If no filter is + * specified then all entities from the export are imported. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Required. Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Required. Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * Client-assigned labels. + * + * Generated from protobuf field map labels = 2; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Client-assigned labels. + * + * Generated from protobuf field map labels = 2; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: + * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where + * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is + * an optional Cloud Storage namespace path (this is not a Cloud Datastore + * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written + * by the ExportEntities operation. For more information about Cloud Storage + * namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * For more information, see + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + * + * Generated from protobuf field string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getInputUrl() + { + return $this->input_url; + } + + /** + * Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: + * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where + * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is + * an optional Cloud Storage namespace path (this is not a Cloud Datastore + * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written + * by the ExportEntities operation. For more information about Cloud Storage + * namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * For more information, see + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + * + * Generated from protobuf field string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setInputUrl($var) + { + GPBUtil::checkString($var, True); + $this->input_url = $var; + + return $this; + } + + /** + * Optionally specify which kinds/namespaces are to be imported. If provided, + * the list must be a subset of the EntityFilter used in creating the export, + * otherwise a FAILED_PRECONDITION error will be returned. If no filter is + * specified then all entities from the export are imported. + * + * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * @return \Google\Cloud\Datastore\Admin\V1\EntityFilter|null + */ + public function getEntityFilter() + { + return $this->entity_filter; + } + + public function hasEntityFilter() + { + return isset($this->entity_filter); + } + + public function clearEntityFilter() + { + unset($this->entity_filter); + } + + /** + * Optionally specify which kinds/namespaces are to be imported. If provided, + * the list must be a subset of the EntityFilter used in creating the export, + * otherwise a FAILED_PRECONDITION error will be returned. If no filter is + * specified then all entities from the export are imported. + * + * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; + * @param \Google\Cloud\Datastore\Admin\V1\EntityFilter $var + * @return $this + */ + public function setEntityFilter($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\EntityFilter::class); + $this->entity_filter = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index.php new file mode 100644 index 00000000000..e8c9de9eee9 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index.php @@ -0,0 +1,249 @@ +google.datastore.admin.v1.Index + */ +class Index extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Project ID. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $project_id = ''; + /** + * Output only. The resource ID of the index. + * + * Generated from protobuf field string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $index_id = ''; + /** + * Required. The entity kind to which this index applies. + * + * Generated from protobuf field string kind = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $kind = ''; + /** + * Required. The index's ancestor mode. Must not be + * ANCESTOR_MODE_UNSPECIFIED. + * + * Generated from protobuf field .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $ancestor = 0; + /** + * Required. An ordered sequence of property names and their index attributes. + * Requires: + * * A maximum of 100 properties. + * + * Generated from protobuf field repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + */ + private $properties; + /** + * Output only. The state of the index. + * + * Generated from protobuf field .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Output only. Project ID. + * @type string $index_id + * Output only. The resource ID of the index. + * @type string $kind + * Required. The entity kind to which this index applies. + * @type int $ancestor + * Required. The index's ancestor mode. Must not be + * ANCESTOR_MODE_UNSPECIFIED. + * @type array<\Google\Cloud\Datastore\Admin\V1\Index\IndexedProperty>|\Google\Protobuf\Internal\RepeatedField $properties + * Required. An ordered sequence of property names and their index attributes. + * Requires: + * * A maximum of 100 properties. + * @type int $state + * Output only. The state of the index. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\Index::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Project ID. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Output only. Project ID. + * + * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * Output only. The resource ID of the index. + * + * Generated from protobuf field string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIndexId() + { + return $this->index_id; + } + + /** + * Output only. The resource ID of the index. + * + * Generated from protobuf field string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIndexId($var) + { + GPBUtil::checkString($var, True); + $this->index_id = $var; + + return $this; + } + + /** + * Required. The entity kind to which this index applies. + * + * Generated from protobuf field string kind = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getKind() + { + return $this->kind; + } + + /** + * Required. The entity kind to which this index applies. + * + * Generated from protobuf field string kind = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkString($var, True); + $this->kind = $var; + + return $this; + } + + /** + * Required. The index's ancestor mode. Must not be + * ANCESTOR_MODE_UNSPECIFIED. + * + * Generated from protobuf field .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getAncestor() + { + return $this->ancestor; + } + + /** + * Required. The index's ancestor mode. Must not be + * ANCESTOR_MODE_UNSPECIFIED. + * + * Generated from protobuf field .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setAncestor($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\Index\AncestorMode::class); + $this->ancestor = $var; + + return $this; + } + + /** + * Required. An ordered sequence of property names and their index attributes. + * Requires: + * * A maximum of 100 properties. + * + * Generated from protobuf field repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getProperties() + { + return $this->properties; + } + + /** + * Required. An ordered sequence of property names and their index attributes. + * Requires: + * * A maximum of 100 properties. + * + * Generated from protobuf field repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; + * @param array<\Google\Cloud\Datastore\Admin\V1\Index\IndexedProperty>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setProperties($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\Admin\V1\Index\IndexedProperty::class); + $this->properties = $arr; + + return $this; + } + + /** + * Output only. The state of the index. + * + * Generated from protobuf field .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of the index. + * + * Generated from protobuf field .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\Index\State::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/AncestorMode.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/AncestorMode.php new file mode 100644 index 00000000000..24e87cb45bf --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/AncestorMode.php @@ -0,0 +1,65 @@ +google.datastore.admin.v1.Index.AncestorMode + */ +class AncestorMode +{ + /** + * The ancestor mode is unspecified. + * + * Generated from protobuf enum ANCESTOR_MODE_UNSPECIFIED = 0; + */ + const ANCESTOR_MODE_UNSPECIFIED = 0; + /** + * Do not include the entity's ancestors in the index. + * + * Generated from protobuf enum NONE = 1; + */ + const NONE = 1; + /** + * Include all the entity's ancestors in the index. + * + * Generated from protobuf enum ALL_ANCESTORS = 2; + */ + const ALL_ANCESTORS = 2; + + private static $valueToName = [ + self::ANCESTOR_MODE_UNSPECIFIED => 'ANCESTOR_MODE_UNSPECIFIED', + self::NONE => 'NONE', + self::ALL_ANCESTORS => 'ALL_ANCESTORS', + ]; + + 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(AncestorMode::class, \Google\Cloud\Datastore\Admin\V1\Index_AncestorMode::class); + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/Direction.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/Direction.php new file mode 100644 index 00000000000..bee71a7181e --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/Direction.php @@ -0,0 +1,66 @@ +google.datastore.admin.v1.Index.Direction + */ +class Direction +{ + /** + * The direction is unspecified. + * + * Generated from protobuf enum DIRECTION_UNSPECIFIED = 0; + */ + const DIRECTION_UNSPECIFIED = 0; + /** + * The property's values are indexed so as to support sequencing in + * ascending order and also query by <, >, <=, >=, and =. + * + * Generated from protobuf enum ASCENDING = 1; + */ + const ASCENDING = 1; + /** + * The property's values are indexed so as to support sequencing in + * descending order and also query by <, >, <=, >=, and =. + * + * 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\Admin\V1\Index_Direction::class); + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/IndexedProperty.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/IndexedProperty.php new file mode 100644 index 00000000000..546eb72565e --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/IndexedProperty.php @@ -0,0 +1,108 @@ +google.datastore.admin.v1.Index.IndexedProperty + */ +class IndexedProperty extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The property name to index. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + /** + * Required. The indexed property's direction. Must not be + * DIRECTION_UNSPECIFIED. + * + * Generated from protobuf field .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $direction = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The property name to index. + * @type int $direction + * Required. The indexed property's direction. Must not be + * DIRECTION_UNSPECIFIED. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\Index::initOnce(); + parent::__construct($data); + } + + /** + * Required. The property name to index. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The property name to index. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. The indexed property's direction. Must not be + * DIRECTION_UNSPECIFIED. + * + * Generated from protobuf field .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDirection() + { + return $this->direction; + } + + /** + * Required. The indexed property's direction. Must not be + * DIRECTION_UNSPECIFIED. + * + * Generated from protobuf field .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDirection($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\Index\Direction::class); + $this->direction = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(IndexedProperty::class, \Google\Cloud\Datastore\Admin\V1\Index_IndexedProperty::class); + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/State.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/State.php new file mode 100644 index 00000000000..6d8678652c2 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/State.php @@ -0,0 +1,91 @@ +google.datastore.admin.v1.Index.State + */ +class State +{ + /** + * The state is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The index is being created, and cannot be used by queries. + * There is an active long-running operation for the index. + * The index is updated when writing an entity. + * Some index data may exist. + * + * Generated from protobuf enum CREATING = 1; + */ + const CREATING = 1; + /** + * The index is ready to be used. + * The index is updated when writing an entity. + * The index is fully populated from all stored entities it applies to. + * + * Generated from protobuf enum READY = 2; + */ + const READY = 2; + /** + * The index is being deleted, and cannot be used by queries. + * There is an active long-running operation for the index. + * The index is not updated when writing an entity. + * Some index data may exist. + * + * Generated from protobuf enum DELETING = 3; + */ + const DELETING = 3; + /** + * The index was being created or deleted, but something went wrong. + * The index cannot by used by queries. + * There is no active long-running operation for the index, + * and the most recently finished long-running operation failed. + * The index is not updated when writing an entity. + * Some index data may exist. + * + * Generated from protobuf enum ERROR = 4; + */ + const ERROR = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::CREATING => 'CREATING', + self::READY => 'READY', + self::DELETING => 'DELETING', + self::ERROR => 'ERROR', + ]; + + 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(State::class, \Google\Cloud\Datastore\Admin\V1\Index_State::class); + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/IndexOperationMetadata.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/IndexOperationMetadata.php new file mode 100644 index 00000000000..78ebf07e1ff --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/IndexOperationMetadata.php @@ -0,0 +1,155 @@ +google.datastore.admin.v1.IndexOperationMetadata + */ +class IndexOperationMetadata extends \Google\Protobuf\Internal\Message +{ + /** + * Metadata common to all Datastore Admin operations. + * + * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; + */ + protected $common = null; + /** + * An estimate of the number of entities processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; + */ + protected $progress_entities = null; + /** + * The index resource ID that this operation is acting on. + * + * Generated from protobuf field string index_id = 3; + */ + protected $index_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\Datastore\Admin\V1\CommonMetadata $common + * Metadata common to all Datastore Admin operations. + * @type \Google\Cloud\Datastore\Admin\V1\Progress $progress_entities + * An estimate of the number of entities processed. + * @type string $index_id + * The index resource ID that this operation is acting on. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Metadata common to all Datastore Admin operations. + * + * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; + * @return \Google\Cloud\Datastore\Admin\V1\CommonMetadata|null + */ + public function getCommon() + { + return $this->common; + } + + public function hasCommon() + { + return isset($this->common); + } + + public function clearCommon() + { + unset($this->common); + } + + /** + * Metadata common to all Datastore Admin operations. + * + * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; + * @param \Google\Cloud\Datastore\Admin\V1\CommonMetadata $var + * @return $this + */ + public function setCommon($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\CommonMetadata::class); + $this->common = $var; + + return $this; + } + + /** + * An estimate of the number of entities processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; + * @return \Google\Cloud\Datastore\Admin\V1\Progress|null + */ + public function getProgressEntities() + { + return $this->progress_entities; + } + + public function hasProgressEntities() + { + return isset($this->progress_entities); + } + + public function clearProgressEntities() + { + unset($this->progress_entities); + } + + /** + * An estimate of the number of entities processed. + * + * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; + * @param \Google\Cloud\Datastore\Admin\V1\Progress $var + * @return $this + */ + public function setProgressEntities($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Progress::class); + $this->progress_entities = $var; + + return $this; + } + + /** + * The index resource ID that this operation is acting on. + * + * Generated from protobuf field string index_id = 3; + * @return string + */ + public function getIndexId() + { + return $this->index_id; + } + + /** + * The index resource ID that this operation is acting on. + * + * Generated from protobuf field string index_id = 3; + * @param string $var + * @return $this + */ + public function setIndexId($var) + { + GPBUtil::checkString($var, True); + $this->index_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesRequest.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesRequest.php new file mode 100644 index 00000000000..137986ae766 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesRequest.php @@ -0,0 +1,167 @@ +google.datastore.admin.v1.ListIndexesRequest + */ +class ListIndexesRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1; + */ + protected $project_id = ''; + /** + * Generated from protobuf field string filter = 3; + */ + protected $filter = ''; + /** + * The maximum number of items to return. If zero, then all results will be + * returned. + * + * Generated from protobuf field int32 page_size = 4; + */ + protected $page_size = 0; + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 5; + */ + protected $page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $project_id + * Project ID against which to make the request. + * @type string $filter + * @type int $page_size + * The maximum number of items to return. If zero, then all results will be + * returned. + * @type string $page_token + * The next_page_token value returned from a previous List request, if any. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1; + * @return string + */ + public function getProjectId() + { + return $this->project_id; + } + + /** + * Project ID against which to make the request. + * + * Generated from protobuf field string project_id = 1; + * @param string $var + * @return $this + */ + public function setProjectId($var) + { + GPBUtil::checkString($var, True); + $this->project_id = $var; + + return $this; + } + + /** + * Generated from protobuf field string filter = 3; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Generated from protobuf field string filter = 3; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * The maximum number of items to return. If zero, then all results will be + * returned. + * + * Generated from protobuf field int32 page_size = 4; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * The maximum number of items to return. If zero, then all results will be + * returned. + * + * Generated from protobuf field int32 page_size = 4; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 5; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * The next_page_token value returned from a previous List request, if any. + * + * Generated from protobuf field string page_token = 5; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesResponse.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesResponse.php new file mode 100644 index 00000000000..24c9caf57fa --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesResponse.php @@ -0,0 +1,102 @@ +google.datastore.admin.v1.ListIndexesResponse + */ +class ListIndexesResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The indexes. + * + * Generated from protobuf field repeated .google.datastore.admin.v1.Index indexes = 1; + */ + private $indexes; + /** + * The standard List next-page token. + * + * Generated from protobuf field string next_page_token = 2; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\Datastore\Admin\V1\Index>|\Google\Protobuf\Internal\RepeatedField $indexes + * The indexes. + * @type string $next_page_token + * The standard List next-page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The indexes. + * + * Generated from protobuf field repeated .google.datastore.admin.v1.Index indexes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getIndexes() + { + return $this->indexes; + } + + /** + * The indexes. + * + * Generated from protobuf field repeated .google.datastore.admin.v1.Index indexes = 1; + * @param array<\Google\Cloud\Datastore\Admin\V1\Index>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setIndexes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\Admin\V1\Index::class); + $this->indexes = $arr; + + return $this; + } + + /** + * The standard List next-page token. + * + * Generated from protobuf field string next_page_token = 2; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * The standard List next-page token. + * + * Generated from protobuf field string next_page_token = 2; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent.php new file mode 100644 index 00000000000..ad713f55b62 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent.php @@ -0,0 +1,152 @@ +google.datastore.admin.v1.MigrationProgressEvent + */ +class MigrationProgressEvent extends \Google\Protobuf\Internal\Message +{ + /** + * The step that is starting. + * An event with step set to `START` indicates that the migration + * has been reverted back to the initial pre-migration state. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationStep step = 1; + */ + protected $step = 0; + protected $step_details; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $step + * The step that is starting. + * An event with step set to `START` indicates that the migration + * has been reverted back to the initial pre-migration state. + * @type \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\PrepareStepDetails $prepare_step_details + * Details for the `PREPARE` step. + * @type \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\RedirectWritesStepDetails $redirect_writes_step_details + * Details for the `REDIRECT_WRITES` step. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\Migration::initOnce(); + parent::__construct($data); + } + + /** + * The step that is starting. + * An event with step set to `START` indicates that the migration + * has been reverted back to the initial pre-migration state. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationStep step = 1; + * @return int + */ + public function getStep() + { + return $this->step; + } + + /** + * The step that is starting. + * An event with step set to `START` indicates that the migration + * has been reverted back to the initial pre-migration state. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationStep step = 1; + * @param int $var + * @return $this + */ + public function setStep($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\MigrationStep::class); + $this->step = $var; + + return $this; + } + + /** + * Details for the `PREPARE` step. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * @return \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\PrepareStepDetails|null + */ + public function getPrepareStepDetails() + { + return $this->readOneof(2); + } + + public function hasPrepareStepDetails() + { + return $this->hasOneof(2); + } + + /** + * Details for the `PREPARE` step. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; + * @param \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\PrepareStepDetails $var + * @return $this + */ + public function setPrepareStepDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\PrepareStepDetails::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Details for the `REDIRECT_WRITES` step. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * @return \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\RedirectWritesStepDetails|null + */ + public function getRedirectWritesStepDetails() + { + return $this->readOneof(3); + } + + public function hasRedirectWritesStepDetails() + { + return $this->hasOneof(3); + } + + /** + * Details for the `REDIRECT_WRITES` step. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; + * @param \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\RedirectWritesStepDetails $var + * @return $this + */ + public function setRedirectWritesStepDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\RedirectWritesStepDetails::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getStepDetails() + { + return $this->whichOneof("step_details"); + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/ConcurrencyMode.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/ConcurrencyMode.php new file mode 100644 index 00000000000..6ac75957b07 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/ConcurrencyMode.php @@ -0,0 +1,71 @@ +google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode + */ +class ConcurrencyMode +{ + /** + * Unspecified. + * + * Generated from protobuf enum CONCURRENCY_MODE_UNSPECIFIED = 0; + */ + const CONCURRENCY_MODE_UNSPECIFIED = 0; + /** + * Pessimistic concurrency. + * + * Generated from protobuf enum PESSIMISTIC = 1; + */ + const PESSIMISTIC = 1; + /** + * Optimistic concurrency. + * + * Generated from protobuf enum OPTIMISTIC = 2; + */ + const OPTIMISTIC = 2; + /** + * Optimistic concurrency with entity groups. + * + * Generated from protobuf enum OPTIMISTIC_WITH_ENTITY_GROUPS = 3; + */ + const OPTIMISTIC_WITH_ENTITY_GROUPS = 3; + + private static $valueToName = [ + self::CONCURRENCY_MODE_UNSPECIFIED => 'CONCURRENCY_MODE_UNSPECIFIED', + self::PESSIMISTIC => 'PESSIMISTIC', + self::OPTIMISTIC => 'OPTIMISTIC', + self::OPTIMISTIC_WITH_ENTITY_GROUPS => 'OPTIMISTIC_WITH_ENTITY_GROUPS', + ]; + + 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(ConcurrencyMode::class, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent_ConcurrencyMode::class); + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/PrepareStepDetails.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/PrepareStepDetails.php new file mode 100644 index 00000000000..9182ec0e8fc --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/PrepareStepDetails.php @@ -0,0 +1,74 @@ +google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + */ +class PrepareStepDetails extends \Google\Protobuf\Internal\Message +{ + /** + * The concurrency mode this database will use when it reaches the + * `REDIRECT_WRITES` step. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + */ + protected $concurrency_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $concurrency_mode + * The concurrency mode this database will use when it reaches the + * `REDIRECT_WRITES` step. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\Migration::initOnce(); + parent::__construct($data); + } + + /** + * The concurrency mode this database will use when it reaches the + * `REDIRECT_WRITES` step. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * @return int + */ + public function getConcurrencyMode() + { + return $this->concurrency_mode; + } + + /** + * The concurrency mode this database will use when it reaches the + * `REDIRECT_WRITES` step. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * @param int $var + * @return $this + */ + public function setConcurrencyMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\ConcurrencyMode::class); + $this->concurrency_mode = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(PrepareStepDetails::class, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent_PrepareStepDetails::class); + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/RedirectWritesStepDetails.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/RedirectWritesStepDetails.php new file mode 100644 index 00000000000..62927870dda --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/RedirectWritesStepDetails.php @@ -0,0 +1,70 @@ +google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + */ +class RedirectWritesStepDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Ths concurrency mode for this database. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + */ + protected $concurrency_mode = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $concurrency_mode + * Ths concurrency mode for this database. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\Migration::initOnce(); + parent::__construct($data); + } + + /** + * Ths concurrency mode for this database. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * @return int + */ + public function getConcurrencyMode() + { + return $this->concurrency_mode; + } + + /** + * Ths concurrency mode for this database. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; + * @param int $var + * @return $this + */ + public function setConcurrencyMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\ConcurrencyMode::class); + $this->concurrency_mode = $var; + + return $this; + } + +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(RedirectWritesStepDetails::class, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent_RedirectWritesStepDetails::class); + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationState.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationState.php new file mode 100644 index 00000000000..73ed2294dfc --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationState.php @@ -0,0 +1,68 @@ +google.datastore.admin.v1.MigrationState + */ +class MigrationState +{ + /** + * Unspecified. + * + * Generated from protobuf enum MIGRATION_STATE_UNSPECIFIED = 0; + */ + const MIGRATION_STATE_UNSPECIFIED = 0; + /** + * The migration is running. + * + * Generated from protobuf enum RUNNING = 1; + */ + const RUNNING = 1; + /** + * The migration is paused. + * + * Generated from protobuf enum PAUSED = 2; + */ + const PAUSED = 2; + /** + * The migration is complete. + * + * Generated from protobuf enum COMPLETE = 3; + */ + const COMPLETE = 3; + + private static $valueToName = [ + self::MIGRATION_STATE_UNSPECIFIED => 'MIGRATION_STATE_UNSPECIFIED', + self::RUNNING => 'RUNNING', + self::PAUSED => 'PAUSED', + self::COMPLETE => 'COMPLETE', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStateEvent.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStateEvent.php new file mode 100644 index 00000000000..12ce4113a77 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStateEvent.php @@ -0,0 +1,69 @@ +google.datastore.admin.v1.MigrationStateEvent + */ +class MigrationStateEvent extends \Google\Protobuf\Internal\Message +{ + /** + * The new state of the migration. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationState state = 1; + */ + protected $state = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * The new state of the migration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\Migration::initOnce(); + parent::__construct($data); + } + + /** + * The new state of the migration. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationState state = 1; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * The new state of the migration. + * + * Generated from protobuf field .google.datastore.admin.v1.MigrationState state = 1; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\MigrationState::class); + $this->state = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStep.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStep.php new file mode 100644 index 00000000000..b20fab7b5f1 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStep.php @@ -0,0 +1,97 @@ +google.datastore.admin.v1.MigrationStep + */ +class MigrationStep +{ + /** + * Unspecified. + * + * Generated from protobuf enum MIGRATION_STEP_UNSPECIFIED = 0; + */ + const MIGRATION_STEP_UNSPECIFIED = 0; + /** + * Pre-migration: the database is prepared for migration. + * + * Generated from protobuf enum PREPARE = 6; + */ + const PREPARE = 6; + /** + * Start of migration. + * + * Generated from protobuf enum START = 1; + */ + const START = 1; + /** + * Writes are applied synchronously to at least one replica. + * + * Generated from protobuf enum APPLY_WRITES_SYNCHRONOUSLY = 7; + */ + const APPLY_WRITES_SYNCHRONOUSLY = 7; + /** + * Data is copied to Cloud Firestore and then verified to match the data in + * Cloud Datastore. + * + * Generated from protobuf enum COPY_AND_VERIFY = 2; + */ + const COPY_AND_VERIFY = 2; + /** + * Eventually-consistent reads are redirected to Cloud Firestore. + * + * Generated from protobuf enum REDIRECT_EVENTUALLY_CONSISTENT_READS = 3; + */ + const REDIRECT_EVENTUALLY_CONSISTENT_READS = 3; + /** + * Strongly-consistent reads are redirected to Cloud Firestore. + * + * Generated from protobuf enum REDIRECT_STRONGLY_CONSISTENT_READS = 4; + */ + const REDIRECT_STRONGLY_CONSISTENT_READS = 4; + /** + * Writes are redirected to Cloud Firestore. + * + * Generated from protobuf enum REDIRECT_WRITES = 5; + */ + const REDIRECT_WRITES = 5; + + private static $valueToName = [ + self::MIGRATION_STEP_UNSPECIFIED => 'MIGRATION_STEP_UNSPECIFIED', + self::PREPARE => 'PREPARE', + self::START => 'START', + self::APPLY_WRITES_SYNCHRONOUSLY => 'APPLY_WRITES_SYNCHRONOUSLY', + self::COPY_AND_VERIFY => 'COPY_AND_VERIFY', + self::REDIRECT_EVENTUALLY_CONSISTENT_READS => 'REDIRECT_EVENTUALLY_CONSISTENT_READS', + self::REDIRECT_STRONGLY_CONSISTENT_READS => 'REDIRECT_STRONGLY_CONSISTENT_READS', + self::REDIRECT_WRITES => 'REDIRECT_WRITES', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/OperationType.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/OperationType.php new file mode 100644 index 00000000000..f4a310a591f --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/OperationType.php @@ -0,0 +1,75 @@ +google.datastore.admin.v1.OperationType + */ +class OperationType +{ + /** + * Unspecified. + * + * Generated from protobuf enum OPERATION_TYPE_UNSPECIFIED = 0; + */ + const OPERATION_TYPE_UNSPECIFIED = 0; + /** + * ExportEntities. + * + * Generated from protobuf enum EXPORT_ENTITIES = 1; + */ + const EXPORT_ENTITIES = 1; + /** + * ImportEntities. + * + * Generated from protobuf enum IMPORT_ENTITIES = 2; + */ + const IMPORT_ENTITIES = 2; + /** + * CreateIndex. + * + * Generated from protobuf enum CREATE_INDEX = 3; + */ + const CREATE_INDEX = 3; + /** + * DeleteIndex. + * + * Generated from protobuf enum DELETE_INDEX = 4; + */ + const DELETE_INDEX = 4; + + private static $valueToName = [ + self::OPERATION_TYPE_UNSPECIFIED => 'OPERATION_TYPE_UNSPECIFIED', + self::EXPORT_ENTITIES => 'EXPORT_ENTITIES', + self::IMPORT_ENTITIES => 'IMPORT_ENTITIES', + self::CREATE_INDEX => 'CREATE_INDEX', + self::DELETE_INDEX => 'DELETE_INDEX', + ]; + + 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); + } +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Progress.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Progress.php new file mode 100644 index 00000000000..698275844e5 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Progress.php @@ -0,0 +1,109 @@ +google.datastore.admin.v1.Progress + */ +class Progress extends \Google\Protobuf\Internal\Message +{ + /** + * The amount of work that has been completed. Note that this may be greater + * than work_estimated. + * + * Generated from protobuf field int64 work_completed = 1; + */ + protected $work_completed = 0; + /** + * An estimate of how much work needs to be performed. May be zero if the + * work estimate is unavailable. + * + * Generated from protobuf field int64 work_estimated = 2; + */ + protected $work_estimated = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int|string $work_completed + * The amount of work that has been completed. Note that this may be greater + * than work_estimated. + * @type int|string $work_estimated + * An estimate of how much work needs to be performed. May be zero if the + * work estimate is unavailable. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); + parent::__construct($data); + } + + /** + * The amount of work that has been completed. Note that this may be greater + * than work_estimated. + * + * Generated from protobuf field int64 work_completed = 1; + * @return int|string + */ + public function getWorkCompleted() + { + return $this->work_completed; + } + + /** + * The amount of work that has been completed. Note that this may be greater + * than work_estimated. + * + * Generated from protobuf field int64 work_completed = 1; + * @param int|string $var + * @return $this + */ + public function setWorkCompleted($var) + { + GPBUtil::checkInt64($var); + $this->work_completed = $var; + + return $this; + } + + /** + * An estimate of how much work needs to be performed. May be zero if the + * work estimate is unavailable. + * + * Generated from protobuf field int64 work_estimated = 2; + * @return int|string + */ + public function getWorkEstimated() + { + return $this->work_estimated; + } + + /** + * An estimate of how much work needs to be performed. May be zero if the + * work estimate is unavailable. + * + * Generated from protobuf field int64 work_estimated = 2; + * @param int|string $var + * @return $this + */ + public function setWorkEstimated($var) + { + GPBUtil::checkInt64($var); + $this->work_estimated = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/create_index.php b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/create_index.php new file mode 100644 index 00000000000..267c6f7fe91 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/create_index.php @@ -0,0 +1,82 @@ +createIndex($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Index $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END datastore_v1_generated_DatastoreAdmin_CreateIndex_sync] diff --git a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/delete_index.php b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/delete_index.php new file mode 100644 index 00000000000..43a85a6ca92 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/delete_index.php @@ -0,0 +1,79 @@ +deleteIndex($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var Index $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END datastore_v1_generated_DatastoreAdmin_DeleteIndex_sync] diff --git a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/export_entities.php b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/export_entities.php new file mode 100644 index 00000000000..125ad265223 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/export_entities.php @@ -0,0 +1,109 @@ +setProjectId($projectId) + ->setOutputUrlPrefix($outputUrlPrefix); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $datastoreAdminClient->exportEntities($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ExportEntitiesResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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]'; + $outputUrlPrefix = '[OUTPUT_URL_PREFIX]'; + + export_entities_sample($projectId, $outputUrlPrefix); +} +// [END datastore_v1_generated_DatastoreAdmin_ExportEntities_sync] diff --git a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/get_index.php b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/get_index.php new file mode 100644 index 00000000000..f435a5846b7 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/get_index.php @@ -0,0 +1,57 @@ +getIndex($request); + printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END datastore_v1_generated_DatastoreAdmin_GetIndex_sync] diff --git a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/import_entities.php b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/import_entities.php new file mode 100644 index 00000000000..ebc91a43434 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/import_entities.php @@ -0,0 +1,99 @@ +setProjectId($projectId) + ->setInputUrl($inputUrl); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $datastoreAdminClient->importEntities($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + printf('Operation completed successfully.' . PHP_EOL); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->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]'; + $inputUrl = '[INPUT_URL]'; + + import_entities_sample($projectId, $inputUrl); +} +// [END datastore_v1_generated_DatastoreAdmin_ImportEntities_sync] diff --git a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/list_indexes.php b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/list_indexes.php new file mode 100644 index 00000000000..f5b9703118d --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/list_indexes.php @@ -0,0 +1,64 @@ +listIndexes($request); + + /** @var Index $element */ + foreach ($response as $element) { + printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END datastore_v1_generated_DatastoreAdmin_ListIndexes_sync] diff --git a/owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/BaseClient/DatastoreAdminBaseClient.php b/owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/BaseClient/DatastoreAdminBaseClient.php new file mode 100644 index 00000000000..7a3be504fdc --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/BaseClient/DatastoreAdminBaseClient.php @@ -0,0 +1,449 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../../resources/datastore_admin_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../../resources/datastore_admin_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../../resources/datastore_admin_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../../resources/datastore_admin_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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); + $this->operationsClient = $this->createOperationsClient($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); + } + + /** + * Creates the specified index. + * A newly created index's initial state is `CREATING`. On completion of the + * returned [google.longrunning.Operation][google.longrunning.Operation], the + * state will be `READY`. If the index already exists, the call will return an + * `ALREADY_EXISTS` status. + * + * During index creation, the process could result in an error, in which + * case the index will move to the `ERROR` state. The process can be recovered + * by fixing the data that caused the error, removing the index with + * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then + * re-creating the index with [create] + * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. + * + * Indexes with a single property cannot be created. + * + * The async variant is {@see self::createIndexAsync()} . + * + * @example samples/V1/DatastoreAdminClient/create_index.php + * + * @param CreateIndexRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createIndex(CreateIndexRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateIndex', $request, $callOptions)->wait(); + } + + /** + * Deletes an existing index. + * An index can only be deleted if it is in a `READY` or `ERROR` state. On + * successful execution of the request, the index will be in a `DELETING` + * [state][google.datastore.admin.v1.Index.State]. And on completion of the + * returned [google.longrunning.Operation][google.longrunning.Operation], the + * index will be removed. + * + * During index deletion, the process could result in an error, in which + * case the index will move to the `ERROR` state. The process can be recovered + * by fixing the data that caused the error, followed by calling + * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again. + * + * The async variant is {@see self::deleteIndexAsync()} . + * + * @example samples/V1/DatastoreAdminClient/delete_index.php + * + * @param DeleteIndexRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteIndex(DeleteIndexRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteIndex', $request, $callOptions)->wait(); + } + + /** + * Exports a copy of all or a subset of entities from Google Cloud Datastore + * to another storage system, such as Google Cloud Storage. Recent updates to + * entities may not be reflected in the export. The export occurs in the + * background and its progress can be monitored and managed via the + * Operation resource that is created. The output of an export may only be + * used once the associated operation is done. If an export operation is + * cancelled before completion it may leave partial data behind in Google + * Cloud Storage. + * + * The async variant is {@see self::exportEntitiesAsync()} . + * + * @example samples/V1/DatastoreAdminClient/export_entities.php + * + * @param ExportEntitiesRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function exportEntities(ExportEntitiesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExportEntities', $request, $callOptions)->wait(); + } + + /** + * Gets an index. + * + * The async variant is {@see self::getIndexAsync()} . + * + * @example samples/V1/DatastoreAdminClient/get_index.php + * + * @param GetIndexRequest $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 Index + * + * @throws ApiException Thrown if the API call fails. + */ + public function getIndex(GetIndexRequest $request, array $callOptions = []): Index + { + return $this->startApiCall('GetIndex', $request, $callOptions)->wait(); + } + + /** + * Imports entities into Google Cloud Datastore. Existing entities with the + * same key are overwritten. The import occurs in the background and its + * progress can be monitored and managed via the Operation resource that is + * created. If an ImportEntities operation is cancelled, it is possible + * that a subset of the data has already been imported to Cloud Datastore. + * + * The async variant is {@see self::importEntitiesAsync()} . + * + * @example samples/V1/DatastoreAdminClient/import_entities.php + * + * @param ImportEntitiesRequest $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 OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function importEntities(ImportEntitiesRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ImportEntities', $request, $callOptions)->wait(); + } + + /** + * Lists the indexes that match the specified filters. Datastore uses an + * eventually consistent query to fetch the list of indexes and may + * occasionally return stale results. + * + * The async variant is {@see self::listIndexesAsync()} . + * + * @example samples/V1/DatastoreAdminClient/list_indexes.php + * + * @param ListIndexesRequest $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 PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listIndexes(ListIndexesRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListIndexes', $request, $callOptions); + } +} diff --git a/owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/DatastoreAdminClient.php b/owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/DatastoreAdminClient.php new file mode 100644 index 00000000000..7b6254c8a12 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/DatastoreAdminClient.php @@ -0,0 +1,40 @@ +createIndex(); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $datastoreAdminClient->createIndex(); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $datastoreAdminClient->resumeOperation($operationName, 'createIndex'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $datastoreAdminClient->close(); + * } + * ``` + * + * This service has a new (beta) implementation. See {@see + * \Google\Cloud\Datastore\Admin\V1\Client\DatastoreAdminClient} to use the new + * surface. + */ +class DatastoreAdminGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.datastore.admin.v1.DatastoreAdmin'; + + /** The default address of the service. */ + const SERVICE_ADDRESS = 'datastore.googleapis.com'; + + /** 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 $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/datastore_admin_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/datastore_admin_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/datastore_admin_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/datastore_admin_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * 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); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Creates the specified index. + * A newly created index's initial state is `CREATING`. On completion of the + * returned [google.longrunning.Operation][google.longrunning.Operation], the + * state will be `READY`. If the index already exists, the call will return an + * `ALREADY_EXISTS` status. + * + * During index creation, the process could result in an error, in which + * case the index will move to the `ERROR` state. The process can be recovered + * by fixing the data that caused the error, removing the index with + * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then + * re-creating the index with [create] + * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. + * + * Indexes with a single property cannot be created. + * + * Sample code: + * ``` + * $datastoreAdminClient = new DatastoreAdminClient(); + * try { + * $operationResponse = $datastoreAdminClient->createIndex(); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $datastoreAdminClient->createIndex(); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $datastoreAdminClient->resumeOperation($operationName, 'createIndex'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $datastoreAdminClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $projectId + * Project ID against which to make the request. + * @type Index $index + * The index to create. The name and state fields are output only and will be + * ignored. Single property indexes cannot be created or deleted. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function createIndex(array $optionalArgs = []) + { + $request = new CreateIndexRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['projectId'])) { + $request->setProjectId($optionalArgs['projectId']); + $requestParamHeaders['project_id'] = $optionalArgs['projectId']; + } + + if (isset($optionalArgs['index'])) { + $request->setIndex($optionalArgs['index']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('CreateIndex', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Deletes an existing index. + * An index can only be deleted if it is in a `READY` or `ERROR` state. On + * successful execution of the request, the index will be in a `DELETING` + * [state][google.datastore.admin.v1.Index.State]. And on completion of the + * returned [google.longrunning.Operation][google.longrunning.Operation], the + * index will be removed. + * + * During index deletion, the process could result in an error, in which + * case the index will move to the `ERROR` state. The process can be recovered + * by fixing the data that caused the error, followed by calling + * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again. + * + * Sample code: + * ``` + * $datastoreAdminClient = new DatastoreAdminClient(); + * try { + * $operationResponse = $datastoreAdminClient->deleteIndex(); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $datastoreAdminClient->deleteIndex(); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $datastoreAdminClient->resumeOperation($operationName, 'deleteIndex'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $datastoreAdminClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $projectId + * Project ID against which to make the request. + * @type string $indexId + * The resource ID of the index to delete. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function deleteIndex(array $optionalArgs = []) + { + $request = new DeleteIndexRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['projectId'])) { + $request->setProjectId($optionalArgs['projectId']); + $requestParamHeaders['project_id'] = $optionalArgs['projectId']; + } + + if (isset($optionalArgs['indexId'])) { + $request->setIndexId($optionalArgs['indexId']); + $requestParamHeaders['index_id'] = $optionalArgs['indexId']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('DeleteIndex', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Exports a copy of all or a subset of entities from Google Cloud Datastore + * to another storage system, such as Google Cloud Storage. Recent updates to + * entities may not be reflected in the export. The export occurs in the + * background and its progress can be monitored and managed via the + * Operation resource that is created. The output of an export may only be + * used once the associated operation is done. If an export operation is + * cancelled before completion it may leave partial data behind in Google + * Cloud Storage. + * + * Sample code: + * ``` + * $datastoreAdminClient = new DatastoreAdminClient(); + * try { + * $projectId = 'project_id'; + * $outputUrlPrefix = 'output_url_prefix'; + * $operationResponse = $datastoreAdminClient->exportEntities($projectId, $outputUrlPrefix); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $datastoreAdminClient->exportEntities($projectId, $outputUrlPrefix); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $datastoreAdminClient->resumeOperation($operationName, 'exportEntities'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $datastoreAdminClient->close(); + * } + * ``` + * + * @param string $projectId Required. Project ID against which to make the request. + * @param string $outputUrlPrefix Required. Location for the export metadata and data files. + * + * The full resource URL of the external storage location. Currently, only + * Google Cloud Storage is supported. So output_url_prefix should be of the + * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the + * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud + * Storage namespace path (this is not a Cloud Datastore namespace). For more + * information about Cloud Storage namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * + * The resulting files will be nested deeper than the specified URL prefix. + * The final output URL will be provided in the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. + * + * By nesting the data files deeper, the same Cloud Storage bucket can be used + * in multiple ExportEntities operations without conflict. + * @param array $optionalArgs { + * Optional. + * + * @type array $labels + * Client-assigned labels. + * @type EntityFilter $entityFilter + * Description of what data from the project is included in the export. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function exportEntities($projectId, $outputUrlPrefix, array $optionalArgs = []) + { + $request = new ExportEntitiesRequest(); + $requestParamHeaders = []; + $request->setProjectId($projectId); + $request->setOutputUrlPrefix($outputUrlPrefix); + $requestParamHeaders['project_id'] = $projectId; + if (isset($optionalArgs['labels'])) { + $request->setLabels($optionalArgs['labels']); + } + + if (isset($optionalArgs['entityFilter'])) { + $request->setEntityFilter($optionalArgs['entityFilter']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ExportEntities', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Gets an index. + * + * Sample code: + * ``` + * $datastoreAdminClient = new DatastoreAdminClient(); + * try { + * $response = $datastoreAdminClient->getIndex(); + * } finally { + * $datastoreAdminClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $projectId + * Project ID against which to make the request. + * @type string $indexId + * The resource ID of the index to get. + * @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\Admin\V1\Index + * + * @throws ApiException if the remote call fails + */ + public function getIndex(array $optionalArgs = []) + { + $request = new GetIndexRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['projectId'])) { + $request->setProjectId($optionalArgs['projectId']); + $requestParamHeaders['project_id'] = $optionalArgs['projectId']; + } + + if (isset($optionalArgs['indexId'])) { + $request->setIndexId($optionalArgs['indexId']); + $requestParamHeaders['index_id'] = $optionalArgs['indexId']; + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('GetIndex', Index::class, $optionalArgs, $request)->wait(); + } + + /** + * Imports entities into Google Cloud Datastore. Existing entities with the + * same key are overwritten. The import occurs in the background and its + * progress can be monitored and managed via the Operation resource that is + * created. If an ImportEntities operation is cancelled, it is possible + * that a subset of the data has already been imported to Cloud Datastore. + * + * Sample code: + * ``` + * $datastoreAdminClient = new DatastoreAdminClient(); + * try { + * $projectId = 'project_id'; + * $inputUrl = 'input_url'; + * $operationResponse = $datastoreAdminClient->importEntities($projectId, $inputUrl); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $datastoreAdminClient->importEntities($projectId, $inputUrl); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $datastoreAdminClient->resumeOperation($operationName, 'importEntities'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * // operation succeeded and returns no value + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $datastoreAdminClient->close(); + * } + * ``` + * + * @param string $projectId Required. Project ID against which to make the request. + * @param string $inputUrl Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: + * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where + * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is + * an optional Cloud Storage namespace path (this is not a Cloud Datastore + * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written + * by the ExportEntities operation. For more information about Cloud Storage + * namespace paths, see + * [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * + * For more information, see + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. + * @param array $optionalArgs { + * Optional. + * + * @type array $labels + * Client-assigned labels. + * @type EntityFilter $entityFilter + * Optionally specify which kinds/namespaces are to be imported. If provided, + * the list must be a subset of the EntityFilter used in creating the export, + * otherwise a FAILED_PRECONDITION error will be returned. If no filter is + * specified then all entities from the export are imported. + * @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\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function importEntities($projectId, $inputUrl, array $optionalArgs = []) + { + $request = new ImportEntitiesRequest(); + $requestParamHeaders = []; + $request->setProjectId($projectId); + $request->setInputUrl($inputUrl); + $requestParamHeaders['project_id'] = $projectId; + if (isset($optionalArgs['labels'])) { + $request->setLabels($optionalArgs['labels']); + } + + if (isset($optionalArgs['entityFilter'])) { + $request->setEntityFilter($optionalArgs['entityFilter']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startOperationsCall('ImportEntities', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } + + /** + * Lists the indexes that match the specified filters. Datastore uses an + * eventually consistent query to fetch the list of indexes and may + * occasionally return stale results. + * + * Sample code: + * ``` + * $datastoreAdminClient = new DatastoreAdminClient(); + * try { + * // Iterate over pages of elements + * $pagedResponse = $datastoreAdminClient->listIndexes(); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $datastoreAdminClient->listIndexes(); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $datastoreAdminClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $projectId + * Project ID against which to make the request. + * @type string $filter + * @type int $pageSize + * The maximum number of resources contained in the underlying API + * response. The API may return fewer values in a page, even if + * there are additional values to be retrieved. + * @type string $pageToken + * A page token is used to specify a page of values to be returned. + * If no page token is specified (the default), the first page + * of values will be returned. Any page token used here must have + * been generated by a previous call to the API. + * @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\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listIndexes(array $optionalArgs = []) + { + $request = new ListIndexesRequest(); + $requestParamHeaders = []; + if (isset($optionalArgs['projectId'])) { + $request->setProjectId($optionalArgs['projectId']); + $requestParamHeaders['project_id'] = $optionalArgs['projectId']; + } + + if (isset($optionalArgs['filter'])) { + $request->setFilter($optionalArgs['filter']); + } + + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->getPagedListResponse('ListIndexes', $optionalArgs, ListIndexesResponse::class, $request); + } +} diff --git a/owl-bot-staging/DatastoreAdmin/v1/src/V1/gapic_metadata.json b/owl-bot-staging/DatastoreAdmin/v1/src/V1/gapic_metadata.json new file mode 100644 index 00000000000..3f24235779c --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/src/V1/gapic_metadata.json @@ -0,0 +1,48 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", + "language": "php", + "protoPackage": "google.datastore.admin.v1", + "libraryPackage": "Google\\Cloud\\Datastore\\Admin\\V1", + "services": { + "DatastoreAdmin": { + "clients": { + "grpc": { + "libraryClient": "DatastoreAdminGapicClient", + "rpcs": { + "CreateIndex": { + "methods": [ + "createIndex" + ] + }, + "DeleteIndex": { + "methods": [ + "deleteIndex" + ] + }, + "ExportEntities": { + "methods": [ + "exportEntities" + ] + }, + "GetIndex": { + "methods": [ + "getIndex" + ] + }, + "ImportEntities": { + "methods": [ + "importEntities" + ] + }, + "ListIndexes": { + "methods": [ + "listIndexes" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_client_config.json b/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_client_config.json new file mode 100644 index 00000000000..42085b1e5e2 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_client_config.json @@ -0,0 +1,75 @@ +{ + "interfaces": { + "google.datastore.admin.v1.DatastoreAdmin": { + "retry_codes": { + "no_retry_codes": [], + "no_retry_1_codes": [], + "retry_policy_1_codes": [ + "UNAVAILABLE", + "DEADLINE_EXCEEDED" + ] + }, + "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 + }, + "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 + }, + "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 + } + }, + "methods": { + "CreateIndex": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "DeleteIndex": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ExportEntities": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetIndex": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "ImportEntities": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListIndexes": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + } + } + } + } +} diff --git a/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_descriptor_config.php b/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_descriptor_config.php new file mode 100644 index 00000000000..e2891b13099 --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_descriptor_config.php @@ -0,0 +1,128 @@ + [ + 'google.datastore.admin.v1.DatastoreAdmin' => [ + 'CreateIndex' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Datastore\Admin\V1\Index', + 'metadataReturnType' => '\Google\Cloud\Datastore\Admin\V1\IndexOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + ], + ], + 'DeleteIndex' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Datastore\Admin\V1\Index', + 'metadataReturnType' => '\Google\Cloud\Datastore\Admin\V1\IndexOperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + [ + 'keyName' => 'index_id', + 'fieldAccessors' => [ + 'getIndexId', + ], + ], + ], + ], + 'ExportEntities' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\Datastore\Admin\V1\ExportEntitiesResponse', + 'metadataReturnType' => '\Google\Cloud\Datastore\Admin\V1\ExportEntitiesMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + ], + ], + 'ImportEntities' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\Datastore\Admin\V1\ImportEntitiesMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + ], + ], + 'GetIndex' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\Datastore\Admin\V1\Index', + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + [ + 'keyName' => 'index_id', + 'fieldAccessors' => [ + 'getIndexId', + ], + ], + ], + ], + 'ListIndexes' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getIndexes', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\Datastore\Admin\V1\ListIndexesResponse', + 'headerParams' => [ + [ + 'keyName' => 'project_id', + 'fieldAccessors' => [ + 'getProjectId', + ], + ], + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_rest_client_config.php b/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_rest_client_config.php new file mode 100644 index 00000000000..08331544a7e --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_rest_client_config.php @@ -0,0 +1,134 @@ + [ + 'google.datastore.admin.v1.DatastoreAdmin' => [ + 'CreateIndex' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project_id}/indexes', + 'body' => 'index', + 'placeholders' => [ + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + 'DeleteIndex' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/projects/{project_id}/indexes/{index_id}', + 'placeholders' => [ + 'index_id' => [ + 'getters' => [ + 'getIndexId', + ], + ], + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + 'ExportEntities' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project_id}:export', + 'body' => '*', + 'placeholders' => [ + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + 'GetIndex' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/projects/{project_id}/indexes/{index_id}', + 'placeholders' => [ + 'index_id' => [ + 'getters' => [ + 'getIndexId', + ], + ], + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + 'ImportEntities' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/projects/{project_id}:import', + 'body' => '*', + 'placeholders' => [ + 'project_id' => [ + 'getters' => [ + 'getProjectId', + ], + ], + ], + ], + 'ListIndexes' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/projects/{project_id}/indexes', + '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/DatastoreAdmin/v1/tests/Unit/V1/Client/DatastoreAdminClientTest.php b/owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/Client/DatastoreAdminClientTest.php new file mode 100644 index 00000000000..f183c3c2f2c --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/Client/DatastoreAdminClientTest.php @@ -0,0 +1,757 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DatastoreAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DatastoreAdminClient($options); + } + + /** @test */ + public function createIndexTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $projectId2 = 'projectId2939242356'; + $indexId = 'indexId112508840'; + $kind = 'kind3292052'; + $expectedResponse = new Index(); + $expectedResponse->setProjectId($projectId2); + $expectedResponse->setIndexId($indexId); + $expectedResponse->setKind($kind); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createIndexTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + $request = new CreateIndexRequest(); + $response = $gapicClient->createIndex($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/CreateIndex', $actualApiFuncCall); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createIndexTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createIndexExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + $request = new CreateIndexRequest(); + $response = $gapicClient->createIndex($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createIndexTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteIndexTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $projectId2 = 'projectId2939242356'; + $indexId2 = 'indexId2746815835'; + $kind = 'kind3292052'; + $expectedResponse = new Index(); + $expectedResponse->setProjectId($projectId2); + $expectedResponse->setIndexId($indexId2); + $expectedResponse->setKind($kind); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteIndexTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + $request = new DeleteIndexRequest(); + $response = $gapicClient->deleteIndex($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/DeleteIndex', $actualApiFuncCall); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteIndexTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteIndexExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + $request = new DeleteIndexRequest(); + $response = $gapicClient->deleteIndex($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteIndexTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportEntitiesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $outputUrl = 'outputUrl-1273518799'; + $expectedResponse = new ExportEntitiesResponse(); + $expectedResponse->setOutputUrl($outputUrl); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportEntitiesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $projectId = 'projectId-1969970175'; + $outputUrlPrefix = 'outputUrlPrefix1058210144'; + $request = (new ExportEntitiesRequest()) + ->setProjectId($projectId) + ->setOutputUrlPrefix($outputUrlPrefix); + $response = $gapicClient->exportEntities($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/ExportEntities', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualApiRequestObject->getOutputUrlPrefix(); + $this->assertProtobufEquals($outputUrlPrefix, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportEntitiesTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportEntitiesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $outputUrlPrefix = 'outputUrlPrefix1058210144'; + $request = (new ExportEntitiesRequest()) + ->setProjectId($projectId) + ->setOutputUrlPrefix($outputUrlPrefix); + $response = $gapicClient->exportEntities($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportEntitiesTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getIndexTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $projectId2 = 'projectId2939242356'; + $indexId2 = 'indexId2746815835'; + $kind = 'kind3292052'; + $expectedResponse = new Index(); + $expectedResponse->setProjectId($projectId2); + $expectedResponse->setIndexId($indexId2); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + $request = new GetIndexRequest(); + $response = $gapicClient->getIndex($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.admin.v1.DatastoreAdmin/GetIndex', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIndexExceptionTest() + { + $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); + $request = new GetIndexRequest(); + try { + $gapicClient->getIndex($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 importEntitiesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importEntitiesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $projectId = 'projectId-1969970175'; + $inputUrl = 'inputUrl1707300730'; + $request = (new ImportEntitiesRequest()) + ->setProjectId($projectId) + ->setInputUrl($inputUrl); + $response = $gapicClient->importEntities($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/ImportEntities', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualApiRequestObject->getInputUrl(); + $this->assertProtobufEquals($inputUrl, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importEntitiesTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importEntitiesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $inputUrl = 'inputUrl1707300730'; + $request = (new ImportEntitiesRequest()) + ->setProjectId($projectId) + ->setInputUrl($inputUrl); + $response = $gapicClient->importEntities($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importEntitiesTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listIndexesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $indexesElement = new Index(); + $indexes = [ + $indexesElement, + ]; + $expectedResponse = new ListIndexesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setIndexes($indexes); + $transport->addResponse($expectedResponse); + $request = new ListIndexesRequest(); + $response = $gapicClient->listIndexes($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getIndexes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/ListIndexes', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listIndexesExceptionTest() + { + $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); + $request = new ListIndexesRequest(); + try { + $gapicClient->listIndexes($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 createIndexAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $projectId2 = 'projectId2939242356'; + $indexId = 'indexId112508840'; + $kind = 'kind3292052'; + $expectedResponse = new Index(); + $expectedResponse->setProjectId($projectId2); + $expectedResponse->setIndexId($indexId); + $expectedResponse->setKind($kind); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createIndexTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + $request = new CreateIndexRequest(); + $response = $gapicClient->createIndexAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/CreateIndex', $actualApiFuncCall); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createIndexTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/DatastoreAdminClientTest.php b/owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/DatastoreAdminClientTest.php new file mode 100644 index 00000000000..64af0e10aeb --- /dev/null +++ b/owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/DatastoreAdminClientTest.php @@ -0,0 +1,666 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return DatastoreAdminClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new DatastoreAdminClient($options); + } + + /** @test */ + public function createIndexTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $projectId2 = 'projectId2939242356'; + $indexId = 'indexId112508840'; + $kind = 'kind3292052'; + $expectedResponse = new Index(); + $expectedResponse->setProjectId($projectId2); + $expectedResponse->setIndexId($indexId); + $expectedResponse->setKind($kind); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createIndexTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + $response = $gapicClient->createIndex(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/CreateIndex', $actualApiFuncCall); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createIndexTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createIndexExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + $response = $gapicClient->createIndex(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createIndexTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteIndexTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $projectId2 = 'projectId2939242356'; + $indexId2 = 'indexId2746815835'; + $kind = 'kind3292052'; + $expectedResponse = new Index(); + $expectedResponse->setProjectId($projectId2); + $expectedResponse->setIndexId($indexId2); + $expectedResponse->setKind($kind); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteIndexTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + $response = $gapicClient->deleteIndex(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/DeleteIndex', $actualApiFuncCall); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteIndexTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteIndexExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteIndexTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + $response = $gapicClient->deleteIndex(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteIndexTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportEntitiesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $outputUrl = 'outputUrl-1273518799'; + $expectedResponse = new ExportEntitiesResponse(); + $expectedResponse->setOutputUrl($outputUrl); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/exportEntitiesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $projectId = 'projectId-1969970175'; + $outputUrlPrefix = 'outputUrlPrefix1058210144'; + $response = $gapicClient->exportEntities($projectId, $outputUrlPrefix); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/ExportEntities', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualApiRequestObject->getOutputUrlPrefix(); + $this->assertProtobufEquals($outputUrlPrefix, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportEntitiesTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function exportEntitiesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/exportEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $outputUrlPrefix = 'outputUrlPrefix1058210144'; + $response = $gapicClient->exportEntities($projectId, $outputUrlPrefix); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/exportEntitiesTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getIndexTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $projectId2 = 'projectId2939242356'; + $indexId2 = 'indexId2746815835'; + $kind = 'kind3292052'; + $expectedResponse = new Index(); + $expectedResponse->setProjectId($projectId2); + $expectedResponse->setIndexId($indexId2); + $expectedResponse->setKind($kind); + $transport->addResponse($expectedResponse); + $response = $gapicClient->getIndex(); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/GetIndex', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getIndexExceptionTest() + { + $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); + try { + $gapicClient->getIndex(); + // 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 importEntitiesTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/importEntitiesTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $projectId = 'projectId-1969970175'; + $inputUrl = 'inputUrl1707300730'; + $response = $gapicClient->importEntities($projectId, $inputUrl); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/ImportEntities', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getProjectId(); + $this->assertProtobufEquals($projectId, $actualValue); + $actualValue = $actualApiRequestObject->getInputUrl(); + $this->assertProtobufEquals($inputUrl, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importEntitiesTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function importEntitiesExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/importEntitiesTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $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); + $operationsTransport->addResponse(null, $status); + // Mock request + $projectId = 'projectId-1969970175'; + $inputUrl = 'inputUrl1707300730'; + $response = $gapicClient->importEntities($projectId, $inputUrl); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/importEntitiesTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() 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 stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function listIndexesTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $indexesElement = new Index(); + $indexes = [ + $indexesElement, + ]; + $expectedResponse = new ListIndexesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setIndexes($indexes); + $transport->addResponse($expectedResponse); + $response = $gapicClient->listIndexes(); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getIndexes()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/ListIndexes', $actualFuncCall); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listIndexesExceptionTest() + { + $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); + try { + $gapicClient->listIndexes(); + // 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 7d388eb75e18f5bb2cc5e0f7e0c838027ba69ec2 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 28 Jul 2023 14:01:46 +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 --- .../V1/DatastoreAdminClient/create_index.php | 6 +- .../V1/DatastoreAdminClient/delete_index.php | 3 +- .../DatastoreAdminClient/export_entities.php | 4 +- .../DatastoreAdminClient/import_entities.php | 5 +- .../BaseClient/DatastoreAdminBaseClient.php | 61 +- .../src/V1/ExportEntitiesRequest.php | 20 +- .../V1/Gapic/DatastoreAdminGapicClient.php | 70 +- DatastoreAdmin/src/V1/GetIndexRequest.php | 3 +- .../src/V1/ImportEntitiesMetadata.php | 16 +- .../src/V1/ImportEntitiesRequest.php | 25 +- DatastoreAdmin/src/V1/Index.php | 20 +- .../src/V1/Index/IndexedProperty.php | 12 +- .../Datastore/Admin/V1/DatastoreAdmin.php | Bin 5468 -> 0 bytes .../Google/Datastore/Admin/V1/Index.php | Bin 1509 -> 0 bytes .../Google/Datastore/Admin/V1/Migration.php | Bin 1926 -> 0 bytes .../Datastore/Admin/V1/CommonMetadata.php | 231 ------ .../Admin/V1/CommonMetadata/State.php | 101 --- .../Datastore/Admin/V1/CreateIndexRequest.php | 116 --- .../DatastoreFirestoreMigrationMetadata.php | 114 --- .../Datastore/Admin/V1/DeleteIndexRequest.php | 102 --- .../Cloud/Datastore/Admin/V1/EntityFilter.php | 134 --- .../Admin/V1/ExportEntitiesMetadata.php | 259 ------ .../Admin/V1/ExportEntitiesRequest.php | 272 ------- .../Admin/V1/ExportEntitiesResponse.php | 80 -- .../Datastore/Admin/V1/GetIndexRequest.php | 102 --- .../Admin/V1/ImportEntitiesMetadata.php | 255 ------ .../Admin/V1/ImportEntitiesRequest.php | 275 ------- .../Google/Cloud/Datastore/Admin/V1/Index.php | 249 ------ .../Datastore/Admin/V1/Index/AncestorMode.php | 65 -- .../Datastore/Admin/V1/Index/Direction.php | 66 -- .../Admin/V1/Index/IndexedProperty.php | 108 --- .../Cloud/Datastore/Admin/V1/Index/State.php | 91 --- .../Admin/V1/IndexOperationMetadata.php | 155 ---- .../Datastore/Admin/V1/ListIndexesRequest.php | 167 ---- .../Admin/V1/ListIndexesResponse.php | 102 --- .../Admin/V1/MigrationProgressEvent.php | 152 ---- .../ConcurrencyMode.php | 71 -- .../PrepareStepDetails.php | 74 -- .../RedirectWritesStepDetails.php | 70 -- .../Datastore/Admin/V1/MigrationState.php | 68 -- .../Admin/V1/MigrationStateEvent.php | 69 -- .../Datastore/Admin/V1/MigrationStep.php | 97 --- .../Datastore/Admin/V1/OperationType.php | 75 -- .../Cloud/Datastore/Admin/V1/Progress.php | 109 --- .../V1/DatastoreAdminClient/create_index.php | 82 -- .../V1/DatastoreAdminClient/delete_index.php | 79 -- .../DatastoreAdminClient/export_entities.php | 109 --- .../V1/DatastoreAdminClient/get_index.php | 57 -- .../DatastoreAdminClient/import_entities.php | 99 --- .../V1/DatastoreAdminClient/list_indexes.php | 64 -- .../BaseClient/DatastoreAdminBaseClient.php | 449 ---------- .../v1/src/V1/Client/DatastoreAdminClient.php | 40 - .../v1/src/V1/DatastoreAdminClient.php | 34 - .../V1/Gapic/DatastoreAdminGapicClient.php | 769 ------------------ .../v1/src/V1/gapic_metadata.json | 48 -- .../datastore_admin_client_config.json | 75 -- .../datastore_admin_descriptor_config.php | 128 --- .../datastore_admin_rest_client_config.php | 134 --- .../V1/Client/DatastoreAdminClientTest.php | 757 ----------------- .../Unit/V1/DatastoreAdminClientTest.php | 666 --------------- 60 files changed, 126 insertions(+), 7538 deletions(-) delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/DatastoreAdmin.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/Index.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/Migration.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CommonMetadata.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CommonMetadata/State.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CreateIndexRequest.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DatastoreFirestoreMigrationMetadata.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DeleteIndexRequest.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/EntityFilter.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesMetadata.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesRequest.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesResponse.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/GetIndexRequest.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesMetadata.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesRequest.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/AncestorMode.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/Direction.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/IndexedProperty.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/State.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/IndexOperationMetadata.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesRequest.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesResponse.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/ConcurrencyMode.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/PrepareStepDetails.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/RedirectWritesStepDetails.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationState.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStateEvent.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStep.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/OperationType.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Progress.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/create_index.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/delete_index.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/export_entities.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/get_index.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/import_entities.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/list_indexes.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/BaseClient/DatastoreAdminBaseClient.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/DatastoreAdminClient.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/DatastoreAdminClient.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/Gapic/DatastoreAdminGapicClient.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_client_config.json delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_descriptor_config.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_rest_client_config.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/Client/DatastoreAdminClientTest.php delete mode 100644 owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/DatastoreAdminClientTest.php diff --git a/DatastoreAdmin/samples/V1/DatastoreAdminClient/create_index.php b/DatastoreAdmin/samples/V1/DatastoreAdminClient/create_index.php index 5ec7eaa0313..fe33987ee1b 100644 --- a/DatastoreAdmin/samples/V1/DatastoreAdminClient/create_index.php +++ b/DatastoreAdmin/samples/V1/DatastoreAdminClient/create_index.php @@ -33,9 +33,9 @@ /** * Creates the specified index. * A newly created index's initial state is `CREATING`. On completion of the - * returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`. - * If the index already exists, the call will return an `ALREADY_EXISTS` - * status. + * returned [google.longrunning.Operation][google.longrunning.Operation], the + * state will be `READY`. If the index already exists, the call will return an + * `ALREADY_EXISTS` status. * * During index creation, the process could result in an error, in which * case the index will move to the `ERROR` state. The process can be recovered diff --git a/DatastoreAdmin/samples/V1/DatastoreAdminClient/delete_index.php b/DatastoreAdmin/samples/V1/DatastoreAdminClient/delete_index.php index 27575e752c6..0d552407b89 100644 --- a/DatastoreAdmin/samples/V1/DatastoreAdminClient/delete_index.php +++ b/DatastoreAdmin/samples/V1/DatastoreAdminClient/delete_index.php @@ -35,7 +35,8 @@ * An index can only be deleted if it is in a `READY` or `ERROR` state. On * successful execution of the request, the index will be in a `DELETING` * [state][google.datastore.admin.v1.Index.State]. And on completion of the - * returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed. + * returned [google.longrunning.Operation][google.longrunning.Operation], the + * index will be removed. * * During index deletion, the process could result in an error, in which * case the index will move to the `ERROR` state. The process can be recovered diff --git a/DatastoreAdmin/samples/V1/DatastoreAdminClient/export_entities.php b/DatastoreAdmin/samples/V1/DatastoreAdminClient/export_entities.php index ba7f2efa4c4..7c692cc06c6 100644 --- a/DatastoreAdmin/samples/V1/DatastoreAdminClient/export_entities.php +++ b/DatastoreAdmin/samples/V1/DatastoreAdminClient/export_entities.php @@ -54,8 +54,8 @@ * * The resulting files will be nested deeper than the specified URL prefix. * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That - * value should be used for subsequent ImportEntities operations. + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. * * By nesting the data files deeper, the same Cloud Storage bucket can be used * in multiple ExportEntities operations without conflict. diff --git a/DatastoreAdmin/samples/V1/DatastoreAdminClient/import_entities.php b/DatastoreAdmin/samples/V1/DatastoreAdminClient/import_entities.php index 7772be8baa1..e96bbfd1ecb 100644 --- a/DatastoreAdmin/samples/V1/DatastoreAdminClient/import_entities.php +++ b/DatastoreAdmin/samples/V1/DatastoreAdminClient/import_entities.php @@ -37,8 +37,9 @@ * that a subset of the data has already been imported to Cloud Datastore. * * @param string $projectId Project ID against which to make the request. - * @param string $inputUrl The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So input_url should be of the form: + * @param string $inputUrl The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is * an optional Cloud Storage namespace path (this is not a Cloud Datastore diff --git a/DatastoreAdmin/src/V1/Client/BaseClient/DatastoreAdminBaseClient.php b/DatastoreAdmin/src/V1/Client/BaseClient/DatastoreAdminBaseClient.php index d593ea73bc1..7a3be504fdc 100644 --- a/DatastoreAdmin/src/V1/Client/BaseClient/DatastoreAdminBaseClient.php +++ b/DatastoreAdmin/src/V1/Client/BaseClient/DatastoreAdminBaseClient.php @@ -47,14 +47,10 @@ /** * Service Description: Google Cloud Datastore Admin API * - * * The Datastore Admin API provides several admin services for Cloud Datastore. * - * ----------------------------------------------------------------------------- - * ## Concepts - * - * Project, namespace, kind, and entity as defined in the Google Cloud Datastore - * API. + * Concepts: Project, namespace, kind, and entity as defined in the Google Cloud + * Datastore API. * * Operation: An Operation represents work being performed in the background. * @@ -62,50 +58,40 @@ * specified as a combination of kinds and namespaces (either or both of which * may be all). * - * ----------------------------------------------------------------------------- - * ## Services - * - * # Export/Import + * Export/Import Service: * - * The Export/Import service provides the ability to copy all or a subset of + * - The Export/Import service provides the ability to copy all or a subset of * entities to/from Google Cloud Storage. - * - * Exported data may be imported into Cloud Datastore for any Google Cloud + * - Exported data may be imported into Cloud Datastore for any Google Cloud * Platform project. It is not restricted to the export source project. It is * possible to export from one project and then import into another. - * - * Exported data can also be loaded into Google BigQuery for analysis. - * - * Exports and imports are performed asynchronously. An Operation resource is + * - Exported data can also be loaded into Google BigQuery for analysis. + * - Exports and imports are performed asynchronously. An Operation resource is * created for each export/import. The state (including any errors encountered) * of the export/import may be queried via the Operation resource. * - * # Index + * Index Service: * - * The index service manages Cloud Datastore composite indexes. - * - * Index creation and deletion are performed asynchronously. + * - The index service manages Cloud Datastore composite indexes. + * - Index creation and deletion are performed asynchronously. * An Operation resource is created for each such asynchronous operation. * The state of the operation (including any errors encountered) * may be queried via the Operation resource. * - * # Operation + * Operation Service: * - * The Operations collection provides a record of actions performed for the + * - The Operations collection provides a record of actions performed for the * specified project (including any operations in progress). Operations are not * created directly but through calls on other collections or resources. - * - * An operation that is not yet done may be cancelled. The request to cancel is - * asynchronous and the operation may continue to run for some time after the + * - An operation that is not yet done may be cancelled. The request to cancel + * is asynchronous and the operation may continue to run for some time after the * request to cancel is made. - * - * An operation that is done may be deleted so that it is no longer listed as + * - An operation that is done may be deleted so that it is no longer listed as * part of the Operation collection. - * - * ListOperations returns all pending operations, but not completed operations. - * - * Operations are created by service DatastoreAdmin, - * but are accessed via service google.longrunning.Operations. + * - ListOperations returns all pending operations, but not completed + * operations. + * - Operations are created by service DatastoreAdmin, but are accessed via + * service google.longrunning.Operations. * * This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. @@ -272,9 +258,9 @@ public function __call($method, $args) /** * Creates the specified index. * A newly created index's initial state is `CREATING`. On completion of the - * returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`. - * If the index already exists, the call will return an `ALREADY_EXISTS` - * status. + * returned [google.longrunning.Operation][google.longrunning.Operation], the + * state will be `READY`. If the index already exists, the call will return an + * `ALREADY_EXISTS` status. * * During index creation, the process could result in an error, in which * case the index will move to the `ERROR` state. The process can be recovered @@ -313,7 +299,8 @@ public function createIndex(CreateIndexRequest $request, array $callOptions = [] * An index can only be deleted if it is in a `READY` or `ERROR` state. On * successful execution of the request, the index will be in a `DELETING` * [state][google.datastore.admin.v1.Index.State]. And on completion of the - * returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed. + * returned [google.longrunning.Operation][google.longrunning.Operation], the + * index will be removed. * * During index deletion, the process could result in an error, in which * case the index will move to the `ERROR` state. The process can be recovered diff --git a/DatastoreAdmin/src/V1/ExportEntitiesRequest.php b/DatastoreAdmin/src/V1/ExportEntitiesRequest.php index be1174fa6fb..ec36929de01 100644 --- a/DatastoreAdmin/src/V1/ExportEntitiesRequest.php +++ b/DatastoreAdmin/src/V1/ExportEntitiesRequest.php @@ -46,8 +46,8 @@ class ExportEntitiesRequest extends \Google\Protobuf\Internal\Message * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). * The resulting files will be nested deeper than the specified URL prefix. * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That - * value should be used for subsequent ImportEntities operations. + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. * By nesting the data files deeper, the same Cloud Storage bucket can be used * in multiple ExportEntities operations without conflict. * @@ -72,8 +72,8 @@ class ExportEntitiesRequest extends \Google\Protobuf\Internal\Message * * The resulting files will be nested deeper than the specified URL prefix. * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That - * value should be used for subsequent ImportEntities operations. + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. * * By nesting the data files deeper, the same Cloud Storage bucket can be used * in multiple ExportEntities operations without conflict. @@ -115,8 +115,8 @@ public static function build(string $projectId, array $labels, \Google\Cloud\Dat * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). * The resulting files will be nested deeper than the specified URL prefix. * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That - * value should be used for subsequent ImportEntities operations. + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. * By nesting the data files deeper, the same Cloud Storage bucket can be used * in multiple ExportEntities operations without conflict. * } @@ -226,8 +226,8 @@ public function setEntityFilter($var) * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). * The resulting files will be nested deeper than the specified URL prefix. * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That - * value should be used for subsequent ImportEntities operations. + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. * By nesting the data files deeper, the same Cloud Storage bucket can be used * in multiple ExportEntities operations without conflict. * @@ -251,8 +251,8 @@ public function getOutputUrlPrefix() * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). * The resulting files will be nested deeper than the specified URL prefix. * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That - * value should be used for subsequent ImportEntities operations. + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. * By nesting the data files deeper, the same Cloud Storage bucket can be used * in multiple ExportEntities operations without conflict. * diff --git a/DatastoreAdmin/src/V1/Gapic/DatastoreAdminGapicClient.php b/DatastoreAdmin/src/V1/Gapic/DatastoreAdminGapicClient.php index 35a28a2d9f3..d8cae387ec7 100644 --- a/DatastoreAdmin/src/V1/Gapic/DatastoreAdminGapicClient.php +++ b/DatastoreAdmin/src/V1/Gapic/DatastoreAdminGapicClient.php @@ -49,14 +49,10 @@ /** * Service Description: Google Cloud Datastore Admin API * - * * The Datastore Admin API provides several admin services for Cloud Datastore. * - * ----------------------------------------------------------------------------- - * ## Concepts - * - * Project, namespace, kind, and entity as defined in the Google Cloud Datastore - * API. + * Concepts: Project, namespace, kind, and entity as defined in the Google Cloud + * Datastore API. * * Operation: An Operation represents work being performed in the background. * @@ -64,50 +60,40 @@ * specified as a combination of kinds and namespaces (either or both of which * may be all). * - * ----------------------------------------------------------------------------- - * ## Services - * - * # Export/Import + * Export/Import Service: * - * The Export/Import service provides the ability to copy all or a subset of + * - The Export/Import service provides the ability to copy all or a subset of * entities to/from Google Cloud Storage. - * - * Exported data may be imported into Cloud Datastore for any Google Cloud + * - Exported data may be imported into Cloud Datastore for any Google Cloud * Platform project. It is not restricted to the export source project. It is * possible to export from one project and then import into another. - * - * Exported data can also be loaded into Google BigQuery for analysis. - * - * Exports and imports are performed asynchronously. An Operation resource is + * - Exported data can also be loaded into Google BigQuery for analysis. + * - Exports and imports are performed asynchronously. An Operation resource is * created for each export/import. The state (including any errors encountered) * of the export/import may be queried via the Operation resource. * - * # Index + * Index Service: * - * The index service manages Cloud Datastore composite indexes. - * - * Index creation and deletion are performed asynchronously. + * - The index service manages Cloud Datastore composite indexes. + * - Index creation and deletion are performed asynchronously. * An Operation resource is created for each such asynchronous operation. * The state of the operation (including any errors encountered) * may be queried via the Operation resource. * - * # Operation + * Operation Service: * - * The Operations collection provides a record of actions performed for the + * - The Operations collection provides a record of actions performed for the * specified project (including any operations in progress). Operations are not * created directly but through calls on other collections or resources. - * - * An operation that is not yet done may be cancelled. The request to cancel is - * asynchronous and the operation may continue to run for some time after the + * - An operation that is not yet done may be cancelled. The request to cancel + * is asynchronous and the operation may continue to run for some time after the * request to cancel is made. - * - * An operation that is done may be deleted so that it is no longer listed as + * - An operation that is done may be deleted so that it is no longer listed as * part of the Operation collection. - * - * ListOperations returns all pending operations, but not completed operations. - * - * Operations are created by service DatastoreAdmin, - * but are accessed via service google.longrunning.Operations. + * - ListOperations returns all pending operations, but not completed + * operations. + * - Operations are created by service DatastoreAdmin, but are accessed via + * service google.longrunning.Operations. * * This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: @@ -298,9 +284,9 @@ public function __construct(array $options = []) /** * Creates the specified index. * A newly created index's initial state is `CREATING`. On completion of the - * returned [google.longrunning.Operation][google.longrunning.Operation], the state will be `READY`. - * If the index already exists, the call will return an `ALREADY_EXISTS` - * status. + * returned [google.longrunning.Operation][google.longrunning.Operation], the + * state will be `READY`. If the index already exists, the call will return an + * `ALREADY_EXISTS` status. * * During index creation, the process could result in an error, in which * case the index will move to the `ERROR` state. The process can be recovered @@ -396,7 +382,8 @@ public function createIndex(array $optionalArgs = []) * An index can only be deleted if it is in a `READY` or `ERROR` state. On * successful execution of the request, the index will be in a `DELETING` * [state][google.datastore.admin.v1.Index.State]. And on completion of the - * returned [google.longrunning.Operation][google.longrunning.Operation], the index will be removed. + * returned [google.longrunning.Operation][google.longrunning.Operation], the + * index will be removed. * * During index deletion, the process could result in an error, in which * case the index will move to the `ERROR` state. The process can be recovered @@ -544,8 +531,8 @@ public function deleteIndex(array $optionalArgs = []) * * The resulting files will be nested deeper than the specified URL prefix. * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. That - * value should be used for subsequent ImportEntities operations. + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. That value should be used for subsequent ImportEntities operations. * * By nesting the data files deeper, the same Cloud Storage bucket can be used * in multiple ExportEntities operations without conflict. @@ -699,8 +686,9 @@ public function getIndex(array $optionalArgs = []) * ``` * * @param string $projectId Required. Project ID against which to make the request. - * @param string $inputUrl Required. The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So input_url should be of the form: + * @param string $inputUrl Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is * an optional Cloud Storage namespace path (this is not a Cloud Datastore diff --git a/DatastoreAdmin/src/V1/GetIndexRequest.php b/DatastoreAdmin/src/V1/GetIndexRequest.php index 0824402d3cf..d97b3525f0d 100644 --- a/DatastoreAdmin/src/V1/GetIndexRequest.php +++ b/DatastoreAdmin/src/V1/GetIndexRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [google.datastore.admin.v1.DatastoreAdmin.GetIndex][google.datastore.admin.v1.DatastoreAdmin.GetIndex]. + * The request for + * [google.datastore.admin.v1.DatastoreAdmin.GetIndex][google.datastore.admin.v1.DatastoreAdmin.GetIndex]. * * Generated from protobuf message google.datastore.admin.v1.GetIndexRequest */ diff --git a/DatastoreAdmin/src/V1/ImportEntitiesMetadata.php b/DatastoreAdmin/src/V1/ImportEntitiesMetadata.php index 0a76f623c74..f2145117d55 100644 --- a/DatastoreAdmin/src/V1/ImportEntitiesMetadata.php +++ b/DatastoreAdmin/src/V1/ImportEntitiesMetadata.php @@ -41,7 +41,9 @@ class ImportEntitiesMetadata extends \Google\Protobuf\Internal\Message private $entity_filter = null; /** * The location of the import metadata file. This will be the same value as - * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. + * the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. * * Generated from protobuf field string input_url = 5; */ @@ -63,7 +65,9 @@ class ImportEntitiesMetadata extends \Google\Protobuf\Internal\Message * Description of which entities are being imported. * @type string $input_url * The location of the import metadata file. This will be the same value as - * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. + * the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. * } */ public function __construct($data = NULL) { @@ -217,7 +221,9 @@ public function setEntityFilter($var) /** * The location of the import metadata file. This will be the same value as - * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. + * the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. * * Generated from protobuf field string input_url = 5; * @return string @@ -229,7 +235,9 @@ public function getInputUrl() /** * The location of the import metadata file. This will be the same value as - * the [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] field. + * the + * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] + * field. * * Generated from protobuf field string input_url = 5; * @param string $var diff --git a/DatastoreAdmin/src/V1/ImportEntitiesRequest.php b/DatastoreAdmin/src/V1/ImportEntitiesRequest.php index cf4ef7b00da..181a6db242a 100644 --- a/DatastoreAdmin/src/V1/ImportEntitiesRequest.php +++ b/DatastoreAdmin/src/V1/ImportEntitiesRequest.php @@ -29,8 +29,9 @@ class ImportEntitiesRequest extends \Google\Protobuf\Internal\Message */ private $labels; /** - * Required. The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So input_url should be of the form: + * Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is * an optional Cloud Storage namespace path (this is not a Cloud Datastore @@ -58,8 +59,9 @@ class ImportEntitiesRequest extends \Google\Protobuf\Internal\Message /** * @param string $projectId Required. Project ID against which to make the request. * @param array $labels Client-assigned labels. - * @param string $inputUrl Required. The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So input_url should be of the form: + * @param string $inputUrl Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is * an optional Cloud Storage namespace path (this is not a Cloud Datastore @@ -100,8 +102,9 @@ public static function build(string $projectId, array $labels, string $inputUrl, * @type array|\Google\Protobuf\Internal\MapField $labels * Client-assigned labels. * @type string $input_url - * Required. The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So input_url should be of the form: + * Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is * an optional Cloud Storage namespace path (this is not a Cloud Datastore @@ -177,8 +180,9 @@ public function setLabels($var) } /** - * Required. The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So input_url should be of the form: + * Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is * an optional Cloud Storage namespace path (this is not a Cloud Datastore @@ -199,8 +203,9 @@ public function getInputUrl() } /** - * Required. The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So input_url should be of the form: + * Required. The full resource URL of the external storage location. + * Currently, only Google Cloud Storage is supported. So input_url should be + * of the form: * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is * an optional Cloud Storage namespace path (this is not a Cloud Datastore diff --git a/DatastoreAdmin/src/V1/Index.php b/DatastoreAdmin/src/V1/Index.php index c854e4d2088..0af669c3ead 100644 --- a/DatastoreAdmin/src/V1/Index.php +++ b/DatastoreAdmin/src/V1/Index.php @@ -34,13 +34,16 @@ class Index extends \Google\Protobuf\Internal\Message */ private $kind = ''; /** - * Required. The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED. + * Required. The index's ancestor mode. Must not be + * ANCESTOR_MODE_UNSPECIFIED. * * Generated from protobuf field .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; */ private $ancestor = 0; /** * Required. An ordered sequence of property names and their index attributes. + * Requires: + * * A maximum of 100 properties. * * Generated from protobuf field repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; */ @@ -65,9 +68,12 @@ class Index extends \Google\Protobuf\Internal\Message * @type string $kind * Required. The entity kind to which this index applies. * @type int $ancestor - * Required. The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED. + * Required. The index's ancestor mode. Must not be + * ANCESTOR_MODE_UNSPECIFIED. * @type array<\Google\Cloud\Datastore\Admin\V1\Index\IndexedProperty>|\Google\Protobuf\Internal\RepeatedField $properties * Required. An ordered sequence of property names and their index attributes. + * Requires: + * * A maximum of 100 properties. * @type int $state * Output only. The state of the index. * } @@ -156,7 +162,8 @@ public function setKind($var) } /** - * Required. The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED. + * Required. The index's ancestor mode. Must not be + * ANCESTOR_MODE_UNSPECIFIED. * * Generated from protobuf field .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; * @return int @@ -167,7 +174,8 @@ public function getAncestor() } /** - * Required. The index's ancestor mode. Must not be ANCESTOR_MODE_UNSPECIFIED. + * Required. The index's ancestor mode. Must not be + * ANCESTOR_MODE_UNSPECIFIED. * * Generated from protobuf field .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; * @param int $var @@ -183,6 +191,8 @@ public function setAncestor($var) /** * Required. An ordered sequence of property names and their index attributes. + * Requires: + * * A maximum of 100 properties. * * Generated from protobuf field repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\Internal\RepeatedField @@ -194,6 +204,8 @@ public function getProperties() /** * Required. An ordered sequence of property names and their index attributes. + * Requires: + * * A maximum of 100 properties. * * Generated from protobuf field repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; * @param array<\Google\Cloud\Datastore\Admin\V1\Index\IndexedProperty>|\Google\Protobuf\Internal\RepeatedField $var diff --git a/DatastoreAdmin/src/V1/Index/IndexedProperty.php b/DatastoreAdmin/src/V1/Index/IndexedProperty.php index 4804364853e..514514793ed 100644 --- a/DatastoreAdmin/src/V1/Index/IndexedProperty.php +++ b/DatastoreAdmin/src/V1/Index/IndexedProperty.php @@ -22,7 +22,8 @@ class IndexedProperty extends \Google\Protobuf\Internal\Message */ private $name = ''; /** - * Required. The indexed property's direction. Must not be DIRECTION_UNSPECIFIED. + * Required. The indexed property's direction. Must not be + * DIRECTION_UNSPECIFIED. * * Generated from protobuf field .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; */ @@ -37,7 +38,8 @@ class IndexedProperty extends \Google\Protobuf\Internal\Message * @type string $name * Required. The property name to index. * @type int $direction - * Required. The indexed property's direction. Must not be DIRECTION_UNSPECIFIED. + * Required. The indexed property's direction. Must not be + * DIRECTION_UNSPECIFIED. * } */ public function __construct($data = NULL) { @@ -72,7 +74,8 @@ public function setName($var) } /** - * Required. The indexed property's direction. Must not be DIRECTION_UNSPECIFIED. + * Required. The indexed property's direction. Must not be + * DIRECTION_UNSPECIFIED. * * Generated from protobuf field .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; * @return int @@ -83,7 +86,8 @@ public function getDirection() } /** - * Required. The indexed property's direction. Must not be DIRECTION_UNSPECIFIED. + * Required. The indexed property's direction. Must not be + * DIRECTION_UNSPECIFIED. * * Generated from protobuf field .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; * @param int $var diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/DatastoreAdmin.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/DatastoreAdmin.php deleted file mode 100644 index b83cde9487af95457e7c98cd6a8742c835835524..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5468 zcmeHLL2nyX5XN?$#xJdtY}Gc6)OK-NHHi{$6N;dlw&2*C$dc<=i5s<*rPaoMPL`~9 zm)++irpg7u0U94zn~XLgnxE(%h0Q$OEdz1Zt1S7n>x`oL;nDR zdMMU4!^L3YxNN;?R*7zzB2`#3t9W`w^lVbuTebxtJQM@JN)#8sq>?uYc1+Ev3$s%JMNMABx0j;_%x=(ZQtYm`luWYT%InuhIjx zjICEPrfE?WEYp?cc1&#(Cn;tP9h>BAIx9LhYRh;>+tV#)a8;f{o?XDRh7VrJ!ef0K zN*LlE+)BYRx1FYG>gIN3&88i2HrRMIly#_OqBZQ^?`Bmr|48?1CR3~N5?O(+n&wHR zDZYdLN+Ict?Ic|D6wA&x+&ksm5hTSIo$^JEHu93ik?-=05d}1xL;`p{fz%%{l+0R>2JP`w(1Kqoj51Pz_&O1Xm*B{E-*dCBu-0sgyNJx@I;)wUmD!X234D!M{wp`gSDsX#~ZYqHr0FZ&0bCf=3GsUb@DA4B^eO}2I1Nn3GdE-fz%C9^rjKu|n zhE_890$3jcj}pEvJf2UaFwXKXC<*5`y~?<3Or>|ma+$Z!0u_fD{~it zUUkw^>$(B6gH_PTV&zUht4skX0_24oXxwTNyGhihW2m-+>-qr{6Qqi{d)Cx`41nYt z{~91YO?Lot1toOT4~K!_!~O_$0Yzgx15jrLVh&yD&Yo+-^uz+xVjFRh*-PWWaBcC($J-j7x;a? zfX=fJplvALBa5fv14Cof#0NwTy@E~6)He|*c)A<$@&8{a_~S`>89`Hg4PVh=rqYi# zzC&}Tm(eKS;Z$$+pvzTqu^+o}Gv4k1+f&#Ewi&hc-=0DyuswT-E^<8CI&}k0u9cMa zOgX<+RLjpw-FwL;G^#u;t*w_;rC5gjMA?AV1P=3$I}f9DgUPNdbhF79bIMcLP~aq| z6cm1PZt)|8k{m4d*(v-PLCMasA>8fLRh^=Kt4>}IG(ziedv8pA5&7`PU%!mrPKoq0 z+HY!CdeLt0Lm9K3Mvlz>lv!w>&w0D%T*t;S*B)m6`f!xF+da+J;hUTdzpkOk3*vVO zypz%U2Hq(;VBnt&5V+2E7Z&);@xb|J(Fws(MnadnKMItFOnCPd@~KJo82l)66U7<9fXBUg=6mosMBaTp4#^GZ@h0;)Jv(=* z$I=VtIt+%x0lfY^f`)^!Al`J(a9e_dJ({Gr25$1u%xDMPC?0a)DdvJ|T37 zd;ON0VNOm7r&q${-ce?vU433T!^gdwhV}D@%+no0Y*&_~{r!F4hu}v^Ymyzf1F)L4 zdE3xP-Etapr-}17E&m)r*Wnc>2ey2vlO;>^wyYF+exJQE&;t{2z0tlF^lu8mNnkm4 zYhiCK`G3ES-dtrjg6S;vI?e5;84ag57mfmnN`;A3LU)J$^%C43{uZ6`?8q{cl4Wj5 rmYFG8-dxxk0wy8W8+Z7H%$#>87rMfuGf=PgxV~eO-Zk4HIz;GilV1v| diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/Index.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/Index.php deleted file mode 100644 index b0ddf381e8df6f69af67fa019b0a635fcf8b6486..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1509 zcma)6T~E_c7=ke{Ar2Gb5m1Ja&f%3sG~HTA4Q$IcNizwD+n{X7uIy%5Uj%Y5DYzBacyeHG>CA;c29_3IjvTR z@8ZvjPz3Pp6C8)OgV8~&c7&u%B=8X@G<^q`w@{+Vu^VB)I^ILma$0-{ zYyg(&QylrWXX!Y0A`-IxS`4bHLrl}r@kn`Vl9tPn0V*dos_L~O_YjT7_;PlHB234T zzboqI0_W*J>mS3?LSpR`?71~OvQJ46sp>^n7b2pm?bl?|g66tu#rtfdO> zYDp4Vp5B^8pE5+1Yj0ux@)YD%SkW4Fqtk7+dq+*(=)G%nT1MU6Hx0dbN1lURquDTu z8CK7Nc6ivEf;&ZN&45CxF0a6{Znlkj*K9Vfh%7)s>(q^gZZ-~>(jtIvr0>#N3-V$V zZ23!_uGYO;!#vE@+lJOn*agV57yW%vlGz8{I5fnEtjs?aOAiy1QtCn?wJJqem2zDDF-2IG zfLNF8Y~p9k(Edp4iH@oYl&Ypmsw$*Z^|;!fVYh|`FE-QL`7H5^OZIZ3wFqQl0OxQH F@E2iu&aMCe diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/Migration.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/GPBMetadata/Google/Datastore/Admin/V1/Migration.php deleted file mode 100644 index 53596831cf26ce0da4d8498da618d631c07c1f87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1926 zcmcJQQE!`86vu0)N!ODuwdho}S-ak*(dtwimOE+c$g+t5anNEwfSq}>gfLvYNEqk^ zr|YJCn7!_!>;vp+Z+qLP*a2+fB#o3l%r6*p&hP)f=N_H&?f1#+1fG!&jVN<7>XXqs zlD(!RVR06FaY#n9@t88=#nU7RDdP!|b)xAuQDoJAim7QlV;&XAB#tK`ZTW8IrdiBr z%k`&0)H-RmrojZ+K^*Y~6(Dk_G)-KOl8&+8rJ0*24Lb#3C@%m*F$WC$?Ogybbkme{ z7a;fz2>z1UC=5K3W=QwQc91$j6l8%L2EXD-_Q==`Q;OM_W5=_|%N>zCL61Dz+#w}1 zkKImUJoz43STgcrU?GNTlu;JB;ZUZj$ASdUX<(=zOlVe>F#pornak$5U`(2&M?tt` za*t$eMwitIVKkeuXt(g415T@dg|jce3+6sV->+m3@Oqk6V4n6I{s!2&_PuZq%TT_$ zLcX{{{-nL7!@a8b7M7bTCp5~qSFoBNj6SH5T65#&4u2(qKcBw!`zqY8K4E<)jHYP` z{Tgnj8BONQ=Jl8~;e7ZcVKi|Wb@F`2$Hof6^g$iHt-qA7!#QV!H%gj?Fu7zM-r!Pr z#Hb%I>SfMb7GyL%ueMUC{qW&x=A3$5K+lP8z5(vC8SZCjcyZ*-7^9K*&Y8yk;v&Qk zmzT~+T?B3Z0uQfr^uH=^y@k6M%y0xANxCNWOjFUMfz#Dx#p!95p-Ae1s>qES++A2V z6w6Y(s%5KEqsDCj=!U&`uX9h~@!7j`tlEc;qS>lFa5|>mGpxqS{s!DxZk!iC!ba7i zMbmRn;M1Wu^ellNr$Gc={@Uc z(746j!(!^jz!5ds=_{ssFhDa+*fw!|n~G#RN*~M66ORyqCAP49`0kjBC}T;u&ta>I zv~1*d-WPW>m#N}PCymwpziRLp_r}$|xPMmPV#FG?pT6google.datastore.admin.v1.CommonMetadata - */ -class CommonMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The time that work began on the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - */ - protected $start_time = null; - /** - * The time the operation ended, either successfully or otherwise. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - */ - protected $end_time = null; - /** - * The type of the operation. Can be used as a filter in - * ListOperationsRequest. - * - * Generated from protobuf field .google.datastore.admin.v1.OperationType operation_type = 3; - */ - protected $operation_type = 0; - /** - * The client-assigned labels which were provided when the operation was - * created. May also include additional labels. - * - * Generated from protobuf field map labels = 4; - */ - private $labels; - /** - * The current state of the Operation. - * - * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata.State state = 5; - */ - protected $state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Protobuf\Timestamp $start_time - * The time that work began on the operation. - * @type \Google\Protobuf\Timestamp $end_time - * The time the operation ended, either successfully or otherwise. - * @type int $operation_type - * The type of the operation. Can be used as a filter in - * ListOperationsRequest. - * @type array|\Google\Protobuf\Internal\MapField $labels - * The client-assigned labels which were provided when the operation was - * created. May also include additional labels. - * @type int $state - * The current state of the Operation. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * The time that work began on the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @return \Google\Protobuf\Timestamp|null - */ - public function getStartTime() - { - return $this->start_time; - } - - public function hasStartTime() - { - return isset($this->start_time); - } - - public function clearStartTime() - { - unset($this->start_time); - } - - /** - * The time that work began on the operation. - * - * Generated from protobuf field .google.protobuf.Timestamp start_time = 1; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setStartTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->start_time = $var; - - return $this; - } - - /** - * The time the operation ended, either successfully or otherwise. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @return \Google\Protobuf\Timestamp|null - */ - public function getEndTime() - { - return $this->end_time; - } - - public function hasEndTime() - { - return isset($this->end_time); - } - - public function clearEndTime() - { - unset($this->end_time); - } - - /** - * The time the operation ended, either successfully or otherwise. - * - * Generated from protobuf field .google.protobuf.Timestamp end_time = 2; - * @param \Google\Protobuf\Timestamp $var - * @return $this - */ - public function setEndTime($var) - { - GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); - $this->end_time = $var; - - return $this; - } - - /** - * The type of the operation. Can be used as a filter in - * ListOperationsRequest. - * - * Generated from protobuf field .google.datastore.admin.v1.OperationType operation_type = 3; - * @return int - */ - public function getOperationType() - { - return $this->operation_type; - } - - /** - * The type of the operation. Can be used as a filter in - * ListOperationsRequest. - * - * Generated from protobuf field .google.datastore.admin.v1.OperationType operation_type = 3; - * @param int $var - * @return $this - */ - public function setOperationType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\OperationType::class); - $this->operation_type = $var; - - return $this; - } - - /** - * The client-assigned labels which were provided when the operation was - * created. May also include additional labels. - * - * Generated from protobuf field map labels = 4; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * The client-assigned labels which were provided when the operation was - * created. May also include additional labels. - * - * Generated from protobuf field map labels = 4; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * The current state of the Operation. - * - * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata.State state = 5; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The current state of the Operation. - * - * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata.State state = 5; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\CommonMetadata\State::class); - $this->state = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CommonMetadata/State.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CommonMetadata/State.php deleted file mode 100644 index d4285dea144..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CommonMetadata/State.php +++ /dev/null @@ -1,101 +0,0 @@ -google.datastore.admin.v1.CommonMetadata.State - */ -class State -{ - /** - * Unspecified. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * Request is being prepared for processing. - * - * Generated from protobuf enum INITIALIZING = 1; - */ - const INITIALIZING = 1; - /** - * Request is actively being processed. - * - * Generated from protobuf enum PROCESSING = 2; - */ - const PROCESSING = 2; - /** - * Request is in the process of being cancelled after user called - * google.longrunning.Operations.CancelOperation on the operation. - * - * Generated from protobuf enum CANCELLING = 3; - */ - const CANCELLING = 3; - /** - * Request has been processed and is in its finalization stage. - * - * Generated from protobuf enum FINALIZING = 4; - */ - const FINALIZING = 4; - /** - * Request has completed successfully. - * - * Generated from protobuf enum SUCCESSFUL = 5; - */ - const SUCCESSFUL = 5; - /** - * Request has finished being processed, but encountered an error. - * - * Generated from protobuf enum FAILED = 6; - */ - const FAILED = 6; - /** - * Request has finished being cancelled after user called - * google.longrunning.Operations.CancelOperation. - * - * Generated from protobuf enum CANCELLED = 7; - */ - const CANCELLED = 7; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::INITIALIZING => 'INITIALIZING', - self::PROCESSING => 'PROCESSING', - self::CANCELLING => 'CANCELLING', - self::FINALIZING => 'FINALIZING', - self::SUCCESSFUL => 'SUCCESSFUL', - self::FAILED => 'FAILED', - self::CANCELLED => 'CANCELLED', - ]; - - 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(State::class, \Google\Cloud\Datastore\Admin\V1\CommonMetadata_State::class); - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CreateIndexRequest.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CreateIndexRequest.php deleted file mode 100644 index 45f67c62b73..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/CreateIndexRequest.php +++ /dev/null @@ -1,116 +0,0 @@ -google.datastore.admin.v1.CreateIndexRequest - */ -class CreateIndexRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1; - */ - protected $project_id = ''; - /** - * The index to create. The name and state fields are output only and will be - * ignored. Single property indexes cannot be created or deleted. - * - * Generated from protobuf field .google.datastore.admin.v1.Index index = 3; - */ - protected $index = null; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Project ID against which to make the request. - * @type \Google\Cloud\Datastore\Admin\V1\Index $index - * The index to create. The name and state fields are output only and will be - * ignored. Single property indexes cannot be created or deleted. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The index to create. The name and state fields are output only and will be - * ignored. Single property indexes cannot be created or deleted. - * - * Generated from protobuf field .google.datastore.admin.v1.Index index = 3; - * @return \Google\Cloud\Datastore\Admin\V1\Index|null - */ - public function getIndex() - { - return $this->index; - } - - public function hasIndex() - { - return isset($this->index); - } - - public function clearIndex() - { - unset($this->index); - } - - /** - * The index to create. The name and state fields are output only and will be - * ignored. Single property indexes cannot be created or deleted. - * - * Generated from protobuf field .google.datastore.admin.v1.Index index = 3; - * @param \Google\Cloud\Datastore\Admin\V1\Index $var - * @return $this - */ - public function setIndex($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Index::class); - $this->index = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DatastoreFirestoreMigrationMetadata.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DatastoreFirestoreMigrationMetadata.php deleted file mode 100644 index eac72af5846..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DatastoreFirestoreMigrationMetadata.php +++ /dev/null @@ -1,114 +0,0 @@ -google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - */ -class DatastoreFirestoreMigrationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * The current state of migration from Cloud Datastore to Cloud Firestore in - * Datastore mode. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationState migration_state = 1; - */ - protected $migration_state = 0; - /** - * The current step of migration from Cloud Datastore to Cloud Firestore in - * Datastore mode. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationStep migration_step = 2; - */ - protected $migration_step = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $migration_state - * The current state of migration from Cloud Datastore to Cloud Firestore in - * Datastore mode. - * @type int $migration_step - * The current step of migration from Cloud Datastore to Cloud Firestore in - * Datastore mode. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * The current state of migration from Cloud Datastore to Cloud Firestore in - * Datastore mode. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationState migration_state = 1; - * @return int - */ - public function getMigrationState() - { - return $this->migration_state; - } - - /** - * The current state of migration from Cloud Datastore to Cloud Firestore in - * Datastore mode. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationState migration_state = 1; - * @param int $var - * @return $this - */ - public function setMigrationState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\MigrationState::class); - $this->migration_state = $var; - - return $this; - } - - /** - * The current step of migration from Cloud Datastore to Cloud Firestore in - * Datastore mode. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationStep migration_step = 2; - * @return int - */ - public function getMigrationStep() - { - return $this->migration_step; - } - - /** - * The current step of migration from Cloud Datastore to Cloud Firestore in - * Datastore mode. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationStep migration_step = 2; - * @param int $var - * @return $this - */ - public function setMigrationStep($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\MigrationStep::class); - $this->migration_step = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DeleteIndexRequest.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DeleteIndexRequest.php deleted file mode 100644 index 330322229f4..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/DeleteIndexRequest.php +++ /dev/null @@ -1,102 +0,0 @@ -google.datastore.admin.v1.DeleteIndexRequest - */ -class DeleteIndexRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1; - */ - protected $project_id = ''; - /** - * The resource ID of the index to delete. - * - * Generated from protobuf field string index_id = 3; - */ - protected $index_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Project ID against which to make the request. - * @type string $index_id - * The resource ID of the index to delete. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The resource ID of the index to delete. - * - * Generated from protobuf field string index_id = 3; - * @return string - */ - public function getIndexId() - { - return $this->index_id; - } - - /** - * The resource ID of the index to delete. - * - * Generated from protobuf field string index_id = 3; - * @param string $var - * @return $this - */ - public function setIndexId($var) - { - GPBUtil::checkString($var, True); - $this->index_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/EntityFilter.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/EntityFilter.php deleted file mode 100644 index c03b62ee37e..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/EntityFilter.php +++ /dev/null @@ -1,134 +0,0 @@ -google.datastore.admin.v1.EntityFilter - */ -class EntityFilter extends \Google\Protobuf\Internal\Message -{ - /** - * If empty, then this represents all kinds. - * - * Generated from protobuf field repeated string kinds = 1; - */ - private $kinds; - /** - * An empty list represents all namespaces. This is the preferred - * usage for projects that don't use namespaces. - * An empty string element represents the default namespace. This should be - * used if the project has data in non-default namespaces, but doesn't want to - * include them. - * Each namespace in this list must be unique. - * - * Generated from protobuf field repeated string namespace_ids = 2; - */ - private $namespace_ids; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array|\Google\Protobuf\Internal\RepeatedField $kinds - * If empty, then this represents all kinds. - * @type array|\Google\Protobuf\Internal\RepeatedField $namespace_ids - * An empty list represents all namespaces. This is the preferred - * usage for projects that don't use namespaces. - * An empty string element represents the default namespace. This should be - * used if the project has data in non-default namespaces, but doesn't want to - * include them. - * Each namespace in this list must be unique. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * If empty, then this represents all kinds. - * - * Generated from protobuf field repeated string kinds = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getKinds() - { - return $this->kinds; - } - - /** - * If empty, then this represents all kinds. - * - * Generated from protobuf field repeated string kinds = 1; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setKinds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->kinds = $arr; - - return $this; - } - - /** - * An empty list represents all namespaces. This is the preferred - * usage for projects that don't use namespaces. - * An empty string element represents the default namespace. This should be - * used if the project has data in non-default namespaces, but doesn't want to - * include them. - * Each namespace in this list must be unique. - * - * Generated from protobuf field repeated string namespace_ids = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getNamespaceIds() - { - return $this->namespace_ids; - } - - /** - * An empty list represents all namespaces. This is the preferred - * usage for projects that don't use namespaces. - * An empty string element represents the default namespace. This should be - * used if the project has data in non-default namespaces, but doesn't want to - * include them. - * Each namespace in this list must be unique. - * - * Generated from protobuf field repeated string namespace_ids = 2; - * @param array|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setNamespaceIds($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); - $this->namespace_ids = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesMetadata.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesMetadata.php deleted file mode 100644 index 72554a9ea05..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesMetadata.php +++ /dev/null @@ -1,259 +0,0 @@ -google.datastore.admin.v1.ExportEntitiesMetadata - */ -class ExportEntitiesMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Metadata common to all Datastore Admin operations. - * - * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; - */ - protected $common = null; - /** - * An estimate of the number of entities processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; - */ - protected $progress_entities = null; - /** - * An estimate of the number of bytes processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_bytes = 3; - */ - protected $progress_bytes = null; - /** - * Description of which entities are being exported. - * - * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; - */ - protected $entity_filter = null; - /** - * Location for the export metadata and data files. This will be the same - * value as the - * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix] - * field. The final output location is provided in - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. - * - * Generated from protobuf field string output_url_prefix = 5; - */ - protected $output_url_prefix = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\Admin\V1\CommonMetadata $common - * Metadata common to all Datastore Admin operations. - * @type \Google\Cloud\Datastore\Admin\V1\Progress $progress_entities - * An estimate of the number of entities processed. - * @type \Google\Cloud\Datastore\Admin\V1\Progress $progress_bytes - * An estimate of the number of bytes processed. - * @type \Google\Cloud\Datastore\Admin\V1\EntityFilter $entity_filter - * Description of which entities are being exported. - * @type string $output_url_prefix - * Location for the export metadata and data files. This will be the same - * value as the - * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix] - * field. The final output location is provided in - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Metadata common to all Datastore Admin operations. - * - * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; - * @return \Google\Cloud\Datastore\Admin\V1\CommonMetadata|null - */ - public function getCommon() - { - return $this->common; - } - - public function hasCommon() - { - return isset($this->common); - } - - public function clearCommon() - { - unset($this->common); - } - - /** - * Metadata common to all Datastore Admin operations. - * - * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; - * @param \Google\Cloud\Datastore\Admin\V1\CommonMetadata $var - * @return $this - */ - public function setCommon($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\CommonMetadata::class); - $this->common = $var; - - return $this; - } - - /** - * An estimate of the number of entities processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; - * @return \Google\Cloud\Datastore\Admin\V1\Progress|null - */ - public function getProgressEntities() - { - return $this->progress_entities; - } - - public function hasProgressEntities() - { - return isset($this->progress_entities); - } - - public function clearProgressEntities() - { - unset($this->progress_entities); - } - - /** - * An estimate of the number of entities processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; - * @param \Google\Cloud\Datastore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressEntities($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Progress::class); - $this->progress_entities = $var; - - return $this; - } - - /** - * An estimate of the number of bytes processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_bytes = 3; - * @return \Google\Cloud\Datastore\Admin\V1\Progress|null - */ - public function getProgressBytes() - { - return $this->progress_bytes; - } - - public function hasProgressBytes() - { - return isset($this->progress_bytes); - } - - public function clearProgressBytes() - { - unset($this->progress_bytes); - } - - /** - * An estimate of the number of bytes processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_bytes = 3; - * @param \Google\Cloud\Datastore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressBytes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Progress::class); - $this->progress_bytes = $var; - - return $this; - } - - /** - * Description of which entities are being exported. - * - * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; - * @return \Google\Cloud\Datastore\Admin\V1\EntityFilter|null - */ - public function getEntityFilter() - { - return $this->entity_filter; - } - - public function hasEntityFilter() - { - return isset($this->entity_filter); - } - - public function clearEntityFilter() - { - unset($this->entity_filter); - } - - /** - * Description of which entities are being exported. - * - * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; - * @param \Google\Cloud\Datastore\Admin\V1\EntityFilter $var - * @return $this - */ - public function setEntityFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\EntityFilter::class); - $this->entity_filter = $var; - - return $this; - } - - /** - * Location for the export metadata and data files. This will be the same - * value as the - * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix] - * field. The final output location is provided in - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. - * - * Generated from protobuf field string output_url_prefix = 5; - * @return string - */ - public function getOutputUrlPrefix() - { - return $this->output_url_prefix; - } - - /** - * Location for the export metadata and data files. This will be the same - * value as the - * [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix] - * field. The final output location is provided in - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. - * - * Generated from protobuf field string output_url_prefix = 5; - * @param string $var - * @return $this - */ - public function setOutputUrlPrefix($var) - { - GPBUtil::checkString($var, True); - $this->output_url_prefix = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesRequest.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesRequest.php deleted file mode 100644 index 983ecc49e75..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesRequest.php +++ /dev/null @@ -1,272 +0,0 @@ -google.datastore.admin.v1.ExportEntitiesRequest - */ -class ExportEntitiesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project_id = ''; - /** - * Client-assigned labels. - * - * Generated from protobuf field map labels = 2; - */ - private $labels; - /** - * Description of what data from the project is included in the export. - * - * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 3; - */ - protected $entity_filter = null; - /** - * Required. Location for the export metadata and data files. - * The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So output_url_prefix should be of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the - * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud - * Storage namespace path (this is not a Cloud Datastore namespace). For more - * information about Cloud Storage namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * The resulting files will be nested deeper than the specified URL prefix. - * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] - * field. That value should be used for subsequent ImportEntities operations. - * By nesting the data files deeper, the same Cloud Storage bucket can be used - * in multiple ExportEntities operations without conflict. - * - * Generated from protobuf field string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $output_url_prefix = ''; - - /** - * @param string $projectId Required. Project ID against which to make the request. - * @param array $labels Client-assigned labels. - * @param \Google\Cloud\Datastore\Admin\V1\EntityFilter $entityFilter Description of what data from the project is included in the export. - * @param string $outputUrlPrefix Required. Location for the export metadata and data files. - * - * The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So output_url_prefix should be of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the - * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud - * Storage namespace path (this is not a Cloud Datastore namespace). For more - * information about Cloud Storage namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * - * The resulting files will be nested deeper than the specified URL prefix. - * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] - * field. That value should be used for subsequent ImportEntities operations. - * - * By nesting the data files deeper, the same Cloud Storage bucket can be used - * in multiple ExportEntities operations without conflict. - * - * @return \Google\Cloud\Datastore\Admin\V1\ExportEntitiesRequest - * - * @experimental - */ - public static function build(string $projectId, array $labels, \Google\Cloud\Datastore\Admin\V1\EntityFilter $entityFilter, string $outputUrlPrefix): self - { - return (new self()) - ->setProjectId($projectId) - ->setLabels($labels) - ->setEntityFilter($entityFilter) - ->setOutputUrlPrefix($outputUrlPrefix); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Required. Project ID against which to make the request. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Client-assigned labels. - * @type \Google\Cloud\Datastore\Admin\V1\EntityFilter $entity_filter - * Description of what data from the project is included in the export. - * @type string $output_url_prefix - * Required. Location for the export metadata and data files. - * The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So output_url_prefix should be of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the - * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud - * Storage namespace path (this is not a Cloud Datastore namespace). For more - * information about Cloud Storage namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * The resulting files will be nested deeper than the specified URL prefix. - * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] - * field. That value should be used for subsequent ImportEntities operations. - * By nesting the data files deeper, the same Cloud Storage bucket can be used - * in multiple ExportEntities operations without conflict. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Client-assigned labels. - * - * Generated from protobuf field map labels = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Client-assigned labels. - * - * Generated from protobuf field map labels = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Description of what data from the project is included in the export. - * - * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 3; - * @return \Google\Cloud\Datastore\Admin\V1\EntityFilter|null - */ - public function getEntityFilter() - { - return $this->entity_filter; - } - - public function hasEntityFilter() - { - return isset($this->entity_filter); - } - - public function clearEntityFilter() - { - unset($this->entity_filter); - } - - /** - * Description of what data from the project is included in the export. - * - * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 3; - * @param \Google\Cloud\Datastore\Admin\V1\EntityFilter $var - * @return $this - */ - public function setEntityFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\EntityFilter::class); - $this->entity_filter = $var; - - return $this; - } - - /** - * Required. Location for the export metadata and data files. - * The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So output_url_prefix should be of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the - * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud - * Storage namespace path (this is not a Cloud Datastore namespace). For more - * information about Cloud Storage namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * The resulting files will be nested deeper than the specified URL prefix. - * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] - * field. That value should be used for subsequent ImportEntities operations. - * By nesting the data files deeper, the same Cloud Storage bucket can be used - * in multiple ExportEntities operations without conflict. - * - * Generated from protobuf field string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getOutputUrlPrefix() - { - return $this->output_url_prefix; - } - - /** - * Required. Location for the export metadata and data files. - * The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So output_url_prefix should be of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the - * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud - * Storage namespace path (this is not a Cloud Datastore namespace). For more - * information about Cloud Storage namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * The resulting files will be nested deeper than the specified URL prefix. - * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] - * field. That value should be used for subsequent ImportEntities operations. - * By nesting the data files deeper, the same Cloud Storage bucket can be used - * in multiple ExportEntities operations without conflict. - * - * Generated from protobuf field string output_url_prefix = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setOutputUrlPrefix($var) - { - GPBUtil::checkString($var, True); - $this->output_url_prefix = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesResponse.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesResponse.php deleted file mode 100644 index f7e9ac10154..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ExportEntitiesResponse.php +++ /dev/null @@ -1,80 +0,0 @@ -google.datastore.admin.v1.ExportEntitiesResponse - */ -class ExportEntitiesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * Location of the output metadata file. This can be used to begin an import - * into Cloud Datastore (this project or another project). See - * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url]. - * Only present if the operation completed successfully. - * - * Generated from protobuf field string output_url = 1; - */ - protected $output_url = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $output_url - * Location of the output metadata file. This can be used to begin an import - * into Cloud Datastore (this project or another project). See - * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url]. - * Only present if the operation completed successfully. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Location of the output metadata file. This can be used to begin an import - * into Cloud Datastore (this project or another project). See - * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url]. - * Only present if the operation completed successfully. - * - * Generated from protobuf field string output_url = 1; - * @return string - */ - public function getOutputUrl() - { - return $this->output_url; - } - - /** - * Location of the output metadata file. This can be used to begin an import - * into Cloud Datastore (this project or another project). See - * [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url]. - * Only present if the operation completed successfully. - * - * Generated from protobuf field string output_url = 1; - * @param string $var - * @return $this - */ - public function setOutputUrl($var) - { - GPBUtil::checkString($var, True); - $this->output_url = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/GetIndexRequest.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/GetIndexRequest.php deleted file mode 100644 index 70a5ea9f645..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/GetIndexRequest.php +++ /dev/null @@ -1,102 +0,0 @@ -google.datastore.admin.v1.GetIndexRequest - */ -class GetIndexRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1; - */ - protected $project_id = ''; - /** - * The resource ID of the index to get. - * - * Generated from protobuf field string index_id = 3; - */ - protected $index_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Project ID against which to make the request. - * @type string $index_id - * The resource ID of the index to get. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * The resource ID of the index to get. - * - * Generated from protobuf field string index_id = 3; - * @return string - */ - public function getIndexId() - { - return $this->index_id; - } - - /** - * The resource ID of the index to get. - * - * Generated from protobuf field string index_id = 3; - * @param string $var - * @return $this - */ - public function setIndexId($var) - { - GPBUtil::checkString($var, True); - $this->index_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesMetadata.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesMetadata.php deleted file mode 100644 index fbd091964aa..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesMetadata.php +++ /dev/null @@ -1,255 +0,0 @@ -google.datastore.admin.v1.ImportEntitiesMetadata - */ -class ImportEntitiesMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Metadata common to all Datastore Admin operations. - * - * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; - */ - protected $common = null; - /** - * An estimate of the number of entities processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; - */ - protected $progress_entities = null; - /** - * An estimate of the number of bytes processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_bytes = 3; - */ - protected $progress_bytes = null; - /** - * Description of which entities are being imported. - * - * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; - */ - protected $entity_filter = null; - /** - * The location of the import metadata file. This will be the same value as - * the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] - * field. - * - * Generated from protobuf field string input_url = 5; - */ - protected $input_url = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\Admin\V1\CommonMetadata $common - * Metadata common to all Datastore Admin operations. - * @type \Google\Cloud\Datastore\Admin\V1\Progress $progress_entities - * An estimate of the number of entities processed. - * @type \Google\Cloud\Datastore\Admin\V1\Progress $progress_bytes - * An estimate of the number of bytes processed. - * @type \Google\Cloud\Datastore\Admin\V1\EntityFilter $entity_filter - * Description of which entities are being imported. - * @type string $input_url - * The location of the import metadata file. This will be the same value as - * the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] - * field. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Metadata common to all Datastore Admin operations. - * - * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; - * @return \Google\Cloud\Datastore\Admin\V1\CommonMetadata|null - */ - public function getCommon() - { - return $this->common; - } - - public function hasCommon() - { - return isset($this->common); - } - - public function clearCommon() - { - unset($this->common); - } - - /** - * Metadata common to all Datastore Admin operations. - * - * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; - * @param \Google\Cloud\Datastore\Admin\V1\CommonMetadata $var - * @return $this - */ - public function setCommon($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\CommonMetadata::class); - $this->common = $var; - - return $this; - } - - /** - * An estimate of the number of entities processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; - * @return \Google\Cloud\Datastore\Admin\V1\Progress|null - */ - public function getProgressEntities() - { - return $this->progress_entities; - } - - public function hasProgressEntities() - { - return isset($this->progress_entities); - } - - public function clearProgressEntities() - { - unset($this->progress_entities); - } - - /** - * An estimate of the number of entities processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; - * @param \Google\Cloud\Datastore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressEntities($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Progress::class); - $this->progress_entities = $var; - - return $this; - } - - /** - * An estimate of the number of bytes processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_bytes = 3; - * @return \Google\Cloud\Datastore\Admin\V1\Progress|null - */ - public function getProgressBytes() - { - return $this->progress_bytes; - } - - public function hasProgressBytes() - { - return isset($this->progress_bytes); - } - - public function clearProgressBytes() - { - unset($this->progress_bytes); - } - - /** - * An estimate of the number of bytes processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_bytes = 3; - * @param \Google\Cloud\Datastore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressBytes($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Progress::class); - $this->progress_bytes = $var; - - return $this; - } - - /** - * Description of which entities are being imported. - * - * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; - * @return \Google\Cloud\Datastore\Admin\V1\EntityFilter|null - */ - public function getEntityFilter() - { - return $this->entity_filter; - } - - public function hasEntityFilter() - { - return isset($this->entity_filter); - } - - public function clearEntityFilter() - { - unset($this->entity_filter); - } - - /** - * Description of which entities are being imported. - * - * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; - * @param \Google\Cloud\Datastore\Admin\V1\EntityFilter $var - * @return $this - */ - public function setEntityFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\EntityFilter::class); - $this->entity_filter = $var; - - return $this; - } - - /** - * The location of the import metadata file. This will be the same value as - * the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] - * field. - * - * Generated from protobuf field string input_url = 5; - * @return string - */ - public function getInputUrl() - { - return $this->input_url; - } - - /** - * The location of the import metadata file. This will be the same value as - * the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] - * field. - * - * Generated from protobuf field string input_url = 5; - * @param string $var - * @return $this - */ - public function setInputUrl($var) - { - GPBUtil::checkString($var, True); - $this->input_url = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesRequest.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesRequest.php deleted file mode 100644 index 2b1c1675a9f..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ImportEntitiesRequest.php +++ /dev/null @@ -1,275 +0,0 @@ -google.datastore.admin.v1.ImportEntitiesRequest - */ -class ImportEntitiesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Required. Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $project_id = ''; - /** - * Client-assigned labels. - * - * Generated from protobuf field map labels = 2; - */ - private $labels; - /** - * Required. The full resource URL of the external storage location. - * Currently, only Google Cloud Storage is supported. So input_url should be - * of the form: - * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where - * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is - * an optional Cloud Storage namespace path (this is not a Cloud Datastore - * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written - * by the ExportEntities operation. For more information about Cloud Storage - * namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * For more information, see - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. - * - * Generated from protobuf field string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $input_url = ''; - /** - * Optionally specify which kinds/namespaces are to be imported. If provided, - * the list must be a subset of the EntityFilter used in creating the export, - * otherwise a FAILED_PRECONDITION error will be returned. If no filter is - * specified then all entities from the export are imported. - * - * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; - */ - protected $entity_filter = null; - - /** - * @param string $projectId Required. Project ID against which to make the request. - * @param array $labels Client-assigned labels. - * @param string $inputUrl Required. The full resource URL of the external storage location. - * Currently, only Google Cloud Storage is supported. So input_url should be - * of the form: - * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where - * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is - * an optional Cloud Storage namespace path (this is not a Cloud Datastore - * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written - * by the ExportEntities operation. For more information about Cloud Storage - * namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * - * For more information, see - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. - * @param \Google\Cloud\Datastore\Admin\V1\EntityFilter $entityFilter Optionally specify which kinds/namespaces are to be imported. If provided, - * the list must be a subset of the EntityFilter used in creating the export, - * otherwise a FAILED_PRECONDITION error will be returned. If no filter is - * specified then all entities from the export are imported. - * - * @return \Google\Cloud\Datastore\Admin\V1\ImportEntitiesRequest - * - * @experimental - */ - public static function build(string $projectId, array $labels, string $inputUrl, \Google\Cloud\Datastore\Admin\V1\EntityFilter $entityFilter): self - { - return (new self()) - ->setProjectId($projectId) - ->setLabels($labels) - ->setInputUrl($inputUrl) - ->setEntityFilter($entityFilter); - } - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Required. Project ID against which to make the request. - * @type array|\Google\Protobuf\Internal\MapField $labels - * Client-assigned labels. - * @type string $input_url - * Required. The full resource URL of the external storage location. - * Currently, only Google Cloud Storage is supported. So input_url should be - * of the form: - * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where - * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is - * an optional Cloud Storage namespace path (this is not a Cloud Datastore - * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written - * by the ExportEntities operation. For more information about Cloud Storage - * namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * For more information, see - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. - * @type \Google\Cloud\Datastore\Admin\V1\EntityFilter $entity_filter - * Optionally specify which kinds/namespaces are to be imported. If provided, - * the list must be a subset of the EntityFilter used in creating the export, - * otherwise a FAILED_PRECONDITION error will be returned. If no filter is - * specified then all entities from the export are imported. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Required. Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Required. Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Client-assigned labels. - * - * Generated from protobuf field map labels = 2; - * @return \Google\Protobuf\Internal\MapField - */ - public function getLabels() - { - return $this->labels; - } - - /** - * Client-assigned labels. - * - * Generated from protobuf field map labels = 2; - * @param array|\Google\Protobuf\Internal\MapField $var - * @return $this - */ - public function setLabels($var) - { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); - $this->labels = $arr; - - return $this; - } - - /** - * Required. The full resource URL of the external storage location. - * Currently, only Google Cloud Storage is supported. So input_url should be - * of the form: - * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where - * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is - * an optional Cloud Storage namespace path (this is not a Cloud Datastore - * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written - * by the ExportEntities operation. For more information about Cloud Storage - * namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * For more information, see - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. - * - * Generated from protobuf field string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getInputUrl() - { - return $this->input_url; - } - - /** - * Required. The full resource URL of the external storage location. - * Currently, only Google Cloud Storage is supported. So input_url should be - * of the form: - * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where - * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is - * an optional Cloud Storage namespace path (this is not a Cloud Datastore - * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written - * by the ExportEntities operation. For more information about Cloud Storage - * namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * For more information, see - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. - * - * Generated from protobuf field string input_url = 3 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setInputUrl($var) - { - GPBUtil::checkString($var, True); - $this->input_url = $var; - - return $this; - } - - /** - * Optionally specify which kinds/namespaces are to be imported. If provided, - * the list must be a subset of the EntityFilter used in creating the export, - * otherwise a FAILED_PRECONDITION error will be returned. If no filter is - * specified then all entities from the export are imported. - * - * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; - * @return \Google\Cloud\Datastore\Admin\V1\EntityFilter|null - */ - public function getEntityFilter() - { - return $this->entity_filter; - } - - public function hasEntityFilter() - { - return isset($this->entity_filter); - } - - public function clearEntityFilter() - { - unset($this->entity_filter); - } - - /** - * Optionally specify which kinds/namespaces are to be imported. If provided, - * the list must be a subset of the EntityFilter used in creating the export, - * otherwise a FAILED_PRECONDITION error will be returned. If no filter is - * specified then all entities from the export are imported. - * - * Generated from protobuf field .google.datastore.admin.v1.EntityFilter entity_filter = 4; - * @param \Google\Cloud\Datastore\Admin\V1\EntityFilter $var - * @return $this - */ - public function setEntityFilter($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\EntityFilter::class); - $this->entity_filter = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index.php deleted file mode 100644 index e8c9de9eee9..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index.php +++ /dev/null @@ -1,249 +0,0 @@ -google.datastore.admin.v1.Index - */ -class Index extends \Google\Protobuf\Internal\Message -{ - /** - * Output only. Project ID. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $project_id = ''; - /** - * Output only. The resource ID of the index. - * - * Generated from protobuf field string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $index_id = ''; - /** - * Required. The entity kind to which this index applies. - * - * Generated from protobuf field string kind = 4 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $kind = ''; - /** - * Required. The index's ancestor mode. Must not be - * ANCESTOR_MODE_UNSPECIFIED. - * - * Generated from protobuf field .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $ancestor = 0; - /** - * Required. An ordered sequence of property names and their index attributes. - * Requires: - * * A maximum of 100 properties. - * - * Generated from protobuf field repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; - */ - private $properties; - /** - * Output only. The state of the index. - * - * Generated from protobuf field .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Output only. Project ID. - * @type string $index_id - * Output only. The resource ID of the index. - * @type string $kind - * Required. The entity kind to which this index applies. - * @type int $ancestor - * Required. The index's ancestor mode. Must not be - * ANCESTOR_MODE_UNSPECIFIED. - * @type array<\Google\Cloud\Datastore\Admin\V1\Index\IndexedProperty>|\Google\Protobuf\Internal\RepeatedField $properties - * Required. An ordered sequence of property names and their index attributes. - * Requires: - * * A maximum of 100 properties. - * @type int $state - * Output only. The state of the index. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\Index::initOnce(); - parent::__construct($data); - } - - /** - * Output only. Project ID. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Output only. Project ID. - * - * Generated from protobuf field string project_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Output only. The resource ID of the index. - * - * Generated from protobuf field string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getIndexId() - { - return $this->index_id; - } - - /** - * Output only. The resource ID of the index. - * - * Generated from protobuf field string index_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setIndexId($var) - { - GPBUtil::checkString($var, True); - $this->index_id = $var; - - return $this; - } - - /** - * Required. The entity kind to which this index applies. - * - * Generated from protobuf field string kind = 4 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getKind() - { - return $this->kind; - } - - /** - * Required. The entity kind to which this index applies. - * - * Generated from protobuf field string kind = 4 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setKind($var) - { - GPBUtil::checkString($var, True); - $this->kind = $var; - - return $this; - } - - /** - * Required. The index's ancestor mode. Must not be - * ANCESTOR_MODE_UNSPECIFIED. - * - * Generated from protobuf field .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getAncestor() - { - return $this->ancestor; - } - - /** - * Required. The index's ancestor mode. Must not be - * ANCESTOR_MODE_UNSPECIFIED. - * - * Generated from protobuf field .google.datastore.admin.v1.Index.AncestorMode ancestor = 5 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setAncestor($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\Index\AncestorMode::class); - $this->ancestor = $var; - - return $this; - } - - /** - * Required. An ordered sequence of property names and their index attributes. - * Requires: - * * A maximum of 100 properties. - * - * Generated from protobuf field repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getProperties() - { - return $this->properties; - } - - /** - * Required. An ordered sequence of property names and their index attributes. - * Requires: - * * A maximum of 100 properties. - * - * Generated from protobuf field repeated .google.datastore.admin.v1.Index.IndexedProperty properties = 6 [(.google.api.field_behavior) = REQUIRED]; - * @param array<\Google\Cloud\Datastore\Admin\V1\Index\IndexedProperty>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setProperties($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\Admin\V1\Index\IndexedProperty::class); - $this->properties = $arr; - - return $this; - } - - /** - * Output only. The state of the index. - * - * Generated from protobuf field .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * Output only. The state of the index. - * - * Generated from protobuf field .google.datastore.admin.v1.Index.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\Index\State::class); - $this->state = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/AncestorMode.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/AncestorMode.php deleted file mode 100644 index 24e87cb45bf..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/AncestorMode.php +++ /dev/null @@ -1,65 +0,0 @@ -google.datastore.admin.v1.Index.AncestorMode - */ -class AncestorMode -{ - /** - * The ancestor mode is unspecified. - * - * Generated from protobuf enum ANCESTOR_MODE_UNSPECIFIED = 0; - */ - const ANCESTOR_MODE_UNSPECIFIED = 0; - /** - * Do not include the entity's ancestors in the index. - * - * Generated from protobuf enum NONE = 1; - */ - const NONE = 1; - /** - * Include all the entity's ancestors in the index. - * - * Generated from protobuf enum ALL_ANCESTORS = 2; - */ - const ALL_ANCESTORS = 2; - - private static $valueToName = [ - self::ANCESTOR_MODE_UNSPECIFIED => 'ANCESTOR_MODE_UNSPECIFIED', - self::NONE => 'NONE', - self::ALL_ANCESTORS => 'ALL_ANCESTORS', - ]; - - 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(AncestorMode::class, \Google\Cloud\Datastore\Admin\V1\Index_AncestorMode::class); - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/Direction.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/Direction.php deleted file mode 100644 index bee71a7181e..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/Direction.php +++ /dev/null @@ -1,66 +0,0 @@ -google.datastore.admin.v1.Index.Direction - */ -class Direction -{ - /** - * The direction is unspecified. - * - * Generated from protobuf enum DIRECTION_UNSPECIFIED = 0; - */ - const DIRECTION_UNSPECIFIED = 0; - /** - * The property's values are indexed so as to support sequencing in - * ascending order and also query by <, >, <=, >=, and =. - * - * Generated from protobuf enum ASCENDING = 1; - */ - const ASCENDING = 1; - /** - * The property's values are indexed so as to support sequencing in - * descending order and also query by <, >, <=, >=, and =. - * - * 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\Admin\V1\Index_Direction::class); - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/IndexedProperty.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/IndexedProperty.php deleted file mode 100644 index 546eb72565e..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/IndexedProperty.php +++ /dev/null @@ -1,108 +0,0 @@ -google.datastore.admin.v1.Index.IndexedProperty - */ -class IndexedProperty extends \Google\Protobuf\Internal\Message -{ - /** - * Required. The property name to index. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $name = ''; - /** - * Required. The indexed property's direction. Must not be - * DIRECTION_UNSPECIFIED. - * - * Generated from protobuf field .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; - */ - protected $direction = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $name - * Required. The property name to index. - * @type int $direction - * Required. The indexed property's direction. Must not be - * DIRECTION_UNSPECIFIED. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\Index::initOnce(); - parent::__construct($data); - } - - /** - * Required. The property name to index. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Required. The property name to index. - * - * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * Required. The indexed property's direction. Must not be - * DIRECTION_UNSPECIFIED. - * - * Generated from protobuf field .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; - * @return int - */ - public function getDirection() - { - return $this->direction; - } - - /** - * Required. The indexed property's direction. Must not be - * DIRECTION_UNSPECIFIED. - * - * Generated from protobuf field .google.datastore.admin.v1.Index.Direction direction = 2 [(.google.api.field_behavior) = REQUIRED]; - * @param int $var - * @return $this - */ - public function setDirection($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\Index\Direction::class); - $this->direction = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(IndexedProperty::class, \Google\Cloud\Datastore\Admin\V1\Index_IndexedProperty::class); - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/State.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/State.php deleted file mode 100644 index 6d8678652c2..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Index/State.php +++ /dev/null @@ -1,91 +0,0 @@ -google.datastore.admin.v1.Index.State - */ -class State -{ - /** - * The state is unspecified. - * - * Generated from protobuf enum STATE_UNSPECIFIED = 0; - */ - const STATE_UNSPECIFIED = 0; - /** - * The index is being created, and cannot be used by queries. - * There is an active long-running operation for the index. - * The index is updated when writing an entity. - * Some index data may exist. - * - * Generated from protobuf enum CREATING = 1; - */ - const CREATING = 1; - /** - * The index is ready to be used. - * The index is updated when writing an entity. - * The index is fully populated from all stored entities it applies to. - * - * Generated from protobuf enum READY = 2; - */ - const READY = 2; - /** - * The index is being deleted, and cannot be used by queries. - * There is an active long-running operation for the index. - * The index is not updated when writing an entity. - * Some index data may exist. - * - * Generated from protobuf enum DELETING = 3; - */ - const DELETING = 3; - /** - * The index was being created or deleted, but something went wrong. - * The index cannot by used by queries. - * There is no active long-running operation for the index, - * and the most recently finished long-running operation failed. - * The index is not updated when writing an entity. - * Some index data may exist. - * - * Generated from protobuf enum ERROR = 4; - */ - const ERROR = 4; - - private static $valueToName = [ - self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', - self::CREATING => 'CREATING', - self::READY => 'READY', - self::DELETING => 'DELETING', - self::ERROR => 'ERROR', - ]; - - 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(State::class, \Google\Cloud\Datastore\Admin\V1\Index_State::class); - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/IndexOperationMetadata.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/IndexOperationMetadata.php deleted file mode 100644 index 78ebf07e1ff..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/IndexOperationMetadata.php +++ /dev/null @@ -1,155 +0,0 @@ -google.datastore.admin.v1.IndexOperationMetadata - */ -class IndexOperationMetadata extends \Google\Protobuf\Internal\Message -{ - /** - * Metadata common to all Datastore Admin operations. - * - * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; - */ - protected $common = null; - /** - * An estimate of the number of entities processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; - */ - protected $progress_entities = null; - /** - * The index resource ID that this operation is acting on. - * - * Generated from protobuf field string index_id = 3; - */ - protected $index_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type \Google\Cloud\Datastore\Admin\V1\CommonMetadata $common - * Metadata common to all Datastore Admin operations. - * @type \Google\Cloud\Datastore\Admin\V1\Progress $progress_entities - * An estimate of the number of entities processed. - * @type string $index_id - * The index resource ID that this operation is acting on. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Metadata common to all Datastore Admin operations. - * - * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; - * @return \Google\Cloud\Datastore\Admin\V1\CommonMetadata|null - */ - public function getCommon() - { - return $this->common; - } - - public function hasCommon() - { - return isset($this->common); - } - - public function clearCommon() - { - unset($this->common); - } - - /** - * Metadata common to all Datastore Admin operations. - * - * Generated from protobuf field .google.datastore.admin.v1.CommonMetadata common = 1; - * @param \Google\Cloud\Datastore\Admin\V1\CommonMetadata $var - * @return $this - */ - public function setCommon($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\CommonMetadata::class); - $this->common = $var; - - return $this; - } - - /** - * An estimate of the number of entities processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; - * @return \Google\Cloud\Datastore\Admin\V1\Progress|null - */ - public function getProgressEntities() - { - return $this->progress_entities; - } - - public function hasProgressEntities() - { - return isset($this->progress_entities); - } - - public function clearProgressEntities() - { - unset($this->progress_entities); - } - - /** - * An estimate of the number of entities processed. - * - * Generated from protobuf field .google.datastore.admin.v1.Progress progress_entities = 2; - * @param \Google\Cloud\Datastore\Admin\V1\Progress $var - * @return $this - */ - public function setProgressEntities($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\Progress::class); - $this->progress_entities = $var; - - return $this; - } - - /** - * The index resource ID that this operation is acting on. - * - * Generated from protobuf field string index_id = 3; - * @return string - */ - public function getIndexId() - { - return $this->index_id; - } - - /** - * The index resource ID that this operation is acting on. - * - * Generated from protobuf field string index_id = 3; - * @param string $var - * @return $this - */ - public function setIndexId($var) - { - GPBUtil::checkString($var, True); - $this->index_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesRequest.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesRequest.php deleted file mode 100644 index 137986ae766..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesRequest.php +++ /dev/null @@ -1,167 +0,0 @@ -google.datastore.admin.v1.ListIndexesRequest - */ -class ListIndexesRequest extends \Google\Protobuf\Internal\Message -{ - /** - * Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1; - */ - protected $project_id = ''; - /** - * Generated from protobuf field string filter = 3; - */ - protected $filter = ''; - /** - * The maximum number of items to return. If zero, then all results will be - * returned. - * - * Generated from protobuf field int32 page_size = 4; - */ - protected $page_size = 0; - /** - * The next_page_token value returned from a previous List request, if any. - * - * Generated from protobuf field string page_token = 5; - */ - protected $page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $project_id - * Project ID against which to make the request. - * @type string $filter - * @type int $page_size - * The maximum number of items to return. If zero, then all results will be - * returned. - * @type string $page_token - * The next_page_token value returned from a previous List request, if any. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1; - * @return string - */ - public function getProjectId() - { - return $this->project_id; - } - - /** - * Project ID against which to make the request. - * - * Generated from protobuf field string project_id = 1; - * @param string $var - * @return $this - */ - public function setProjectId($var) - { - GPBUtil::checkString($var, True); - $this->project_id = $var; - - return $this; - } - - /** - * Generated from protobuf field string filter = 3; - * @return string - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Generated from protobuf field string filter = 3; - * @param string $var - * @return $this - */ - public function setFilter($var) - { - GPBUtil::checkString($var, True); - $this->filter = $var; - - return $this; - } - - /** - * The maximum number of items to return. If zero, then all results will be - * returned. - * - * Generated from protobuf field int32 page_size = 4; - * @return int - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * The maximum number of items to return. If zero, then all results will be - * returned. - * - * Generated from protobuf field int32 page_size = 4; - * @param int $var - * @return $this - */ - public function setPageSize($var) - { - GPBUtil::checkInt32($var); - $this->page_size = $var; - - return $this; - } - - /** - * The next_page_token value returned from a previous List request, if any. - * - * Generated from protobuf field string page_token = 5; - * @return string - */ - public function getPageToken() - { - return $this->page_token; - } - - /** - * The next_page_token value returned from a previous List request, if any. - * - * Generated from protobuf field string page_token = 5; - * @param string $var - * @return $this - */ - public function setPageToken($var) - { - GPBUtil::checkString($var, True); - $this->page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesResponse.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesResponse.php deleted file mode 100644 index 24c9caf57fa..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/ListIndexesResponse.php +++ /dev/null @@ -1,102 +0,0 @@ -google.datastore.admin.v1.ListIndexesResponse - */ -class ListIndexesResponse extends \Google\Protobuf\Internal\Message -{ - /** - * The indexes. - * - * Generated from protobuf field repeated .google.datastore.admin.v1.Index indexes = 1; - */ - private $indexes; - /** - * The standard List next-page token. - * - * Generated from protobuf field string next_page_token = 2; - */ - protected $next_page_token = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type array<\Google\Cloud\Datastore\Admin\V1\Index>|\Google\Protobuf\Internal\RepeatedField $indexes - * The indexes. - * @type string $next_page_token - * The standard List next-page token. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * The indexes. - * - * Generated from protobuf field repeated .google.datastore.admin.v1.Index indexes = 1; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getIndexes() - { - return $this->indexes; - } - - /** - * The indexes. - * - * Generated from protobuf field repeated .google.datastore.admin.v1.Index indexes = 1; - * @param array<\Google\Cloud\Datastore\Admin\V1\Index>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setIndexes($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastore\Admin\V1\Index::class); - $this->indexes = $arr; - - return $this; - } - - /** - * The standard List next-page token. - * - * Generated from protobuf field string next_page_token = 2; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * The standard List next-page token. - * - * Generated from protobuf field string next_page_token = 2; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent.php deleted file mode 100644 index ad713f55b62..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent.php +++ /dev/null @@ -1,152 +0,0 @@ -google.datastore.admin.v1.MigrationProgressEvent - */ -class MigrationProgressEvent extends \Google\Protobuf\Internal\Message -{ - /** - * The step that is starting. - * An event with step set to `START` indicates that the migration - * has been reverted back to the initial pre-migration state. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationStep step = 1; - */ - protected $step = 0; - protected $step_details; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $step - * The step that is starting. - * An event with step set to `START` indicates that the migration - * has been reverted back to the initial pre-migration state. - * @type \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\PrepareStepDetails $prepare_step_details - * Details for the `PREPARE` step. - * @type \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\RedirectWritesStepDetails $redirect_writes_step_details - * Details for the `REDIRECT_WRITES` step. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\Migration::initOnce(); - parent::__construct($data); - } - - /** - * The step that is starting. - * An event with step set to `START` indicates that the migration - * has been reverted back to the initial pre-migration state. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationStep step = 1; - * @return int - */ - public function getStep() - { - return $this->step; - } - - /** - * The step that is starting. - * An event with step set to `START` indicates that the migration - * has been reverted back to the initial pre-migration state. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationStep step = 1; - * @param int $var - * @return $this - */ - public function setStep($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\MigrationStep::class); - $this->step = $var; - - return $this; - } - - /** - * Details for the `PREPARE` step. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; - * @return \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\PrepareStepDetails|null - */ - public function getPrepareStepDetails() - { - return $this->readOneof(2); - } - - public function hasPrepareStepDetails() - { - return $this->hasOneof(2); - } - - /** - * Details for the `PREPARE` step. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails prepare_step_details = 2; - * @param \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\PrepareStepDetails $var - * @return $this - */ - public function setPrepareStepDetails($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\PrepareStepDetails::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Details for the `REDIRECT_WRITES` step. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; - * @return \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\RedirectWritesStepDetails|null - */ - public function getRedirectWritesStepDetails() - { - return $this->readOneof(3); - } - - public function hasRedirectWritesStepDetails() - { - return $this->hasOneof(3); - } - - /** - * Details for the `REDIRECT_WRITES` step. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails redirect_writes_step_details = 3; - * @param \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\RedirectWritesStepDetails $var - * @return $this - */ - public function setRedirectWritesStepDetails($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\RedirectWritesStepDetails::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getStepDetails() - { - return $this->whichOneof("step_details"); - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/ConcurrencyMode.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/ConcurrencyMode.php deleted file mode 100644 index 6ac75957b07..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/ConcurrencyMode.php +++ /dev/null @@ -1,71 +0,0 @@ -google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode - */ -class ConcurrencyMode -{ - /** - * Unspecified. - * - * Generated from protobuf enum CONCURRENCY_MODE_UNSPECIFIED = 0; - */ - const CONCURRENCY_MODE_UNSPECIFIED = 0; - /** - * Pessimistic concurrency. - * - * Generated from protobuf enum PESSIMISTIC = 1; - */ - const PESSIMISTIC = 1; - /** - * Optimistic concurrency. - * - * Generated from protobuf enum OPTIMISTIC = 2; - */ - const OPTIMISTIC = 2; - /** - * Optimistic concurrency with entity groups. - * - * Generated from protobuf enum OPTIMISTIC_WITH_ENTITY_GROUPS = 3; - */ - const OPTIMISTIC_WITH_ENTITY_GROUPS = 3; - - private static $valueToName = [ - self::CONCURRENCY_MODE_UNSPECIFIED => 'CONCURRENCY_MODE_UNSPECIFIED', - self::PESSIMISTIC => 'PESSIMISTIC', - self::OPTIMISTIC => 'OPTIMISTIC', - self::OPTIMISTIC_WITH_ENTITY_GROUPS => 'OPTIMISTIC_WITH_ENTITY_GROUPS', - ]; - - 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(ConcurrencyMode::class, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent_ConcurrencyMode::class); - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/PrepareStepDetails.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/PrepareStepDetails.php deleted file mode 100644 index 9182ec0e8fc..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/PrepareStepDetails.php +++ /dev/null @@ -1,74 +0,0 @@ -google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - */ -class PrepareStepDetails extends \Google\Protobuf\Internal\Message -{ - /** - * The concurrency mode this database will use when it reaches the - * `REDIRECT_WRITES` step. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; - */ - protected $concurrency_mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $concurrency_mode - * The concurrency mode this database will use when it reaches the - * `REDIRECT_WRITES` step. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\Migration::initOnce(); - parent::__construct($data); - } - - /** - * The concurrency mode this database will use when it reaches the - * `REDIRECT_WRITES` step. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; - * @return int - */ - public function getConcurrencyMode() - { - return $this->concurrency_mode; - } - - /** - * The concurrency mode this database will use when it reaches the - * `REDIRECT_WRITES` step. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; - * @param int $var - * @return $this - */ - public function setConcurrencyMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\ConcurrencyMode::class); - $this->concurrency_mode = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(PrepareStepDetails::class, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent_PrepareStepDetails::class); - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/RedirectWritesStepDetails.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/RedirectWritesStepDetails.php deleted file mode 100644 index 62927870dda..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationProgressEvent/RedirectWritesStepDetails.php +++ /dev/null @@ -1,70 +0,0 @@ -google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - */ -class RedirectWritesStepDetails extends \Google\Protobuf\Internal\Message -{ - /** - * Ths concurrency mode for this database. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; - */ - protected $concurrency_mode = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $concurrency_mode - * Ths concurrency mode for this database. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\Migration::initOnce(); - parent::__construct($data); - } - - /** - * Ths concurrency mode for this database. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; - * @return int - */ - public function getConcurrencyMode() - { - return $this->concurrency_mode; - } - - /** - * Ths concurrency mode for this database. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode concurrency_mode = 1; - * @param int $var - * @return $this - */ - public function setConcurrencyMode($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent\ConcurrencyMode::class); - $this->concurrency_mode = $var; - - return $this; - } - -} - -// Adding a class alias for backwards compatibility with the previous class name. -class_alias(RedirectWritesStepDetails::class, \Google\Cloud\Datastore\Admin\V1\MigrationProgressEvent_RedirectWritesStepDetails::class); - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationState.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationState.php deleted file mode 100644 index 73ed2294dfc..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationState.php +++ /dev/null @@ -1,68 +0,0 @@ -google.datastore.admin.v1.MigrationState - */ -class MigrationState -{ - /** - * Unspecified. - * - * Generated from protobuf enum MIGRATION_STATE_UNSPECIFIED = 0; - */ - const MIGRATION_STATE_UNSPECIFIED = 0; - /** - * The migration is running. - * - * Generated from protobuf enum RUNNING = 1; - */ - const RUNNING = 1; - /** - * The migration is paused. - * - * Generated from protobuf enum PAUSED = 2; - */ - const PAUSED = 2; - /** - * The migration is complete. - * - * Generated from protobuf enum COMPLETE = 3; - */ - const COMPLETE = 3; - - private static $valueToName = [ - self::MIGRATION_STATE_UNSPECIFIED => 'MIGRATION_STATE_UNSPECIFIED', - self::RUNNING => 'RUNNING', - self::PAUSED => 'PAUSED', - self::COMPLETE => 'COMPLETE', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStateEvent.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStateEvent.php deleted file mode 100644 index 12ce4113a77..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStateEvent.php +++ /dev/null @@ -1,69 +0,0 @@ -google.datastore.admin.v1.MigrationStateEvent - */ -class MigrationStateEvent extends \Google\Protobuf\Internal\Message -{ - /** - * The new state of the migration. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationState state = 1; - */ - protected $state = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int $state - * The new state of the migration. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\Migration::initOnce(); - parent::__construct($data); - } - - /** - * The new state of the migration. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationState state = 1; - * @return int - */ - public function getState() - { - return $this->state; - } - - /** - * The new state of the migration. - * - * Generated from protobuf field .google.datastore.admin.v1.MigrationState state = 1; - * @param int $var - * @return $this - */ - public function setState($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\Datastore\Admin\V1\MigrationState::class); - $this->state = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStep.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStep.php deleted file mode 100644 index b20fab7b5f1..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/MigrationStep.php +++ /dev/null @@ -1,97 +0,0 @@ -google.datastore.admin.v1.MigrationStep - */ -class MigrationStep -{ - /** - * Unspecified. - * - * Generated from protobuf enum MIGRATION_STEP_UNSPECIFIED = 0; - */ - const MIGRATION_STEP_UNSPECIFIED = 0; - /** - * Pre-migration: the database is prepared for migration. - * - * Generated from protobuf enum PREPARE = 6; - */ - const PREPARE = 6; - /** - * Start of migration. - * - * Generated from protobuf enum START = 1; - */ - const START = 1; - /** - * Writes are applied synchronously to at least one replica. - * - * Generated from protobuf enum APPLY_WRITES_SYNCHRONOUSLY = 7; - */ - const APPLY_WRITES_SYNCHRONOUSLY = 7; - /** - * Data is copied to Cloud Firestore and then verified to match the data in - * Cloud Datastore. - * - * Generated from protobuf enum COPY_AND_VERIFY = 2; - */ - const COPY_AND_VERIFY = 2; - /** - * Eventually-consistent reads are redirected to Cloud Firestore. - * - * Generated from protobuf enum REDIRECT_EVENTUALLY_CONSISTENT_READS = 3; - */ - const REDIRECT_EVENTUALLY_CONSISTENT_READS = 3; - /** - * Strongly-consistent reads are redirected to Cloud Firestore. - * - * Generated from protobuf enum REDIRECT_STRONGLY_CONSISTENT_READS = 4; - */ - const REDIRECT_STRONGLY_CONSISTENT_READS = 4; - /** - * Writes are redirected to Cloud Firestore. - * - * Generated from protobuf enum REDIRECT_WRITES = 5; - */ - const REDIRECT_WRITES = 5; - - private static $valueToName = [ - self::MIGRATION_STEP_UNSPECIFIED => 'MIGRATION_STEP_UNSPECIFIED', - self::PREPARE => 'PREPARE', - self::START => 'START', - self::APPLY_WRITES_SYNCHRONOUSLY => 'APPLY_WRITES_SYNCHRONOUSLY', - self::COPY_AND_VERIFY => 'COPY_AND_VERIFY', - self::REDIRECT_EVENTUALLY_CONSISTENT_READS => 'REDIRECT_EVENTUALLY_CONSISTENT_READS', - self::REDIRECT_STRONGLY_CONSISTENT_READS => 'REDIRECT_STRONGLY_CONSISTENT_READS', - self::REDIRECT_WRITES => 'REDIRECT_WRITES', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/OperationType.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/OperationType.php deleted file mode 100644 index f4a310a591f..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/OperationType.php +++ /dev/null @@ -1,75 +0,0 @@ -google.datastore.admin.v1.OperationType - */ -class OperationType -{ - /** - * Unspecified. - * - * Generated from protobuf enum OPERATION_TYPE_UNSPECIFIED = 0; - */ - const OPERATION_TYPE_UNSPECIFIED = 0; - /** - * ExportEntities. - * - * Generated from protobuf enum EXPORT_ENTITIES = 1; - */ - const EXPORT_ENTITIES = 1; - /** - * ImportEntities. - * - * Generated from protobuf enum IMPORT_ENTITIES = 2; - */ - const IMPORT_ENTITIES = 2; - /** - * CreateIndex. - * - * Generated from protobuf enum CREATE_INDEX = 3; - */ - const CREATE_INDEX = 3; - /** - * DeleteIndex. - * - * Generated from protobuf enum DELETE_INDEX = 4; - */ - const DELETE_INDEX = 4; - - private static $valueToName = [ - self::OPERATION_TYPE_UNSPECIFIED => 'OPERATION_TYPE_UNSPECIFIED', - self::EXPORT_ENTITIES => 'EXPORT_ENTITIES', - self::IMPORT_ENTITIES => 'IMPORT_ENTITIES', - self::CREATE_INDEX => 'CREATE_INDEX', - self::DELETE_INDEX => 'DELETE_INDEX', - ]; - - 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); - } -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Progress.php b/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Progress.php deleted file mode 100644 index 698275844e5..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/proto/src/Google/Cloud/Datastore/Admin/V1/Progress.php +++ /dev/null @@ -1,109 +0,0 @@ -google.datastore.admin.v1.Progress - */ -class Progress extends \Google\Protobuf\Internal\Message -{ - /** - * The amount of work that has been completed. Note that this may be greater - * than work_estimated. - * - * Generated from protobuf field int64 work_completed = 1; - */ - protected $work_completed = 0; - /** - * An estimate of how much work needs to be performed. May be zero if the - * work estimate is unavailable. - * - * Generated from protobuf field int64 work_estimated = 2; - */ - protected $work_estimated = 0; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type int|string $work_completed - * The amount of work that has been completed. Note that this may be greater - * than work_estimated. - * @type int|string $work_estimated - * An estimate of how much work needs to be performed. May be zero if the - * work estimate is unavailable. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Datastore\Admin\V1\DatastoreAdmin::initOnce(); - parent::__construct($data); - } - - /** - * The amount of work that has been completed. Note that this may be greater - * than work_estimated. - * - * Generated from protobuf field int64 work_completed = 1; - * @return int|string - */ - public function getWorkCompleted() - { - return $this->work_completed; - } - - /** - * The amount of work that has been completed. Note that this may be greater - * than work_estimated. - * - * Generated from protobuf field int64 work_completed = 1; - * @param int|string $var - * @return $this - */ - public function setWorkCompleted($var) - { - GPBUtil::checkInt64($var); - $this->work_completed = $var; - - return $this; - } - - /** - * An estimate of how much work needs to be performed. May be zero if the - * work estimate is unavailable. - * - * Generated from protobuf field int64 work_estimated = 2; - * @return int|string - */ - public function getWorkEstimated() - { - return $this->work_estimated; - } - - /** - * An estimate of how much work needs to be performed. May be zero if the - * work estimate is unavailable. - * - * Generated from protobuf field int64 work_estimated = 2; - * @param int|string $var - * @return $this - */ - public function setWorkEstimated($var) - { - GPBUtil::checkInt64($var); - $this->work_estimated = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/create_index.php b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/create_index.php deleted file mode 100644 index 267c6f7fe91..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/create_index.php +++ /dev/null @@ -1,82 +0,0 @@ -createIndex($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Index $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END datastore_v1_generated_DatastoreAdmin_CreateIndex_sync] diff --git a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/delete_index.php b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/delete_index.php deleted file mode 100644 index 43a85a6ca92..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/delete_index.php +++ /dev/null @@ -1,79 +0,0 @@ -deleteIndex($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Index $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END datastore_v1_generated_DatastoreAdmin_DeleteIndex_sync] diff --git a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/export_entities.php b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/export_entities.php deleted file mode 100644 index 125ad265223..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/export_entities.php +++ /dev/null @@ -1,109 +0,0 @@ -setProjectId($projectId) - ->setOutputUrlPrefix($outputUrlPrefix); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $datastoreAdminClient->exportEntities($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var ExportEntitiesResponse $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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]'; - $outputUrlPrefix = '[OUTPUT_URL_PREFIX]'; - - export_entities_sample($projectId, $outputUrlPrefix); -} -// [END datastore_v1_generated_DatastoreAdmin_ExportEntities_sync] diff --git a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/get_index.php b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/get_index.php deleted file mode 100644 index f435a5846b7..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/get_index.php +++ /dev/null @@ -1,57 +0,0 @@ -getIndex($request); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END datastore_v1_generated_DatastoreAdmin_GetIndex_sync] diff --git a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/import_entities.php b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/import_entities.php deleted file mode 100644 index ebc91a43434..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/import_entities.php +++ /dev/null @@ -1,99 +0,0 @@ -setProjectId($projectId) - ->setInputUrl($inputUrl); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $datastoreAdminClient->importEntities($request); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->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]'; - $inputUrl = '[INPUT_URL]'; - - import_entities_sample($projectId, $inputUrl); -} -// [END datastore_v1_generated_DatastoreAdmin_ImportEntities_sync] diff --git a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/list_indexes.php b/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/list_indexes.php deleted file mode 100644 index f5b9703118d..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/samples/V1/DatastoreAdminClient/list_indexes.php +++ /dev/null @@ -1,64 +0,0 @@ -listIndexes($request); - - /** @var Index $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} -// [END datastore_v1_generated_DatastoreAdmin_ListIndexes_sync] diff --git a/owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/BaseClient/DatastoreAdminBaseClient.php b/owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/BaseClient/DatastoreAdminBaseClient.php deleted file mode 100644 index 7a3be504fdc..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/BaseClient/DatastoreAdminBaseClient.php +++ /dev/null @@ -1,449 +0,0 @@ - self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../../resources/datastore_admin_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../../resources/datastore_admin_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../../resources/datastore_admin_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../../resources/datastore_admin_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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); - $this->operationsClient = $this->createOperationsClient($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); - } - - /** - * Creates the specified index. - * A newly created index's initial state is `CREATING`. On completion of the - * returned [google.longrunning.Operation][google.longrunning.Operation], the - * state will be `READY`. If the index already exists, the call will return an - * `ALREADY_EXISTS` status. - * - * During index creation, the process could result in an error, in which - * case the index will move to the `ERROR` state. The process can be recovered - * by fixing the data that caused the error, removing the index with - * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then - * re-creating the index with [create] - * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. - * - * Indexes with a single property cannot be created. - * - * The async variant is {@see self::createIndexAsync()} . - * - * @example samples/V1/DatastoreAdminClient/create_index.php - * - * @param CreateIndexRequest $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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function createIndex(CreateIndexRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('CreateIndex', $request, $callOptions)->wait(); - } - - /** - * Deletes an existing index. - * An index can only be deleted if it is in a `READY` or `ERROR` state. On - * successful execution of the request, the index will be in a `DELETING` - * [state][google.datastore.admin.v1.Index.State]. And on completion of the - * returned [google.longrunning.Operation][google.longrunning.Operation], the - * index will be removed. - * - * During index deletion, the process could result in an error, in which - * case the index will move to the `ERROR` state. The process can be recovered - * by fixing the data that caused the error, followed by calling - * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again. - * - * The async variant is {@see self::deleteIndexAsync()} . - * - * @example samples/V1/DatastoreAdminClient/delete_index.php - * - * @param DeleteIndexRequest $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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function deleteIndex(DeleteIndexRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('DeleteIndex', $request, $callOptions)->wait(); - } - - /** - * Exports a copy of all or a subset of entities from Google Cloud Datastore - * to another storage system, such as Google Cloud Storage. Recent updates to - * entities may not be reflected in the export. The export occurs in the - * background and its progress can be monitored and managed via the - * Operation resource that is created. The output of an export may only be - * used once the associated operation is done. If an export operation is - * cancelled before completion it may leave partial data behind in Google - * Cloud Storage. - * - * The async variant is {@see self::exportEntitiesAsync()} . - * - * @example samples/V1/DatastoreAdminClient/export_entities.php - * - * @param ExportEntitiesRequest $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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function exportEntities(ExportEntitiesRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ExportEntities', $request, $callOptions)->wait(); - } - - /** - * Gets an index. - * - * The async variant is {@see self::getIndexAsync()} . - * - * @example samples/V1/DatastoreAdminClient/get_index.php - * - * @param GetIndexRequest $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 Index - * - * @throws ApiException Thrown if the API call fails. - */ - public function getIndex(GetIndexRequest $request, array $callOptions = []): Index - { - return $this->startApiCall('GetIndex', $request, $callOptions)->wait(); - } - - /** - * Imports entities into Google Cloud Datastore. Existing entities with the - * same key are overwritten. The import occurs in the background and its - * progress can be monitored and managed via the Operation resource that is - * created. If an ImportEntities operation is cancelled, it is possible - * that a subset of the data has already been imported to Cloud Datastore. - * - * The async variant is {@see self::importEntitiesAsync()} . - * - * @example samples/V1/DatastoreAdminClient/import_entities.php - * - * @param ImportEntitiesRequest $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 OperationResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function importEntities(ImportEntitiesRequest $request, array $callOptions = []): OperationResponse - { - return $this->startApiCall('ImportEntities', $request, $callOptions)->wait(); - } - - /** - * Lists the indexes that match the specified filters. Datastore uses an - * eventually consistent query to fetch the list of indexes and may - * occasionally return stale results. - * - * The async variant is {@see self::listIndexesAsync()} . - * - * @example samples/V1/DatastoreAdminClient/list_indexes.php - * - * @param ListIndexesRequest $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 PagedListResponse - * - * @throws ApiException Thrown if the API call fails. - */ - public function listIndexes(ListIndexesRequest $request, array $callOptions = []): PagedListResponse - { - return $this->startApiCall('ListIndexes', $request, $callOptions); - } -} diff --git a/owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/DatastoreAdminClient.php b/owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/DatastoreAdminClient.php deleted file mode 100644 index 7b6254c8a12..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/src/V1/Client/DatastoreAdminClient.php +++ /dev/null @@ -1,40 +0,0 @@ -createIndex(); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datastoreAdminClient->createIndex(); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datastoreAdminClient->resumeOperation($operationName, 'createIndex'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datastoreAdminClient->close(); - * } - * ``` - * - * This service has a new (beta) implementation. See {@see - * \Google\Cloud\Datastore\Admin\V1\Client\DatastoreAdminClient} to use the new - * surface. - */ -class DatastoreAdminGapicClient -{ - use GapicClientTrait; - - /** The name of the service. */ - const SERVICE_NAME = 'google.datastore.admin.v1.DatastoreAdmin'; - - /** The default address of the service. */ - const SERVICE_ADDRESS = 'datastore.googleapis.com'; - - /** 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 $operationsClient; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, - 'clientConfig' => __DIR__ . '/../resources/datastore_admin_client_config.json', - 'descriptorsConfigPath' => __DIR__ . '/../resources/datastore_admin_descriptor_config.php', - 'gcpApiConfigPath' => __DIR__ . '/../resources/datastore_admin_grpc_config.json', - 'credentialsConfig' => [ - 'defaultScopes' => self::$serviceScopes, - ], - 'transportConfig' => [ - 'rest' => [ - 'restClientConfigPath' => __DIR__ . '/../resources/datastore_admin_rest_client_config.php', - ], - ], - ]; - } - - /** - * Return an OperationsClient object with the same endpoint as $this. - * - * @return OperationsClient - */ - public function getOperationsClient() - { - return $this->operationsClient; - } - - /** - * Resume an existing long running operation that was previously started by a long - * running API method. If $methodName is not provided, or does not match a long - * running API method, then the operation can still be resumed, but the - * OperationResponse object will not deserialize the final response. - * - * @param string $operationName The name of the long running operation - * @param string $methodName The name of the method used to start the operation - * - * @return OperationResponse - */ - public function resumeOperation($operationName, $methodName = null) - { - $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; - $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); - $operation->reload(); - return $operation; - } - - /** - * 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); - $this->operationsClient = $this->createOperationsClient($clientOptions); - } - - /** - * Creates the specified index. - * A newly created index's initial state is `CREATING`. On completion of the - * returned [google.longrunning.Operation][google.longrunning.Operation], the - * state will be `READY`. If the index already exists, the call will return an - * `ALREADY_EXISTS` status. - * - * During index creation, the process could result in an error, in which - * case the index will move to the `ERROR` state. The process can be recovered - * by fixing the data that caused the error, removing the index with - * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then - * re-creating the index with [create] - * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. - * - * Indexes with a single property cannot be created. - * - * Sample code: - * ``` - * $datastoreAdminClient = new DatastoreAdminClient(); - * try { - * $operationResponse = $datastoreAdminClient->createIndex(); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datastoreAdminClient->createIndex(); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datastoreAdminClient->resumeOperation($operationName, 'createIndex'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datastoreAdminClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * Project ID against which to make the request. - * @type Index $index - * The index to create. The name and state fields are output only and will be - * ignored. Single property indexes cannot be created or deleted. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function createIndex(array $optionalArgs = []) - { - $request = new CreateIndexRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['index'])) { - $request->setIndex($optionalArgs['index']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('CreateIndex', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Deletes an existing index. - * An index can only be deleted if it is in a `READY` or `ERROR` state. On - * successful execution of the request, the index will be in a `DELETING` - * [state][google.datastore.admin.v1.Index.State]. And on completion of the - * returned [google.longrunning.Operation][google.longrunning.Operation], the - * index will be removed. - * - * During index deletion, the process could result in an error, in which - * case the index will move to the `ERROR` state. The process can be recovered - * by fixing the data that caused the error, followed by calling - * [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again. - * - * Sample code: - * ``` - * $datastoreAdminClient = new DatastoreAdminClient(); - * try { - * $operationResponse = $datastoreAdminClient->deleteIndex(); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datastoreAdminClient->deleteIndex(); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datastoreAdminClient->resumeOperation($operationName, 'deleteIndex'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datastoreAdminClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * Project ID against which to make the request. - * @type string $indexId - * The resource ID of the index to delete. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function deleteIndex(array $optionalArgs = []) - { - $request = new DeleteIndexRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['indexId'])) { - $request->setIndexId($optionalArgs['indexId']); - $requestParamHeaders['index_id'] = $optionalArgs['indexId']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('DeleteIndex', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Exports a copy of all or a subset of entities from Google Cloud Datastore - * to another storage system, such as Google Cloud Storage. Recent updates to - * entities may not be reflected in the export. The export occurs in the - * background and its progress can be monitored and managed via the - * Operation resource that is created. The output of an export may only be - * used once the associated operation is done. If an export operation is - * cancelled before completion it may leave partial data behind in Google - * Cloud Storage. - * - * Sample code: - * ``` - * $datastoreAdminClient = new DatastoreAdminClient(); - * try { - * $projectId = 'project_id'; - * $outputUrlPrefix = 'output_url_prefix'; - * $operationResponse = $datastoreAdminClient->exportEntities($projectId, $outputUrlPrefix); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * $result = $operationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datastoreAdminClient->exportEntities($projectId, $outputUrlPrefix); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datastoreAdminClient->resumeOperation($operationName, 'exportEntities'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * $result = $newOperationResponse->getResult(); - * // doSomethingWith($result) - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datastoreAdminClient->close(); - * } - * ``` - * - * @param string $projectId Required. Project ID against which to make the request. - * @param string $outputUrlPrefix Required. Location for the export metadata and data files. - * - * The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So output_url_prefix should be of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the - * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud - * Storage namespace path (this is not a Cloud Datastore namespace). For more - * information about Cloud Storage namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * - * The resulting files will be nested deeper than the specified URL prefix. - * The final output URL will be provided in the - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] - * field. That value should be used for subsequent ImportEntities operations. - * - * By nesting the data files deeper, the same Cloud Storage bucket can be used - * in multiple ExportEntities operations without conflict. - * @param array $optionalArgs { - * Optional. - * - * @type array $labels - * Client-assigned labels. - * @type EntityFilter $entityFilter - * Description of what data from the project is included in the export. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function exportEntities($projectId, $outputUrlPrefix, array $optionalArgs = []) - { - $request = new ExportEntitiesRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setOutputUrlPrefix($outputUrlPrefix); - $requestParamHeaders['project_id'] = $projectId; - if (isset($optionalArgs['labels'])) { - $request->setLabels($optionalArgs['labels']); - } - - if (isset($optionalArgs['entityFilter'])) { - $request->setEntityFilter($optionalArgs['entityFilter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ExportEntities', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Gets an index. - * - * Sample code: - * ``` - * $datastoreAdminClient = new DatastoreAdminClient(); - * try { - * $response = $datastoreAdminClient->getIndex(); - * } finally { - * $datastoreAdminClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * Project ID against which to make the request. - * @type string $indexId - * The resource ID of the index to get. - * @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\Admin\V1\Index - * - * @throws ApiException if the remote call fails - */ - public function getIndex(array $optionalArgs = []) - { - $request = new GetIndexRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['indexId'])) { - $request->setIndexId($optionalArgs['indexId']); - $requestParamHeaders['index_id'] = $optionalArgs['indexId']; - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('GetIndex', Index::class, $optionalArgs, $request)->wait(); - } - - /** - * Imports entities into Google Cloud Datastore. Existing entities with the - * same key are overwritten. The import occurs in the background and its - * progress can be monitored and managed via the Operation resource that is - * created. If an ImportEntities operation is cancelled, it is possible - * that a subset of the data has already been imported to Cloud Datastore. - * - * Sample code: - * ``` - * $datastoreAdminClient = new DatastoreAdminClient(); - * try { - * $projectId = 'project_id'; - * $inputUrl = 'input_url'; - * $operationResponse = $datastoreAdminClient->importEntities($projectId, $inputUrl); - * $operationResponse->pollUntilComplete(); - * if ($operationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $operationResponse->getError(); - * // handleError($error) - * } - * // Alternatively: - * // start the operation, keep the operation name, and resume later - * $operationResponse = $datastoreAdminClient->importEntities($projectId, $inputUrl); - * $operationName = $operationResponse->getName(); - * // ... do other work - * $newOperationResponse = $datastoreAdminClient->resumeOperation($operationName, 'importEntities'); - * while (!$newOperationResponse->isDone()) { - * // ... do other work - * $newOperationResponse->reload(); - * } - * if ($newOperationResponse->operationSucceeded()) { - * // operation succeeded and returns no value - * } else { - * $error = $newOperationResponse->getError(); - * // handleError($error) - * } - * } finally { - * $datastoreAdminClient->close(); - * } - * ``` - * - * @param string $projectId Required. Project ID against which to make the request. - * @param string $inputUrl Required. The full resource URL of the external storage location. - * Currently, only Google Cloud Storage is supported. So input_url should be - * of the form: - * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where - * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is - * an optional Cloud Storage namespace path (this is not a Cloud Datastore - * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written - * by the ExportEntities operation. For more information about Cloud Storage - * namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * - * For more information, see - * [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. - * @param array $optionalArgs { - * Optional. - * - * @type array $labels - * Client-assigned labels. - * @type EntityFilter $entityFilter - * Optionally specify which kinds/namespaces are to be imported. If provided, - * the list must be a subset of the EntityFilter used in creating the export, - * otherwise a FAILED_PRECONDITION error will be returned. If no filter is - * specified then all entities from the export are imported. - * @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\ApiCore\OperationResponse - * - * @throws ApiException if the remote call fails - */ - public function importEntities($projectId, $inputUrl, array $optionalArgs = []) - { - $request = new ImportEntitiesRequest(); - $requestParamHeaders = []; - $request->setProjectId($projectId); - $request->setInputUrl($inputUrl); - $requestParamHeaders['project_id'] = $projectId; - if (isset($optionalArgs['labels'])) { - $request->setLabels($optionalArgs['labels']); - } - - if (isset($optionalArgs['entityFilter'])) { - $request->setEntityFilter($optionalArgs['entityFilter']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startOperationsCall('ImportEntities', $optionalArgs, $request, $this->getOperationsClient())->wait(); - } - - /** - * Lists the indexes that match the specified filters. Datastore uses an - * eventually consistent query to fetch the list of indexes and may - * occasionally return stale results. - * - * Sample code: - * ``` - * $datastoreAdminClient = new DatastoreAdminClient(); - * try { - * // Iterate over pages of elements - * $pagedResponse = $datastoreAdminClient->listIndexes(); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $datastoreAdminClient->listIndexes(); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $datastoreAdminClient->close(); - * } - * ``` - * - * @param array $optionalArgs { - * Optional. - * - * @type string $projectId - * Project ID against which to make the request. - * @type string $filter - * @type int $pageSize - * The maximum number of resources contained in the underlying API - * response. The API may return fewer values in a page, even if - * there are additional values to be retrieved. - * @type string $pageToken - * A page token is used to specify a page of values to be returned. - * If no page token is specified (the default), the first page - * of values will be returned. Any page token used here must have - * been generated by a previous call to the API. - * @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\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listIndexes(array $optionalArgs = []) - { - $request = new ListIndexesRequest(); - $requestParamHeaders = []; - if (isset($optionalArgs['projectId'])) { - $request->setProjectId($optionalArgs['projectId']); - $requestParamHeaders['project_id'] = $optionalArgs['projectId']; - } - - if (isset($optionalArgs['filter'])) { - $request->setFilter($optionalArgs['filter']); - } - - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->getPagedListResponse('ListIndexes', $optionalArgs, ListIndexesResponse::class, $request); - } -} diff --git a/owl-bot-staging/DatastoreAdmin/v1/src/V1/gapic_metadata.json b/owl-bot-staging/DatastoreAdmin/v1/src/V1/gapic_metadata.json deleted file mode 100644 index 3f24235779c..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services\/RPCs to the corresponding library clients\/methods", - "language": "php", - "protoPackage": "google.datastore.admin.v1", - "libraryPackage": "Google\\Cloud\\Datastore\\Admin\\V1", - "services": { - "DatastoreAdmin": { - "clients": { - "grpc": { - "libraryClient": "DatastoreAdminGapicClient", - "rpcs": { - "CreateIndex": { - "methods": [ - "createIndex" - ] - }, - "DeleteIndex": { - "methods": [ - "deleteIndex" - ] - }, - "ExportEntities": { - "methods": [ - "exportEntities" - ] - }, - "GetIndex": { - "methods": [ - "getIndex" - ] - }, - "ImportEntities": { - "methods": [ - "importEntities" - ] - }, - "ListIndexes": { - "methods": [ - "listIndexes" - ] - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_client_config.json b/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_client_config.json deleted file mode 100644 index 42085b1e5e2..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_client_config.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "interfaces": { - "google.datastore.admin.v1.DatastoreAdmin": { - "retry_codes": { - "no_retry_codes": [], - "no_retry_1_codes": [], - "retry_policy_1_codes": [ - "UNAVAILABLE", - "DEADLINE_EXCEEDED" - ] - }, - "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 - }, - "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 - }, - "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 - } - }, - "methods": { - "CreateIndex": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "DeleteIndex": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ExportEntities": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "GetIndex": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - }, - "ImportEntities": { - "timeout_millis": 60000, - "retry_codes_name": "no_retry_1_codes", - "retry_params_name": "no_retry_1_params" - }, - "ListIndexes": { - "timeout_millis": 60000, - "retry_codes_name": "retry_policy_1_codes", - "retry_params_name": "retry_policy_1_params" - } - } - } - } -} diff --git a/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_descriptor_config.php b/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_descriptor_config.php deleted file mode 100644 index e2891b13099..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_descriptor_config.php +++ /dev/null @@ -1,128 +0,0 @@ - [ - 'google.datastore.admin.v1.DatastoreAdmin' => [ - 'CreateIndex' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Datastore\Admin\V1\Index', - 'metadataReturnType' => '\Google\Cloud\Datastore\Admin\V1\IndexOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - ], - ], - 'DeleteIndex' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Datastore\Admin\V1\Index', - 'metadataReturnType' => '\Google\Cloud\Datastore\Admin\V1\IndexOperationMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - [ - 'keyName' => 'index_id', - 'fieldAccessors' => [ - 'getIndexId', - ], - ], - ], - ], - 'ExportEntities' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Cloud\Datastore\Admin\V1\ExportEntitiesResponse', - 'metadataReturnType' => '\Google\Cloud\Datastore\Admin\V1\ExportEntitiesMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - ], - ], - 'ImportEntities' => [ - 'longRunning' => [ - 'operationReturnType' => '\Google\Protobuf\GPBEmpty', - 'metadataReturnType' => '\Google\Cloud\Datastore\Admin\V1\ImportEntitiesMetadata', - 'initialPollDelayMillis' => '500', - 'pollDelayMultiplier' => '1.5', - 'maxPollDelayMillis' => '5000', - 'totalPollTimeoutMillis' => '300000', - ], - 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - ], - ], - 'GetIndex' => [ - 'callType' => \Google\ApiCore\Call::UNARY_CALL, - 'responseType' => 'Google\Cloud\Datastore\Admin\V1\Index', - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - [ - 'keyName' => 'index_id', - 'fieldAccessors' => [ - 'getIndexId', - ], - ], - ], - ], - 'ListIndexes' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getIndexes', - ], - 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, - 'responseType' => 'Google\Cloud\Datastore\Admin\V1\ListIndexesResponse', - 'headerParams' => [ - [ - 'keyName' => 'project_id', - 'fieldAccessors' => [ - 'getProjectId', - ], - ], - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_rest_client_config.php b/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_rest_client_config.php deleted file mode 100644 index 08331544a7e..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/src/V1/resources/datastore_admin_rest_client_config.php +++ /dev/null @@ -1,134 +0,0 @@ - [ - 'google.datastore.admin.v1.DatastoreAdmin' => [ - 'CreateIndex' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}/indexes', - 'body' => 'index', - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'DeleteIndex' => [ - 'method' => 'delete', - 'uriTemplate' => '/v1/projects/{project_id}/indexes/{index_id}', - 'placeholders' => [ - 'index_id' => [ - 'getters' => [ - 'getIndexId', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'ExportEntities' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}:export', - 'body' => '*', - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'GetIndex' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/projects/{project_id}/indexes/{index_id}', - 'placeholders' => [ - 'index_id' => [ - 'getters' => [ - 'getIndexId', - ], - ], - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'ImportEntities' => [ - 'method' => 'post', - 'uriTemplate' => '/v1/projects/{project_id}:import', - 'body' => '*', - 'placeholders' => [ - 'project_id' => [ - 'getters' => [ - 'getProjectId', - ], - ], - ], - ], - 'ListIndexes' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/projects/{project_id}/indexes', - '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/DatastoreAdmin/v1/tests/Unit/V1/Client/DatastoreAdminClientTest.php b/owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/Client/DatastoreAdminClientTest.php deleted file mode 100644 index f183c3c2f2c..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/Client/DatastoreAdminClientTest.php +++ /dev/null @@ -1,757 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DatastoreAdminClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DatastoreAdminClient($options); - } - - /** @test */ - public function createIndexTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $projectId2 = 'projectId2939242356'; - $indexId = 'indexId112508840'; - $kind = 'kind3292052'; - $expectedResponse = new Index(); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setIndexId($indexId); - $expectedResponse->setKind($kind); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $request = new CreateIndexRequest(); - $response = $gapicClient->createIndex($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/CreateIndex', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createIndexExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - $request = new CreateIndexRequest(); - $response = $gapicClient->createIndex($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteIndexTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $projectId2 = 'projectId2939242356'; - $indexId2 = 'indexId2746815835'; - $kind = 'kind3292052'; - $expectedResponse = new Index(); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setIndexId($indexId2); - $expectedResponse->setKind($kind); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $request = new DeleteIndexRequest(); - $response = $gapicClient->deleteIndex($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/DeleteIndex', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteIndexExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - $request = new DeleteIndexRequest(); - $response = $gapicClient->deleteIndex($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteIndexTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportEntitiesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportEntitiesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $outputUrl = 'outputUrl-1273518799'; - $expectedResponse = new ExportEntitiesResponse(); - $expectedResponse->setOutputUrl($outputUrl); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportEntitiesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $projectId = 'projectId-1969970175'; - $outputUrlPrefix = 'outputUrlPrefix1058210144'; - $request = (new ExportEntitiesRequest()) - ->setProjectId($projectId) - ->setOutputUrlPrefix($outputUrlPrefix); - $response = $gapicClient->exportEntities($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/ExportEntities', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualApiRequestObject->getOutputUrlPrefix(); - $this->assertProtobufEquals($outputUrlPrefix, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportEntitiesTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportEntitiesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportEntitiesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $outputUrlPrefix = 'outputUrlPrefix1058210144'; - $request = (new ExportEntitiesRequest()) - ->setProjectId($projectId) - ->setOutputUrlPrefix($outputUrlPrefix); - $response = $gapicClient->exportEntities($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportEntitiesTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getIndexTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $projectId2 = 'projectId2939242356'; - $indexId2 = 'indexId2746815835'; - $kind = 'kind3292052'; - $expectedResponse = new Index(); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setIndexId($indexId2); - $expectedResponse->setKind($kind); - $transport->addResponse($expectedResponse); - $request = new GetIndexRequest(); - $response = $gapicClient->getIndex($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.admin.v1.DatastoreAdmin/GetIndex', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIndexExceptionTest() - { - $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); - $request = new GetIndexRequest(); - try { - $gapicClient->getIndex($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 importEntitiesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importEntitiesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importEntitiesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $projectId = 'projectId-1969970175'; - $inputUrl = 'inputUrl1707300730'; - $request = (new ImportEntitiesRequest()) - ->setProjectId($projectId) - ->setInputUrl($inputUrl); - $response = $gapicClient->importEntities($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/ImportEntities', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualApiRequestObject->getInputUrl(); - $this->assertProtobufEquals($inputUrl, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importEntitiesTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function importEntitiesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importEntitiesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $inputUrl = 'inputUrl1707300730'; - $request = (new ImportEntitiesRequest()) - ->setProjectId($projectId) - ->setInputUrl($inputUrl); - $response = $gapicClient->importEntities($request); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importEntitiesTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function listIndexesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $indexesElement = new Index(); - $indexes = [ - $indexesElement, - ]; - $expectedResponse = new ListIndexesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setIndexes($indexes); - $transport->addResponse($expectedResponse); - $request = new ListIndexesRequest(); - $response = $gapicClient->listIndexes($request); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getIndexes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/ListIndexes', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listIndexesExceptionTest() - { - $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); - $request = new ListIndexesRequest(); - try { - $gapicClient->listIndexes($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 createIndexAsyncTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $projectId2 = 'projectId2939242356'; - $indexId = 'indexId112508840'; - $kind = 'kind3292052'; - $expectedResponse = new Index(); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setIndexId($indexId); - $expectedResponse->setKind($kind); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $request = new CreateIndexRequest(); - $response = $gapicClient->createIndexAsync($request)->wait(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/CreateIndex', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } -} diff --git a/owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/DatastoreAdminClientTest.php b/owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/DatastoreAdminClientTest.php deleted file mode 100644 index 64af0e10aeb..00000000000 --- a/owl-bot-staging/DatastoreAdmin/v1/tests/Unit/V1/DatastoreAdminClientTest.php +++ /dev/null @@ -1,666 +0,0 @@ -getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); - } - - /** @return DatastoreAdminClient */ - private function createClient(array $options = []) - { - $options += [ - 'credentials' => $this->createCredentials(), - ]; - return new DatastoreAdminClient($options); - } - - /** @test */ - public function createIndexTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $projectId2 = 'projectId2939242356'; - $indexId = 'indexId112508840'; - $kind = 'kind3292052'; - $expectedResponse = new Index(); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setIndexId($indexId); - $expectedResponse->setKind($kind); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/createIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $response = $gapicClient->createIndex(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/CreateIndex', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function createIndexExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - $response = $gapicClient->createIndex(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createIndexTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteIndexTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $projectId2 = 'projectId2939242356'; - $indexId2 = 'indexId2746815835'; - $kind = 'kind3292052'; - $expectedResponse = new Index(); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setIndexId($indexId2); - $expectedResponse->setKind($kind); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteIndexTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - $response = $gapicClient->deleteIndex(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/DeleteIndex', $actualApiFuncCall); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteIndexTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function deleteIndexExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteIndexTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - $response = $gapicClient->deleteIndex(); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteIndexTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportEntitiesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportEntitiesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $outputUrl = 'outputUrl-1273518799'; - $expectedResponse = new ExportEntitiesResponse(); - $expectedResponse->setOutputUrl($outputUrl); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/exportEntitiesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $projectId = 'projectId-1969970175'; - $outputUrlPrefix = 'outputUrlPrefix1058210144'; - $response = $gapicClient->exportEntities($projectId, $outputUrlPrefix); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/ExportEntities', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualApiRequestObject->getOutputUrlPrefix(); - $this->assertProtobufEquals($outputUrlPrefix, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportEntitiesTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function exportEntitiesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/exportEntitiesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $outputUrlPrefix = 'outputUrlPrefix1058210144'; - $response = $gapicClient->exportEntities($projectId, $outputUrlPrefix); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/exportEntitiesTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function getIndexTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $projectId2 = 'projectId2939242356'; - $indexId2 = 'indexId2746815835'; - $kind = 'kind3292052'; - $expectedResponse = new Index(); - $expectedResponse->setProjectId($projectId2); - $expectedResponse->setIndexId($indexId2); - $expectedResponse->setKind($kind); - $transport->addResponse($expectedResponse); - $response = $gapicClient->getIndex(); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/GetIndex', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function getIndexExceptionTest() - { - $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); - try { - $gapicClient->getIndex(); - // 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 importEntitiesTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importEntitiesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $expectedResponse = new GPBEmpty(); - $anyResponse = new Any(); - $anyResponse->setValue($expectedResponse->serializeToString()); - $completeOperation = new Operation(); - $completeOperation->setName('operations/importEntitiesTest'); - $completeOperation->setDone(true); - $completeOperation->setResponse($anyResponse); - $operationsTransport->addResponse($completeOperation); - // Mock request - $projectId = 'projectId-1969970175'; - $inputUrl = 'inputUrl1707300730'; - $response = $gapicClient->importEntities($projectId, $inputUrl); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $apiRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($apiRequests)); - $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); - $this->assertSame(0, count($operationsRequestsEmpty)); - $actualApiFuncCall = $apiRequests[0]->getFuncCall(); - $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/ImportEntities', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getProjectId(); - $this->assertProtobufEquals($projectId, $actualValue); - $actualValue = $actualApiRequestObject->getInputUrl(); - $this->assertProtobufEquals($inputUrl, $actualValue); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importEntitiesTest'); - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - $this->assertTrue($response->isDone()); - $this->assertEquals($expectedResponse, $response->getResult()); - $apiRequestsEmpty = $transport->popReceivedCalls(); - $this->assertSame(0, count($apiRequestsEmpty)); - $operationsRequests = $operationsTransport->popReceivedCalls(); - $this->assertSame(1, count($operationsRequests)); - $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); - $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); - $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); - $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function importEntitiesExceptionTest() - { - $operationsTransport = $this->createTransport(); - $operationsClient = new OperationsClient([ - 'apiEndpoint' => '', - 'transport' => $operationsTransport, - 'credentials' => $this->createCredentials(), - ]); - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - 'operationsClient' => $operationsClient, - ]); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - // Mock response - $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/importEntitiesTest'); - $incompleteOperation->setDone(false); - $transport->addResponse($incompleteOperation); - $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); - $operationsTransport->addResponse(null, $status); - // Mock request - $projectId = 'projectId-1969970175'; - $inputUrl = 'inputUrl1707300730'; - $response = $gapicClient->importEntities($projectId, $inputUrl); - $this->assertFalse($response->isDone()); - $this->assertNull($response->getResult()); - $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/importEntitiesTest'); - try { - $response->pollUntilComplete([ - 'initialPollDelayMillis' => 1, - ]); - // If the pollUntilComplete() 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 stubs are exhausted - $transport->popReceivedCalls(); - $operationsTransport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - $this->assertTrue($operationsTransport->isExhausted()); - } - - /** @test */ - public function listIndexesTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $indexesElement = new Index(); - $indexes = [ - $indexesElement, - ]; - $expectedResponse = new ListIndexesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setIndexes($indexes); - $transport->addResponse($expectedResponse); - $response = $gapicClient->listIndexes(); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getIndexes()[0], $resources[0]); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.datastore.admin.v1.DatastoreAdmin/ListIndexes', $actualFuncCall); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function listIndexesExceptionTest() - { - $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); - try { - $gapicClient->listIndexes(); - // 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()); - } -}