From a7a8f021c45ded0cb0dda8f4732ee540e3f1c821 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Thu, 14 Nov 2019 03:03:16 -0800 Subject: [PATCH] [CHANGE ME] Re-generated Spanner to pick up changes in the API or client library generator. --- .../Instance/V1/SpannerInstanceAdmin.php | 280 +++++++++--------- .../Database/V1/CreateDatabaseRequest.php | 3 +- .../Database/V1/DatabaseAdminGrpcClient.php | 7 +- .../Admin/Database/V1/DropDatabaseRequest.php | 3 +- .../V1/Gapic/DatabaseAdminGapicClient.php | 229 +++++++------- .../Database/V1/GetDatabaseDdlRequest.php | 3 +- .../Database/V1/GetDatabaseDdlResponse.php | 3 +- .../Admin/Database/V1/GetDatabaseRequest.php | 3 +- .../Database/V1/ListDatabasesRequest.php | 23 +- .../Database/V1/ListDatabasesResponse.php | 19 +- .../Database/V1/UpdateDatabaseDdlRequest.php | 60 ++-- .../database_admin_client_config.json | 10 +- .../database_admin_rest_client_config.php | 22 +- .../V1/Gapic/InstanceAdminGapicClient.php | 19 +- .../Admin/Instance/V1/GetInstanceRequest.php | 42 +++ Spanner/src/Admin/Instance/V1/Instance.php | 62 ++++ Spanner/src/V1/BatchCreateSessionsRequest.php | 15 +- .../src/V1/BatchCreateSessionsResponse.php | 3 +- Spanner/src/V1/BeginTransactionRequest.php | 3 +- Spanner/src/V1/ExecuteBatchDmlRequest.php | 56 ++-- .../V1/ExecuteBatchDmlRequest/Statement.php | 16 +- Spanner/src/V1/ExecuteBatchDmlResponse.php | 85 +++--- Spanner/src/V1/ExecuteSqlRequest.php | 72 +++-- Spanner/src/V1/Gapic/SpannerGapicClient.php | 249 +++++++++------- Spanner/src/V1/ListSessionsRequest.php | 12 +- Spanner/src/V1/ListSessionsResponse.php | 16 +- Spanner/src/V1/PartitionQueryRequest.php | 40 ++- Spanner/src/V1/PartitionReadRequest.php | 80 +++-- Spanner/src/V1/ReadRequest.php | 148 +++++---- Spanner/src/V1/SpannerGrpcClient.php | 66 +++-- .../V1/resources/spanner_client_config.json | 8 +- Spanner/synth.metadata | 10 +- .../Database/V1/DatabaseAdminClientTest.php | 188 ++++++------ .../Instance/V1/InstanceAdminClientTest.php | 30 +- Spanner/tests/Unit/V1/SpannerClientTest.php | 9 +- 35 files changed, 1099 insertions(+), 795 deletions(-) diff --git a/Spanner/metadata/Admin/Instance/V1/SpannerInstanceAdmin.php b/Spanner/metadata/Admin/Instance/V1/SpannerInstanceAdmin.php index 78e92dd0913c..bacf345ce3c3 100644 --- a/Spanner/metadata/Admin/Instance/V1/SpannerInstanceAdmin.php +++ b/Spanner/metadata/Admin/Instance/V1/SpannerInstanceAdmin.php @@ -25,7 +25,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile(hex2bin( - "0ac5280a3d676f6f676c652f7370616e6e65722f61646d696e2f696e7374" . + "0a8c290a3d676f6f676c652f7370616e6e65722f61646d696e2f696e7374" . "616e63652f76312f7370616e6e65725f696e7374616e63655f61646d696e" . "2e70726f746f1220676f6f676c652e7370616e6e65722e61646d696e2e69" . "6e7374616e63652e76311a17676f6f676c652f6170692f636c69656e742e" . @@ -52,7 +52,7 @@ public static function initOnce() { "60ea415d0a257370616e6e65722e676f6f676c65617069732e636f6d2f49" . "6e7374616e6365436f6e666967123470726f6a656374732f7b70726f6a65" . "63747d2f696e7374616e6365436f6e666967732f7b696e7374616e63655f" . - "636f6e6669677d22be030a08496e7374616e6365120c0a046e616d651801" . + "636f6e6669677d22d5030a08496e7374616e6365120c0a046e616d651801" . "20012809123a0a06636f6e666967180220012809422afa41270a25737061" . "6e6e65722e676f6f676c65617069732e636f6d2f496e7374616e6365436f" . "6e66696712140a0c646973706c61795f6e616d6518032001280912120a0a" . @@ -61,144 +61,146 @@ public static function initOnce() { "6e63652e76312e496e7374616e63652e537461746512460a066c6162656c" . "7318072003280b32362e676f6f676c652e7370616e6e65722e61646d696e" . "2e696e7374616e63652e76312e496e7374616e63652e4c6162656c73456e" . - "7472791a2d0a0b4c6162656c73456e747279120b0a036b65791801200128" . - "09120d0a0576616c75651802200128093a02380122370a05537461746512" . - "150a1153544154455f554e5350454349464945441000120c0a0843524541" . - "54494e47100112090a05524541445910023a4dea414a0a1f7370616e6e65" . - "722e676f6f676c65617069732e636f6d2f496e7374616e6365122770726f" . - "6a656374732f7b70726f6a6563747d2f696e7374616e6365732f7b696e73" . - "74616e63657d2288010a1a4c697374496e7374616e6365436f6e66696773" . - "5265717565737412430a06706172656e741801200128094233e04102fa41" . - "2d0a2b636c6f75647265736f757263656d616e616765722e676f6f676c65" . - "617069732e636f6d2f50726f6a65637412110a09706167655f73697a6518" . - "022001280512120a0a706167655f746f6b656e1803200128092282010a1b" . - "4c697374496e7374616e6365436f6e66696773526573706f6e7365124a0a" . - "10696e7374616e63655f636f6e6669677318012003280b32302e676f6f67" . - "6c652e7370616e6e65722e61646d696e2e696e7374616e63652e76312e49" . - "6e7374616e6365436f6e66696712170a0f6e6578745f706167655f746f6b" . - "656e18022001280922570a18476574496e7374616e6365436f6e66696752" . - "657175657374123b0a046e616d65180120012809422de04102fa41270a25" . - "7370616e6e65722e676f6f676c65617069732e636f6d2f496e7374616e63" . - "65436f6e666967224b0a12476574496e7374616e63655265717565737412" . - "350a046e616d651801200128094227e04102fa41210a1f7370616e6e6572" . - "2e676f6f676c65617069732e636f6d2f496e7374616e636522b9010a1543" . - "7265617465496e7374616e63655265717565737412430a06706172656e74" . - "1801200128094233e04102fa412d0a2b636c6f75647265736f757263656d" . - "616e616765722e676f6f676c65617069732e636f6d2f50726f6a65637412" . - "180a0b696e7374616e63655f69641802200128094203e0410212410a0869" . - "6e7374616e636518032001280b322a2e676f6f676c652e7370616e6e6572" . - "2e61646d696e2e696e7374616e63652e76312e496e7374616e63654203e0" . - "41022292010a144c697374496e7374616e6365735265717565737412430a" . - "06706172656e741801200128094233e04102fa412d0a2b636c6f75647265" . - "736f757263656d616e616765722e676f6f676c65617069732e636f6d2f50" . - "726f6a65637412110a09706167655f73697a6518022001280512120a0a70" . - "6167655f746f6b656e180320012809120e0a0666696c7465721804200128" . - "09226f0a154c697374496e7374616e636573526573706f6e7365123d0a09" . - "696e7374616e63657318012003280b322a2e676f6f676c652e7370616e6e" . - "65722e61646d696e2e696e7374616e63652e76312e496e7374616e636512" . - "170a0f6e6578745f706167655f746f6b656e180220012809228f010a1555" . - "7064617465496e7374616e63655265717565737412410a08696e7374616e" . - "636518012001280b322a2e676f6f676c652e7370616e6e65722e61646d69" . - "6e2e696e7374616e63652e76312e496e7374616e63654203e0410212330a" . - "0a6669656c645f6d61736b18022001280b321a2e676f6f676c652e70726f" . - "746f6275662e4669656c644d61736b4203e04102224e0a1544656c657465" . - "496e7374616e63655265717565737412350a046e616d6518012001280942" . - "27e04102fa41210a1f7370616e6e65722e676f6f676c65617069732e636f" . - "6d2f496e7374616e636522e5010a16437265617465496e7374616e63654d" . - "65746164617461123c0a08696e7374616e636518012001280b322a2e676f" . - "6f676c652e7370616e6e65722e61646d696e2e696e7374616e63652e7631" . - "2e496e7374616e6365122e0a0a73746172745f74696d6518022001280b32" . - "1a2e676f6f676c652e70726f746f6275662e54696d657374616d70122f0a" . - "0b63616e63656c5f74696d6518032001280b321a2e676f6f676c652e7072" . - "6f746f6275662e54696d657374616d70122c0a08656e645f74696d651804" . - "2001280b321a2e676f6f676c652e70726f746f6275662e54696d65737461" . - "6d7022e5010a16557064617465496e7374616e63654d6574616461746112" . - "3c0a08696e7374616e636518012001280b322a2e676f6f676c652e737061" . - "6e6e65722e61646d696e2e696e7374616e63652e76312e496e7374616e63" . - "65122e0a0a73746172745f74696d6518022001280b321a2e676f6f676c65" . - "2e70726f746f6275662e54696d657374616d70122f0a0b63616e63656c5f" . - "74696d6518032001280b321a2e676f6f676c652e70726f746f6275662e54" . - "696d657374616d70122c0a08656e645f74696d6518042001280b321a2e67" . - "6f6f676c652e70726f746f6275662e54696d657374616d7032bf100a0d49" . - "6e7374616e636541646d696e12cc010a134c697374496e7374616e636543" . - "6f6e66696773123c2e676f6f676c652e7370616e6e65722e61646d696e2e" . - "696e7374616e63652e76312e4c697374496e7374616e6365436f6e666967" . - "73526571756573741a3d2e676f6f676c652e7370616e6e65722e61646d69" . - "6e2e696e7374616e63652e76312e4c697374496e7374616e6365436f6e66" . - "696773526573706f6e7365223882d3e493022912272f76312f7b70617265" . - "6e743d70726f6a656374732f2a7d2f696e7374616e6365436f6e66696773" . - "da4106706172656e7412b9010a11476574496e7374616e6365436f6e6669" . - "67123a2e676f6f676c652e7370616e6e65722e61646d696e2e696e737461" . - "6e63652e76312e476574496e7374616e6365436f6e666967526571756573" . - "741a302e676f6f676c652e7370616e6e65722e61646d696e2e696e737461" . - "6e63652e76312e496e7374616e6365436f6e666967223682d3e493022912" . - "272f76312f7b6e616d653d70726f6a656374732f2a2f696e7374616e6365" . - "436f6e666967732f2a7dda41046e616d6512b4010a0d4c697374496e7374" . - "616e63657312362e676f6f676c652e7370616e6e65722e61646d696e2e69" . - "6e7374616e63652e76312e4c697374496e7374616e636573526571756573" . - "741a372e676f6f676c652e7370616e6e65722e61646d696e2e696e737461" . - "6e63652e76312e4c697374496e7374616e636573526573706f6e73652232" . - "82d3e493022312212f76312f7b706172656e743d70726f6a656374732f2a" . - "7d2f696e7374616e636573da4106706172656e7412a1010a0b476574496e" . - "7374616e636512342e676f6f676c652e7370616e6e65722e61646d696e2e" . - "696e7374616e63652e76312e476574496e7374616e636552657175657374" . - "1a2a2e676f6f676c652e7370616e6e65722e61646d696e2e696e7374616e" . - "63652e76312e496e7374616e6365223082d3e493022312212f76312f7b6e" . - "616d653d70726f6a656374732f2a2f696e7374616e6365732f2a7dda4104" . - "6e616d65129c020a0e437265617465496e7374616e636512372e676f6f67" . - "6c652e7370616e6e65722e61646d696e2e696e7374616e63652e76312e43" . - "7265617465496e7374616e6365526571756573741a1d2e676f6f676c652e" . - "6c6f6e6772756e6e696e672e4f7065726174696f6e22b10182d3e4930226" . - "22212f76312f7b706172656e743d70726f6a656374732f2a7d2f696e7374" . - "616e6365733a012ada411b706172656e742c696e7374616e63655f69642c" . - "696e7374616e6365ca41640a29676f6f676c652e7370616e6e65722e6164" . - "6d696e2e696e7374616e63652e76312e496e7374616e63651237676f6f67" . - "6c652e7370616e6e65722e61646d696e2e696e7374616e63652e76312e43" . - "7265617465496e7374616e63654d65746164617461129d020a0e55706461" . - "7465496e7374616e636512372e676f6f676c652e7370616e6e65722e6164" . - "6d696e2e696e7374616e63652e76312e557064617465496e7374616e6365" . - "526571756573741a1d2e676f6f676c652e6c6f6e6772756e6e696e672e4f" . - "7065726174696f6e22b20182d3e493022f322a2f76312f7b696e7374616e" . - "63652e6e616d653d70726f6a656374732f2a2f696e7374616e6365732f2a" . - "7d3a012ada4113696e7374616e63652c6669656c645f6d61736bca41640a" . - "29676f6f676c652e7370616e6e65722e61646d696e2e696e7374616e6365" . - "2e76312e496e7374616e63651237676f6f676c652e7370616e6e65722e61" . - "646d696e2e696e7374616e63652e76312e557064617465496e7374616e63" . - "654d657461646174611293010a0e44656c657465496e7374616e63651237" . + "74727912150a0d656e64706f696e745f75726c731808200328091a2d0a0b" . + "4c6162656c73456e747279120b0a036b6579180120012809120d0a057661" . + "6c75651802200128093a02380122370a05537461746512150a1153544154" . + "455f554e5350454349464945441000120c0a084352454154494e47100112" . + "090a05524541445910023a4dea414a0a1f7370616e6e65722e676f6f676c" . + "65617069732e636f6d2f496e7374616e6365122770726f6a656374732f7b" . + "70726f6a6563747d2f696e7374616e6365732f7b696e7374616e63657d22" . + "88010a1a4c697374496e7374616e6365436f6e6669677352657175657374" . + "12430a06706172656e741801200128094233e04102fa412d0a2b636c6f75" . + "647265736f757263656d616e616765722e676f6f676c65617069732e636f" . + "6d2f50726f6a65637412110a09706167655f73697a651802200128051212" . + "0a0a706167655f746f6b656e1803200128092282010a1b4c697374496e73" . + "74616e6365436f6e66696773526573706f6e7365124a0a10696e7374616e" . + "63655f636f6e6669677318012003280b32302e676f6f676c652e7370616e" . + "6e65722e61646d696e2e696e7374616e63652e76312e496e7374616e6365" . + "436f6e66696712170a0f6e6578745f706167655f746f6b656e1802200128" . + "0922570a18476574496e7374616e6365436f6e6669675265717565737412" . + "3b0a046e616d65180120012809422de04102fa41270a257370616e6e6572" . + "2e676f6f676c65617069732e636f6d2f496e7374616e6365436f6e666967" . + "227b0a12476574496e7374616e63655265717565737412350a046e616d65" . + "1801200128094227e04102fa41210a1f7370616e6e65722e676f6f676c65" . + "617069732e636f6d2f496e7374616e6365122e0a0a6669656c645f6d6173" . + "6b18022001280b321a2e676f6f676c652e70726f746f6275662e4669656c" . + "644d61736b22b9010a15437265617465496e7374616e6365526571756573" . + "7412430a06706172656e741801200128094233e04102fa412d0a2b636c6f" . + "75647265736f757263656d616e616765722e676f6f676c65617069732e63" . + "6f6d2f50726f6a65637412180a0b696e7374616e63655f69641802200128" . + "094203e0410212410a08696e7374616e636518032001280b322a2e676f6f" . + "676c652e7370616e6e65722e61646d696e2e696e7374616e63652e76312e" . + "496e7374616e63654203e041022292010a144c697374496e7374616e6365" . + "735265717565737412430a06706172656e741801200128094233e04102fa" . + "412d0a2b636c6f75647265736f757263656d616e616765722e676f6f676c" . + "65617069732e636f6d2f50726f6a65637412110a09706167655f73697a65" . + "18022001280512120a0a706167655f746f6b656e180320012809120e0a06" . + "66696c746572180420012809226f0a154c697374496e7374616e63657352" . + "6573706f6e7365123d0a09696e7374616e63657318012003280b322a2e67" . + "6f6f676c652e7370616e6e65722e61646d696e2e696e7374616e63652e76" . + "312e496e7374616e636512170a0f6e6578745f706167655f746f6b656e18" . + "0220012809228f010a15557064617465496e7374616e6365526571756573" . + "7412410a08696e7374616e636518012001280b322a2e676f6f676c652e73" . + "70616e6e65722e61646d696e2e696e7374616e63652e76312e496e737461" . + "6e63654203e0410212330a0a6669656c645f6d61736b18022001280b321a" . + "2e676f6f676c652e70726f746f6275662e4669656c644d61736b4203e041" . + "02224e0a1544656c657465496e7374616e63655265717565737412350a04" . + "6e616d651801200128094227e04102fa41210a1f7370616e6e65722e676f" . + "6f676c65617069732e636f6d2f496e7374616e636522e5010a1643726561" . + "7465496e7374616e63654d65746164617461123c0a08696e7374616e6365" . + "18012001280b322a2e676f6f676c652e7370616e6e65722e61646d696e2e" . + "696e7374616e63652e76312e496e7374616e6365122e0a0a73746172745f" . + "74696d6518022001280b321a2e676f6f676c652e70726f746f6275662e54" . + "696d657374616d70122f0a0b63616e63656c5f74696d6518032001280b32" . + "1a2e676f6f676c652e70726f746f6275662e54696d657374616d70122c0a" . + "08656e645f74696d6518042001280b321a2e676f6f676c652e70726f746f" . + "6275662e54696d657374616d7022e5010a16557064617465496e7374616e" . + "63654d65746164617461123c0a08696e7374616e636518012001280b322a" . "2e676f6f676c652e7370616e6e65722e61646d696e2e696e7374616e6365" . - "2e76312e44656c657465496e7374616e6365526571756573741a162e676f" . - "6f676c652e70726f746f6275662e456d707479223082d3e49302232a212f" . - "76312f7b6e616d653d70726f6a656374732f2a2f696e7374616e6365732f" . - "2a7dda41046e616d65129a010a0c53657449616d506f6c69637912222e67" . - "6f6f676c652e69616d2e76312e53657449616d506f6c6963795265717565" . - "73741a152e676f6f676c652e69616d2e76312e506f6c696379224f82d3e4" . - "93023722322f76312f7b7265736f757263653d70726f6a656374732f2a2f" . - "696e7374616e6365732f2a7d3a73657449616d506f6c6963793a012ada41" . - "0f7265736f757263652c706f6c6963791293010a0c47657449616d506f6c" . - "69637912222e676f6f676c652e69616d2e76312e47657449616d506f6c69" . - "6379526571756573741a152e676f6f676c652e69616d2e76312e506f6c69" . - "6379224882d3e493023722322f76312f7b7265736f757263653d70726f6a" . - "656374732f2a2f696e7374616e6365732f2a7d3a67657449616d506f6c69" . - "63793a012ada41087265736f7572636512c5010a125465737449616d5065" . - "726d697373696f6e7312282e676f6f676c652e69616d2e76312e54657374" . - "49616d5065726d697373696f6e73526571756573741a292e676f6f676c65" . - "2e69616d2e76312e5465737449616d5065726d697373696f6e7352657370" . - "6f6e7365225a82d3e493023d22382f76312f7b7265736f757263653d7072" . - "6f6a656374732f2a2f696e7374616e6365732f2a7d3a7465737449616d50" . - "65726d697373696f6e733a012ada41147265736f757263652c7065726d69" . - "7373696f6e731a78ca41167370616e6e65722e676f6f676c65617069732e" . - "636f6dd2415c68747470733a2f2f7777772e676f6f676c65617069732e63" . - "6f6d2f617574682f636c6f75642d706c6174666f726d2c68747470733a2f" . - "2f7777772e676f6f676c65617069732e636f6d2f617574682f7370616e6e" . - "65722e61646d696e42df010a24636f6d2e676f6f676c652e7370616e6e65" . - "722e61646d696e2e696e7374616e63652e763142195370616e6e6572496e" . - "7374616e636541646d696e50726f746f50015a48676f6f676c652e676f6c" . - "616e672e6f72672f67656e70726f746f2f676f6f676c65617069732f7370" . - "616e6e65722f61646d696e2f696e7374616e63652f76313b696e7374616e" . - "6365aa0226476f6f676c652e436c6f75642e5370616e6e65722e41646d69" . - "6e2e496e7374616e63652e5631ca0226476f6f676c655c436c6f75645c53" . - "70616e6e65725c41646d696e5c496e7374616e63655c5631620670726f74" . - "6f33" + "2e76312e496e7374616e6365122e0a0a73746172745f74696d6518022001" . + "280b321a2e676f6f676c652e70726f746f6275662e54696d657374616d70" . + "122f0a0b63616e63656c5f74696d6518032001280b321a2e676f6f676c65" . + "2e70726f746f6275662e54696d657374616d70122c0a08656e645f74696d" . + "6518042001280b321a2e676f6f676c652e70726f746f6275662e54696d65" . + "7374616d7032bf100a0d496e7374616e636541646d696e12cc010a134c69" . + "7374496e7374616e6365436f6e66696773123c2e676f6f676c652e737061" . + "6e6e65722e61646d696e2e696e7374616e63652e76312e4c697374496e73" . + "74616e6365436f6e66696773526571756573741a3d2e676f6f676c652e73" . + "70616e6e65722e61646d696e2e696e7374616e63652e76312e4c69737449" . + "6e7374616e6365436f6e66696773526573706f6e7365223882d3e4930229" . + "12272f76312f7b706172656e743d70726f6a656374732f2a7d2f696e7374" . + "616e6365436f6e66696773da4106706172656e7412b9010a11476574496e" . + "7374616e6365436f6e666967123a2e676f6f676c652e7370616e6e65722e" . + "61646d696e2e696e7374616e63652e76312e476574496e7374616e636543" . + "6f6e666967526571756573741a302e676f6f676c652e7370616e6e65722e" . + "61646d696e2e696e7374616e63652e76312e496e7374616e6365436f6e66" . + "6967223682d3e493022912272f76312f7b6e616d653d70726f6a65637473" . + "2f2a2f696e7374616e6365436f6e666967732f2a7dda41046e616d6512b4" . + "010a0d4c697374496e7374616e63657312362e676f6f676c652e7370616e" . + "6e65722e61646d696e2e696e7374616e63652e76312e4c697374496e7374" . + "616e636573526571756573741a372e676f6f676c652e7370616e6e65722e" . + "61646d696e2e696e7374616e63652e76312e4c697374496e7374616e6365" . + "73526573706f6e7365223282d3e493022312212f76312f7b706172656e74" . + "3d70726f6a656374732f2a7d2f696e7374616e636573da4106706172656e" . + "7412a1010a0b476574496e7374616e636512342e676f6f676c652e737061" . + "6e6e65722e61646d696e2e696e7374616e63652e76312e476574496e7374" . + "616e6365526571756573741a2a2e676f6f676c652e7370616e6e65722e61" . + "646d696e2e696e7374616e63652e76312e496e7374616e6365223082d3e4" . + "93022312212f76312f7b6e616d653d70726f6a656374732f2a2f696e7374" . + "616e6365732f2a7dda41046e616d65129c020a0e437265617465496e7374" . + "616e636512372e676f6f676c652e7370616e6e65722e61646d696e2e696e" . + "7374616e63652e76312e437265617465496e7374616e6365526571756573" . + "741a1d2e676f6f676c652e6c6f6e6772756e6e696e672e4f706572617469" . + "6f6e22b10182d3e493022622212f76312f7b706172656e743d70726f6a65" . + "6374732f2a7d2f696e7374616e6365733a012ada411b706172656e742c69" . + "6e7374616e63655f69642c696e7374616e6365ca41640a29676f6f676c65" . + "2e7370616e6e65722e61646d696e2e696e7374616e63652e76312e496e73" . + "74616e63651237676f6f676c652e7370616e6e65722e61646d696e2e696e" . + "7374616e63652e76312e437265617465496e7374616e63654d6574616461" . + "7461129d020a0e557064617465496e7374616e636512372e676f6f676c65" . + "2e7370616e6e65722e61646d696e2e696e7374616e63652e76312e557064" . + "617465496e7374616e6365526571756573741a1d2e676f6f676c652e6c6f" . + "6e6772756e6e696e672e4f7065726174696f6e22b20182d3e493022f322a" . + "2f76312f7b696e7374616e63652e6e616d653d70726f6a656374732f2a2f" . + "696e7374616e6365732f2a7d3a012ada4113696e7374616e63652c666965" . + "6c645f6d61736bca41640a29676f6f676c652e7370616e6e65722e61646d" . + "696e2e696e7374616e63652e76312e496e7374616e63651237676f6f676c" . + "652e7370616e6e65722e61646d696e2e696e7374616e63652e76312e5570" . + "64617465496e7374616e63654d657461646174611293010a0e44656c6574" . + "65496e7374616e636512372e676f6f676c652e7370616e6e65722e61646d" . + "696e2e696e7374616e63652e76312e44656c657465496e7374616e636552" . + "6571756573741a162e676f6f676c652e70726f746f6275662e456d707479" . + "223082d3e49302232a212f76312f7b6e616d653d70726f6a656374732f2a" . + "2f696e7374616e6365732f2a7dda41046e616d65129a010a0c5365744961" . + "6d506f6c69637912222e676f6f676c652e69616d2e76312e53657449616d" . + "506f6c696379526571756573741a152e676f6f676c652e69616d2e76312e" . + "506f6c696379224f82d3e493023722322f76312f7b7265736f757263653d" . + "70726f6a656374732f2a2f696e7374616e6365732f2a7d3a73657449616d" . + "506f6c6963793a012ada410f7265736f757263652c706f6c696379129301" . + "0a0c47657449616d506f6c69637912222e676f6f676c652e69616d2e7631" . + "2e47657449616d506f6c696379526571756573741a152e676f6f676c652e" . + "69616d2e76312e506f6c696379224882d3e493023722322f76312f7b7265" . + "736f757263653d70726f6a656374732f2a2f696e7374616e6365732f2a7d" . + "3a67657449616d506f6c6963793a012ada41087265736f7572636512c501" . + "0a125465737449616d5065726d697373696f6e7312282e676f6f676c652e" . + "69616d2e76312e5465737449616d5065726d697373696f6e735265717565" . + "73741a292e676f6f676c652e69616d2e76312e5465737449616d5065726d" . + "697373696f6e73526573706f6e7365225a82d3e493023d22382f76312f7b" . + "7265736f757263653d70726f6a656374732f2a2f696e7374616e6365732f" . + "2a7d3a7465737449616d5065726d697373696f6e733a012ada4114726573" . + "6f757263652c7065726d697373696f6e731a78ca41167370616e6e65722e" . + "676f6f676c65617069732e636f6dd2415c68747470733a2f2f7777772e67" . + "6f6f676c65617069732e636f6d2f617574682f636c6f75642d706c617466" . + "6f726d2c68747470733a2f2f7777772e676f6f676c65617069732e636f6d" . + "2f617574682f7370616e6e65722e61646d696e42df010a24636f6d2e676f" . + "6f676c652e7370616e6e65722e61646d696e2e696e7374616e63652e7631" . + "42195370616e6e6572496e7374616e636541646d696e50726f746f50015a" . + "48676f6f676c652e676f6c616e672e6f72672f67656e70726f746f2f676f" . + "6f676c65617069732f7370616e6e65722f61646d696e2f696e7374616e63" . + "652f76313b696e7374616e6365aa0226476f6f676c652e436c6f75642e53" . + "70616e6e65722e41646d696e2e496e7374616e63652e5631ca0226476f6f" . + "676c655c436c6f75645c5370616e6e65725c41646d696e5c496e7374616e" . + "63655c5631620670726f746f33" ), true); static::$is_initialized = true; diff --git a/Spanner/src/Admin/Database/V1/CreateDatabaseRequest.php b/Spanner/src/Admin/Database/V1/CreateDatabaseRequest.php index 995ba150717c..dc4666ec1cbb 100644 --- a/Spanner/src/Admin/Database/V1/CreateDatabaseRequest.php +++ b/Spanner/src/Admin/Database/V1/CreateDatabaseRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. + * The request for + * [CreateDatabase][google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase]. * * Generated from protobuf message google.spanner.admin.database.v1.CreateDatabaseRequest */ diff --git a/Spanner/src/Admin/Database/V1/DatabaseAdminGrpcClient.php b/Spanner/src/Admin/Database/V1/DatabaseAdminGrpcClient.php index 4a6bfa3e8f00..0bc4b0d79cb1 100644 --- a/Spanner/src/Admin/Database/V1/DatabaseAdminGrpcClient.php +++ b/Spanner/src/Admin/Database/V1/DatabaseAdminGrpcClient.php @@ -57,8 +57,8 @@ public function ListDatabases(\Google\Cloud\Spanner\Admin\Database\V1\ListDataba * have a name of the format `/operations/` and * can be used to track preparation of the database. The * [metadata][google.longrunning.Operation.metadata] field type is - * [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The - * [response][google.longrunning.Operation.response] field type is + * [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. + * The [response][google.longrunning.Operation.response] field type is * [Database][google.spanner.admin.database.v1.Database], if successful. * @param \Google\Cloud\Spanner\Admin\Database\V1\CreateDatabaseRequest $argument input argument * @param array $metadata metadata @@ -93,7 +93,8 @@ public function GetDatabase(\Google\Cloud\Spanner\Admin\Database\V1\GetDatabaseR * the format `/operations/` and can be used to * track execution of the schema change(s). The * [metadata][google.longrunning.Operation.metadata] field type is - * [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response. + * [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. + * The operation has no response. * @param \Google\Cloud\Spanner\Admin\Database\V1\UpdateDatabaseDdlRequest $argument input argument * @param array $metadata metadata * @param array $options call options diff --git a/Spanner/src/Admin/Database/V1/DropDatabaseRequest.php b/Spanner/src/Admin/Database/V1/DropDatabaseRequest.php index 0235aad52fbc..c0e181566d5d 100644 --- a/Spanner/src/Admin/Database/V1/DropDatabaseRequest.php +++ b/Spanner/src/Admin/Database/V1/DropDatabaseRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase]. + * The request for + * [DropDatabase][google.spanner.admin.database.v1.DatabaseAdmin.DropDatabase]. * * Generated from protobuf message google.spanner.admin.database.v1.DropDatabaseRequest */ diff --git a/Spanner/src/Admin/Database/V1/Gapic/DatabaseAdminGapicClient.php b/Spanner/src/Admin/Database/V1/Gapic/DatabaseAdminGapicClient.php index e00c2fa942f8..57e2bd39aa76 100644 --- a/Spanner/src/Admin/Database/V1/Gapic/DatabaseAdminGapicClient.php +++ b/Spanner/src/Admin/Database/V1/Gapic/DatabaseAdminGapicClient.php @@ -71,21 +71,35 @@ * $databaseAdminClient = new DatabaseAdminClient(); * try { * $formattedParent = $databaseAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * // Iterate over pages of elements - * $pagedResponse = $databaseAdminClient->listDatabases($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } + * $createStatement = ''; + * $operationResponse = $databaseAdminClient->createDatabase($formattedParent, $createStatement); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) * } * * * // Alternatively: * - * // Iterate through all elements - * $pagedResponse = $databaseAdminClient->listDatabases($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); + * // start the operation, keep the operation name, and resume later + * $operationResponse = $databaseAdminClient->createDatabase($formattedParent, $createStatement); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $databaseAdminClient->resumeOperation($operationName, 'createDatabase'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) * } * } finally { * $databaseAdminClient->close(); @@ -362,95 +376,14 @@ public function __construct(array $options = []) $this->operationsClient = $this->createOperationsClient($clientOptions); } - /** - * Lists Cloud Spanner databases. - * - * Sample code: - * ``` - * $databaseAdminClient = new DatabaseAdminClient(); - * try { - * $formattedParent = $databaseAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * // Iterate over pages of elements - * $pagedResponse = $databaseAdminClient->listDatabases($formattedParent); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * - * - * // Alternatively: - * - * // Iterate through all elements - * $pagedResponse = $databaseAdminClient->listDatabases($formattedParent); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $databaseAdminClient->close(); - * } - * ``` - * - * @param string $parent Required. The instance whose databases should be listed. - * Values are of the form `projects//instances/`. - * @param array $optionalArgs { - * Optional. - * - * @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 Google\ApiCore\RetrySettings} object, or an associative array - * of retry settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - * @experimental - */ - public function listDatabases($parent, array $optionalArgs = []) - { - $request = new ListDatabasesRequest(); - $request->setParent($parent); - if (isset($optionalArgs['pageSize'])) { - $request->setPageSize($optionalArgs['pageSize']); - } - if (isset($optionalArgs['pageToken'])) { - $request->setPageToken($optionalArgs['pageToken']); - } - - $requestParams = new RequestParamsHeaderDescriptor([ - 'parent' => $request->getParent(), - ]); - $optionalArgs['headers'] = isset($optionalArgs['headers']) - ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) - : $requestParams->getHeader(); - - return $this->getPagedListResponse( - 'ListDatabases', - $optionalArgs, - ListDatabasesResponse::class, - $request - ); - } - /** * Creates a new Cloud Spanner database and starts to prepare it for serving. * The returned [long-running operation][google.longrunning.Operation] will * have a name of the format `/operations/` and * can be used to track preparation of the database. The * [metadata][google.longrunning.Operation.metadata] field type is - * [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The - * [response][google.longrunning.Operation.response] field type is + * [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. + * The [response][google.longrunning.Operation.response] field type is * [Database][google.spanner.admin.database.v1.Database], if successful. * * Sample code: @@ -602,7 +535,8 @@ public function getDatabase($name, array $optionalArgs = []) * the format `/operations/` and can be used to * track execution of the schema change(s). The * [metadata][google.longrunning.Operation.metadata] field type is - * [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response. + * [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. + * The operation has no response. * * Sample code: * ``` @@ -655,18 +589,20 @@ public function getDatabase($name, array $optionalArgs = []) * * Specifying an explicit operation ID simplifies determining * whether the statements were executed in the event that the - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, - * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and - * `operation_id` fields can be combined to form the + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * call is replayed, or the return value is otherwise lost: the + * [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] + * and `operation_id` fields can be combined to form the * [name][google.longrunning.Operation.name] of the resulting - * [longrunning.Operation][google.longrunning.Operation]: `/operations/`. + * [longrunning.Operation][google.longrunning.Operation]: + * `/operations/`. * * `operation_id` should be unique within the database, and must be * a valid identifier: `[a-z][a-z0-9_]*`. Note that * automatically-generated operation IDs always begin with an * underscore. If the named operation already exists, - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns - * `ALREADY_EXISTS`. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * returns `ALREADY_EXISTS`. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a * {@see Google\ApiCore\RetrySettings} object, or an associative array @@ -814,9 +750,9 @@ public function getDatabaseDdl($database, array $optionalArgs = []) * ``` * $databaseAdminClient = new DatabaseAdminClient(); * try { - * $formattedResource = $databaseAdminClient->databaseName('[PROJECT]', '[INSTANCE]', '[DATABASE]'); + * $resource = ''; * $policy = new Policy(); - * $response = $databaseAdminClient->setIamPolicy($formattedResource, $policy); + * $response = $databaseAdminClient->setIamPolicy($resource, $policy); * } finally { * $databaseAdminClient->close(); * } @@ -876,8 +812,8 @@ public function setIamPolicy($resource, $policy, array $optionalArgs = []) * ``` * $databaseAdminClient = new DatabaseAdminClient(); * try { - * $formattedResource = $databaseAdminClient->databaseName('[PROJECT]', '[INSTANCE]', '[DATABASE]'); - * $response = $databaseAdminClient->getIamPolicy($formattedResource); + * $resource = ''; + * $response = $databaseAdminClient->getIamPolicy($resource); * } finally { * $databaseAdminClient->close(); * } @@ -938,9 +874,9 @@ public function getIamPolicy($resource, array $optionalArgs = []) * ``` * $databaseAdminClient = new DatabaseAdminClient(); * try { - * $formattedResource = $databaseAdminClient->databaseName('[PROJECT]', '[INSTANCE]', '[DATABASE]'); + * $resource = ''; * $permissions = []; - * $response = $databaseAdminClient->testIamPermissions($formattedResource, $permissions); + * $response = $databaseAdminClient->testIamPermissions($resource, $permissions); * } finally { * $databaseAdminClient->close(); * } @@ -987,4 +923,85 @@ public function testIamPermissions($resource, $permissions, array $optionalArgs $request )->wait(); } + + /** + * Lists Cloud Spanner databases. + * + * Sample code: + * ``` + * $databaseAdminClient = new DatabaseAdminClient(); + * try { + * $formattedParent = $databaseAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); + * // Iterate over pages of elements + * $pagedResponse = $databaseAdminClient->listDatabases($formattedParent); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * + * + * // Alternatively: + * + * // Iterate through all elements + * $pagedResponse = $databaseAdminClient->listDatabases($formattedParent); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $databaseAdminClient->close(); + * } + * ``` + * + * @param string $parent Required. The instance whose databases should be listed. + * Values are of the form `projects//instances/`. + * @param array $optionalArgs { + * Optional. + * + * @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 Google\ApiCore\RetrySettings} object, or an associative array + * of retry settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + * @experimental + */ + public function listDatabases($parent, array $optionalArgs = []) + { + $request = new ListDatabasesRequest(); + $request->setParent($parent); + if (isset($optionalArgs['pageSize'])) { + $request->setPageSize($optionalArgs['pageSize']); + } + if (isset($optionalArgs['pageToken'])) { + $request->setPageToken($optionalArgs['pageToken']); + } + + $requestParams = new RequestParamsHeaderDescriptor([ + 'parent' => $request->getParent(), + ]); + $optionalArgs['headers'] = isset($optionalArgs['headers']) + ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) + : $requestParams->getHeader(); + + return $this->getPagedListResponse( + 'ListDatabases', + $optionalArgs, + ListDatabasesResponse::class, + $request + ); + } } diff --git a/Spanner/src/Admin/Database/V1/GetDatabaseDdlRequest.php b/Spanner/src/Admin/Database/V1/GetDatabaseDdlRequest.php index 9635da7fb9fd..751ac29d26d0 100644 --- a/Spanner/src/Admin/Database/V1/GetDatabaseDdlRequest.php +++ b/Spanner/src/Admin/Database/V1/GetDatabaseDdlRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. + * The request for + * [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. * * Generated from protobuf message google.spanner.admin.database.v1.GetDatabaseDdlRequest */ diff --git a/Spanner/src/Admin/Database/V1/GetDatabaseDdlResponse.php b/Spanner/src/Admin/Database/V1/GetDatabaseDdlResponse.php index d6a0a270130f..8b5793727d7c 100644 --- a/Spanner/src/Admin/Database/V1/GetDatabaseDdlResponse.php +++ b/Spanner/src/Admin/Database/V1/GetDatabaseDdlResponse.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The response for [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. + * The response for + * [GetDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabaseDdl]. * * Generated from protobuf message google.spanner.admin.database.v1.GetDatabaseDdlResponse */ diff --git a/Spanner/src/Admin/Database/V1/GetDatabaseRequest.php b/Spanner/src/Admin/Database/V1/GetDatabaseRequest.php index 43b2dba4a123..8fcc71c77743 100644 --- a/Spanner/src/Admin/Database/V1/GetDatabaseRequest.php +++ b/Spanner/src/Admin/Database/V1/GetDatabaseRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase]. + * The request for + * [GetDatabase][google.spanner.admin.database.v1.DatabaseAdmin.GetDatabase]. * * Generated from protobuf message google.spanner.admin.database.v1.GetDatabaseRequest */ diff --git a/Spanner/src/Admin/Database/V1/ListDatabasesRequest.php b/Spanner/src/Admin/Database/V1/ListDatabasesRequest.php index 135236c4cdee..e80dbcdefb4d 100644 --- a/Spanner/src/Admin/Database/V1/ListDatabasesRequest.php +++ b/Spanner/src/Admin/Database/V1/ListDatabasesRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. + * The request for + * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. * * Generated from protobuf message google.spanner.admin.database.v1.ListDatabasesRequest */ @@ -31,8 +32,9 @@ class ListDatabasesRequest extends \Google\Protobuf\Internal\Message private $page_size = 0; /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] from a - * previous [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. + * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] + * from a previous + * [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. * * Generated from protobuf field string page_token = 4; */ @@ -52,8 +54,9 @@ class ListDatabasesRequest extends \Google\Protobuf\Internal\Message * defaults to the server's maximum allowed page size. * @type string $page_token * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] from a - * previous [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. + * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] + * from a previous + * [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. * } */ public function __construct($data = NULL) { @@ -119,8 +122,9 @@ public function setPageSize($var) /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] from a - * previous [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. + * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] + * from a previous + * [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. * * Generated from protobuf field string page_token = 4; * @return string @@ -132,8 +136,9 @@ public function getPageToken() /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] from a - * previous [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. + * [next_page_token][google.spanner.admin.database.v1.ListDatabasesResponse.next_page_token] + * from a previous + * [ListDatabasesResponse][google.spanner.admin.database.v1.ListDatabasesResponse]. * * Generated from protobuf field string page_token = 4; * @param string $var diff --git a/Spanner/src/Admin/Database/V1/ListDatabasesResponse.php b/Spanner/src/Admin/Database/V1/ListDatabasesResponse.php index 4e0f53c860dc..1c6a6a4caf69 100644 --- a/Spanner/src/Admin/Database/V1/ListDatabasesResponse.php +++ b/Spanner/src/Admin/Database/V1/ListDatabasesResponse.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The response for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. + * The response for + * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases]. * * Generated from protobuf message google.spanner.admin.database.v1.ListDatabasesResponse */ @@ -23,8 +24,8 @@ class ListDatabasesResponse extends \Google\Protobuf\Internal\Message private $databases; /** * `next_page_token` can be sent in a subsequent - * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more - * of the matching databases. + * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] + * call to fetch more of the matching databases. * * Generated from protobuf field string next_page_token = 2; */ @@ -40,8 +41,8 @@ class ListDatabasesResponse extends \Google\Protobuf\Internal\Message * Databases that matched the request. * @type string $next_page_token * `next_page_token` can be sent in a subsequent - * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more - * of the matching databases. + * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] + * call to fetch more of the matching databases. * } */ public function __construct($data = NULL) { @@ -77,8 +78,8 @@ public function setDatabases($var) /** * `next_page_token` can be sent in a subsequent - * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more - * of the matching databases. + * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] + * call to fetch more of the matching databases. * * Generated from protobuf field string next_page_token = 2; * @return string @@ -90,8 +91,8 @@ public function getNextPageToken() /** * `next_page_token` can be sent in a subsequent - * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] call to fetch more - * of the matching databases. + * [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases] + * call to fetch more of the matching databases. * * Generated from protobuf field string next_page_token = 2; * @param string $var diff --git a/Spanner/src/Admin/Database/V1/UpdateDatabaseDdlRequest.php b/Spanner/src/Admin/Database/V1/UpdateDatabaseDdlRequest.php index 75dc0a1bec8d..519ecfdbc98c 100644 --- a/Spanner/src/Admin/Database/V1/UpdateDatabaseDdlRequest.php +++ b/Spanner/src/Admin/Database/V1/UpdateDatabaseDdlRequest.php @@ -22,8 +22,8 @@ * Each batch of statements is assigned a name which can be used with * the [Operations][google.longrunning.Operations] API to monitor * progress. See the - * [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] field for more - * details. + * [operation_id][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.operation_id] + * field for more details. * * Generated from protobuf message google.spanner.admin.database.v1.UpdateDatabaseDdlRequest */ @@ -48,17 +48,19 @@ class UpdateDatabaseDdlRequest extends \Google\Protobuf\Internal\Message * [Operation][google.longrunning.Operation]. * Specifying an explicit operation ID simplifies determining * whether the statements were executed in the event that the - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, - * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and - * `operation_id` fields can be combined to form the + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * call is replayed, or the return value is otherwise lost: the + * [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] + * and `operation_id` fields can be combined to form the * [name][google.longrunning.Operation.name] of the resulting - * [longrunning.Operation][google.longrunning.Operation]: `/operations/`. + * [longrunning.Operation][google.longrunning.Operation]: + * `/operations/`. * `operation_id` should be unique within the database, and must be * a valid identifier: `[a-z][a-z0-9_]*`. Note that * automatically-generated operation IDs always begin with an * underscore. If the named operation already exists, - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns - * `ALREADY_EXISTS`. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * returns `ALREADY_EXISTS`. * * Generated from protobuf field string operation_id = 3; */ @@ -81,17 +83,19 @@ class UpdateDatabaseDdlRequest extends \Google\Protobuf\Internal\Message * [Operation][google.longrunning.Operation]. * Specifying an explicit operation ID simplifies determining * whether the statements were executed in the event that the - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, - * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and - * `operation_id` fields can be combined to form the + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * call is replayed, or the return value is otherwise lost: the + * [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] + * and `operation_id` fields can be combined to form the * [name][google.longrunning.Operation.name] of the resulting - * [longrunning.Operation][google.longrunning.Operation]: `/operations/`. + * [longrunning.Operation][google.longrunning.Operation]: + * `/operations/`. * `operation_id` should be unique within the database, and must be * a valid identifier: `[a-z][a-z0-9_]*`. Note that * automatically-generated operation IDs always begin with an * underscore. If the named operation already exists, - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns - * `ALREADY_EXISTS`. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * returns `ALREADY_EXISTS`. * } */ public function __construct($data = NULL) { @@ -158,17 +162,19 @@ public function setStatements($var) * [Operation][google.longrunning.Operation]. * Specifying an explicit operation ID simplifies determining * whether the statements were executed in the event that the - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, - * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and - * `operation_id` fields can be combined to form the + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * call is replayed, or the return value is otherwise lost: the + * [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] + * and `operation_id` fields can be combined to form the * [name][google.longrunning.Operation.name] of the resulting - * [longrunning.Operation][google.longrunning.Operation]: `/operations/`. + * [longrunning.Operation][google.longrunning.Operation]: + * `/operations/`. * `operation_id` should be unique within the database, and must be * a valid identifier: `[a-z][a-z0-9_]*`. Note that * automatically-generated operation IDs always begin with an * underscore. If the named operation already exists, - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns - * `ALREADY_EXISTS`. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * returns `ALREADY_EXISTS`. * * Generated from protobuf field string operation_id = 3; * @return string @@ -185,17 +191,19 @@ public function getOperationId() * [Operation][google.longrunning.Operation]. * Specifying an explicit operation ID simplifies determining * whether the statements were executed in the event that the - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] call is replayed, - * or the return value is otherwise lost: the [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] and - * `operation_id` fields can be combined to form the + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * call is replayed, or the return value is otherwise lost: the + * [database][google.spanner.admin.database.v1.UpdateDatabaseDdlRequest.database] + * and `operation_id` fields can be combined to form the * [name][google.longrunning.Operation.name] of the resulting - * [longrunning.Operation][google.longrunning.Operation]: `/operations/`. + * [longrunning.Operation][google.longrunning.Operation]: + * `/operations/`. * `operation_id` should be unique within the database, and must be * a valid identifier: `[a-z][a-z0-9_]*`. Note that * automatically-generated operation IDs always begin with an * underscore. If the named operation already exists, - * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] returns - * `ALREADY_EXISTS`. + * [UpdateDatabaseDdl][google.spanner.admin.database.v1.DatabaseAdmin.UpdateDatabaseDdl] + * returns `ALREADY_EXISTS`. * * Generated from protobuf field string operation_id = 3; * @param string $var diff --git a/Spanner/src/Admin/Database/V1/resources/database_admin_client_config.json b/Spanner/src/Admin/Database/V1/resources/database_admin_client_config.json index 76adf1003d20..16f601b83da0 100644 --- a/Spanner/src/Admin/Database/V1/resources/database_admin_client_config.json +++ b/Spanner/src/Admin/Database/V1/resources/database_admin_client_config.json @@ -20,11 +20,6 @@ } }, "methods": { - "ListDatabases": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, "CreateDatabase": { "timeout_millis": 3600000, "retry_codes_name": "non_idempotent", @@ -64,6 +59,11 @@ "timeout_millis": 30000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "ListDatabases": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" } } } diff --git a/Spanner/src/Admin/Database/V1/resources/database_admin_rest_client_config.php b/Spanner/src/Admin/Database/V1/resources/database_admin_rest_client_config.php index ab5bfb0a3c21..111ba23e921d 100644 --- a/Spanner/src/Admin/Database/V1/resources/database_admin_rest_client_config.php +++ b/Spanner/src/Admin/Database/V1/resources/database_admin_rest_client_config.php @@ -73,17 +73,6 @@ ], ], 'google.spanner.admin.database.v1.DatabaseAdmin' => [ - 'ListDatabases' => [ - 'method' => 'get', - 'uriTemplate' => '/v1/{parent=projects/*/instances/*}/databases', - 'placeholders' => [ - 'parent' => [ - 'getters' => [ - 'getParent', - ], - ], - ], - ], 'CreateDatabase' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/instances/*}/databases', @@ -198,6 +187,17 @@ ], ], ], + 'ListDatabases' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/instances/*}/databases', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], ], ], ]; diff --git a/Spanner/src/Admin/Instance/V1/Gapic/InstanceAdminGapicClient.php b/Spanner/src/Admin/Instance/V1/Gapic/InstanceAdminGapicClient.php index ca1771c50a87..8d8d9ab6e8df 100644 --- a/Spanner/src/Admin/Instance/V1/Gapic/InstanceAdminGapicClient.php +++ b/Spanner/src/Admin/Instance/V1/Gapic/InstanceAdminGapicClient.php @@ -663,6 +663,10 @@ public function listInstances($parent, array $optionalArgs = []) * @param array $optionalArgs { * Optional. * + * @type FieldMask $fieldMask + * If field_mask is present, specifies the subset of [][google.spanner.admin.instance.v1.Instance] fields that + * should be returned. + * If absent, all [][google.spanner.admin.instance.v1.Instance] fields are returned. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a * {@see Google\ApiCore\RetrySettings} object, or an associative array @@ -679,6 +683,9 @@ public function getInstance($name, array $optionalArgs = []) { $request = new GetInstanceRequest(); $request->setName($name); + if (isset($optionalArgs['fieldMask'])) { + $request->setFieldMask($optionalArgs['fieldMask']); + } $requestParams = new RequestParamsHeaderDescriptor([ 'name' => $request->getName(), @@ -1010,9 +1017,9 @@ public function deleteInstance($name, array $optionalArgs = []) * ``` * $instanceAdminClient = new InstanceAdminClient(); * try { - * $formattedResource = $instanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); + * $resource = ''; * $policy = new Policy(); - * $response = $instanceAdminClient->setIamPolicy($formattedResource, $policy); + * $response = $instanceAdminClient->setIamPolicy($resource, $policy); * } finally { * $instanceAdminClient->close(); * } @@ -1071,8 +1078,8 @@ public function setIamPolicy($resource, $policy, array $optionalArgs = []) * ``` * $instanceAdminClient = new InstanceAdminClient(); * try { - * $formattedResource = $instanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); - * $response = $instanceAdminClient->getIamPolicy($formattedResource); + * $resource = ''; + * $response = $instanceAdminClient->getIamPolicy($resource); * } finally { * $instanceAdminClient->close(); * } @@ -1133,9 +1140,9 @@ public function getIamPolicy($resource, array $optionalArgs = []) * ``` * $instanceAdminClient = new InstanceAdminClient(); * try { - * $formattedResource = $instanceAdminClient->instanceName('[PROJECT]', '[INSTANCE]'); + * $resource = ''; * $permissions = []; - * $response = $instanceAdminClient->testIamPermissions($formattedResource, $permissions); + * $response = $instanceAdminClient->testIamPermissions($resource, $permissions); * } finally { * $instanceAdminClient->close(); * } diff --git a/Spanner/src/Admin/Instance/V1/GetInstanceRequest.php b/Spanner/src/Admin/Instance/V1/GetInstanceRequest.php index 0c60f2d3c272..367373de6b02 100644 --- a/Spanner/src/Admin/Instance/V1/GetInstanceRequest.php +++ b/Spanner/src/Admin/Instance/V1/GetInstanceRequest.php @@ -22,6 +22,14 @@ class GetInstanceRequest extends \Google\Protobuf\Internal\Message * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { */ private $name = ''; + /** + * If field_mask is present, specifies the subset of [][Instance] fields that + * should be returned. + * If absent, all [][Instance] fields are returned. + * + * Generated from protobuf field .google.protobuf.FieldMask field_mask = 2; + */ + private $field_mask = null; /** * Constructor. @@ -32,6 +40,10 @@ class GetInstanceRequest extends \Google\Protobuf\Internal\Message * @type string $name * Required. The name of the requested instance. Values are of the form * `projects//instances/`. + * @type \Google\Protobuf\FieldMask $field_mask + * If field_mask is present, specifies the subset of [][Instance] fields that + * should be returned. + * If absent, all [][Instance] fields are returned. * } */ public function __construct($data = NULL) { @@ -67,5 +79,35 @@ public function setName($var) return $this; } + /** + * If field_mask is present, specifies the subset of [][Instance] fields that + * should be returned. + * If absent, all [][Instance] fields are returned. + * + * Generated from protobuf field .google.protobuf.FieldMask field_mask = 2; + * @return \Google\Protobuf\FieldMask + */ + public function getFieldMask() + { + return $this->field_mask; + } + + /** + * If field_mask is present, specifies the subset of [][Instance] fields that + * should be returned. + * If absent, all [][Instance] fields are returned. + * + * Generated from protobuf field .google.protobuf.FieldMask field_mask = 2; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setFieldMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->field_mask = $var; + + return $this; + } + } diff --git a/Spanner/src/Admin/Instance/V1/Instance.php b/Spanner/src/Admin/Instance/V1/Instance.php index 3b4ced8a2f7f..c2297e39314f 100644 --- a/Spanner/src/Admin/Instance/V1/Instance.php +++ b/Spanner/src/Admin/Instance/V1/Instance.php @@ -83,6 +83,19 @@ class Instance extends \Google\Protobuf\Internal\Message * Generated from protobuf field map labels = 7; */ private $labels; + /** + * Output only. The endpoint URLs based on the instance config. + * For example, instances located in a specific cloud region (or multi region) + * such as nam3, would have a nam3 specific endpoint URL. + * This URL is to be used implictly by SDK clients, with fallback to default + * URL. These endpoints are intended to optimize the network routing between + * the client and the instance's serving resources. + * If multiple endpoints are present, + * client may establish connections using any of the given URLs. + * + * Generated from protobuf field repeated string endpoint_urls = 8; + */ + private $endpoint_urls; /** * Constructor. @@ -134,6 +147,15 @@ class Instance extends \Google\Protobuf\Internal\Message * specific characters being disallowed. For example, representing labels * as the string: name + "_" + value would prove problematic if we were to * allow "_" in a future release. + * @type string[]|\Google\Protobuf\Internal\RepeatedField $endpoint_urls + * Output only. The endpoint URLs based on the instance config. + * For example, instances located in a specific cloud region (or multi region) + * such as nam3, would have a nam3 specific endpoint URL. + * This URL is to be used implictly by SDK clients, with fallback to default + * URL. These endpoints are intended to optimize the network routing between + * the client and the instance's serving resources. + * If multiple endpoints are present, + * client may establish connections using any of the given URLs. * } */ public function __construct($data = NULL) { @@ -361,5 +383,45 @@ public function setLabels($var) return $this; } + /** + * Output only. The endpoint URLs based on the instance config. + * For example, instances located in a specific cloud region (or multi region) + * such as nam3, would have a nam3 specific endpoint URL. + * This URL is to be used implictly by SDK clients, with fallback to default + * URL. These endpoints are intended to optimize the network routing between + * the client and the instance's serving resources. + * If multiple endpoints are present, + * client may establish connections using any of the given URLs. + * + * Generated from protobuf field repeated string endpoint_urls = 8; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEndpointUrls() + { + return $this->endpoint_urls; + } + + /** + * Output only. The endpoint URLs based on the instance config. + * For example, instances located in a specific cloud region (or multi region) + * such as nam3, would have a nam3 specific endpoint URL. + * This URL is to be used implictly by SDK clients, with fallback to default + * URL. These endpoints are intended to optimize the network routing between + * the client and the instance's serving resources. + * If multiple endpoints are present, + * client may establish connections using any of the given URLs. + * + * Generated from protobuf field repeated string endpoint_urls = 8; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEndpointUrls($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->endpoint_urls = $arr; + + return $this; + } + } diff --git a/Spanner/src/V1/BatchCreateSessionsRequest.php b/Spanner/src/V1/BatchCreateSessionsRequest.php index 6c4ed6743bb0..d5b469b16875 100644 --- a/Spanner/src/V1/BatchCreateSessionsRequest.php +++ b/Spanner/src/V1/BatchCreateSessionsRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. + * The request for + * [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. * * Generated from protobuf message google.spanner.v1.BatchCreateSessionsRequest */ @@ -32,7 +33,8 @@ class BatchCreateSessionsRequest extends \Google\Protobuf\Internal\Message * The API may return fewer than the requested number of sessions. If a * specific number of sessions are desired, the client can make additional * calls to BatchCreateSessions (adjusting - * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary). + * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] + * as necessary). * * Generated from protobuf field int32 session_count = 3 [(.google.api.field_behavior) = REQUIRED]; */ @@ -53,7 +55,8 @@ class BatchCreateSessionsRequest extends \Google\Protobuf\Internal\Message * The API may return fewer than the requested number of sessions. If a * specific number of sessions are desired, the client can make additional * calls to BatchCreateSessions (adjusting - * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary). + * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] + * as necessary). * } */ public function __construct($data = NULL) { @@ -118,7 +121,8 @@ public function setSessionTemplate($var) * The API may return fewer than the requested number of sessions. If a * specific number of sessions are desired, the client can make additional * calls to BatchCreateSessions (adjusting - * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary). + * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] + * as necessary). * * Generated from protobuf field int32 session_count = 3 [(.google.api.field_behavior) = REQUIRED]; * @return int @@ -133,7 +137,8 @@ public function getSessionCount() * The API may return fewer than the requested number of sessions. If a * specific number of sessions are desired, the client can make additional * calls to BatchCreateSessions (adjusting - * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary). + * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] + * as necessary). * * Generated from protobuf field int32 session_count = 3 [(.google.api.field_behavior) = REQUIRED]; * @param int $var diff --git a/Spanner/src/V1/BatchCreateSessionsResponse.php b/Spanner/src/V1/BatchCreateSessionsResponse.php index 43fdf4379298..c18aca4f9dd1 100644 --- a/Spanner/src/V1/BatchCreateSessionsResponse.php +++ b/Spanner/src/V1/BatchCreateSessionsResponse.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The response for [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. + * The response for + * [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. * * Generated from protobuf message google.spanner.v1.BatchCreateSessionsResponse */ diff --git a/Spanner/src/V1/BeginTransactionRequest.php b/Spanner/src/V1/BeginTransactionRequest.php index 1fd4e494d896..ae436834ec47 100644 --- a/Spanner/src/V1/BeginTransactionRequest.php +++ b/Spanner/src/V1/BeginTransactionRequest.php @@ -9,7 +9,8 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The request for [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. + * The request for + * [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. * * Generated from protobuf message google.spanner.v1.BeginTransactionRequest */ diff --git a/Spanner/src/V1/ExecuteBatchDmlRequest.php b/Spanner/src/V1/ExecuteBatchDmlRequest.php index d22b88b0587a..927f0a1cbe0a 100644 --- a/Spanner/src/V1/ExecuteBatchDmlRequest.php +++ b/Spanner/src/V1/ExecuteBatchDmlRequest.php @@ -31,19 +31,19 @@ class ExecuteBatchDmlRequest extends \Google\Protobuf\Internal\Message */ private $transaction = null; /** - * Required. The list of statements to execute in this batch. Statements are executed - * serially, such that the effects of statement `i` are visible to statement - * `i+1`. Each statement must be a DML statement. Execution stops at the - * first failed statement; the remaining statements are not executed. + * Required. The list of statements to execute in this batch. Statements are + * executed serially, such that the effects of statement `i` are visible to + * statement `i+1`. Each statement must be a DML statement. Execution stops at + * the first failed statement; the remaining statements are not executed. * Callers must provide at least one statement. * * Generated from protobuf field repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3 [(.google.api.field_behavior) = REQUIRED]; */ private $statements; /** - * Required. A per-transaction sequence number used to identify this request. This field - * makes each request idempotent such that if the request is received multiple - * times, at most one will succeed. + * Required. A per-transaction sequence number used to identify this request. + * This field makes each request idempotent such that if the request is + * received multiple times, at most one will succeed. * The sequence number must be monotonically increasing within the * transaction. If a request arrives for the first time with an out-of-order * sequence number, the transaction may be aborted. Replays of previously @@ -67,15 +67,15 @@ class ExecuteBatchDmlRequest extends \Google\Protobuf\Internal\Message * caller must either supply an existing transaction ID or begin a new * transaction. * @type \Google\Cloud\Spanner\V1\ExecuteBatchDmlRequest\Statement[]|\Google\Protobuf\Internal\RepeatedField $statements - * Required. The list of statements to execute in this batch. Statements are executed - * serially, such that the effects of statement `i` are visible to statement - * `i+1`. Each statement must be a DML statement. Execution stops at the - * first failed statement; the remaining statements are not executed. + * Required. The list of statements to execute in this batch. Statements are + * executed serially, such that the effects of statement `i` are visible to + * statement `i+1`. Each statement must be a DML statement. Execution stops at + * the first failed statement; the remaining statements are not executed. * Callers must provide at least one statement. * @type int|string $seqno - * Required. A per-transaction sequence number used to identify this request. This field - * makes each request idempotent such that if the request is received multiple - * times, at most one will succeed. + * Required. A per-transaction sequence number used to identify this request. + * This field makes each request idempotent such that if the request is + * received multiple times, at most one will succeed. * The sequence number must be monotonically increasing within the * transaction. If a request arrives for the first time with an out-of-order * sequence number, the transaction may be aborted. Replays of previously @@ -146,10 +146,10 @@ public function setTransaction($var) } /** - * Required. The list of statements to execute in this batch. Statements are executed - * serially, such that the effects of statement `i` are visible to statement - * `i+1`. Each statement must be a DML statement. Execution stops at the - * first failed statement; the remaining statements are not executed. + * Required. The list of statements to execute in this batch. Statements are + * executed serially, such that the effects of statement `i` are visible to + * statement `i+1`. Each statement must be a DML statement. Execution stops at + * the first failed statement; the remaining statements are not executed. * Callers must provide at least one statement. * * Generated from protobuf field repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -161,10 +161,10 @@ public function getStatements() } /** - * Required. The list of statements to execute in this batch. Statements are executed - * serially, such that the effects of statement `i` are visible to statement - * `i+1`. Each statement must be a DML statement. Execution stops at the - * first failed statement; the remaining statements are not executed. + * Required. The list of statements to execute in this batch. Statements are + * executed serially, such that the effects of statement `i` are visible to + * statement `i+1`. Each statement must be a DML statement. Execution stops at + * the first failed statement; the remaining statements are not executed. * Callers must provide at least one statement. * * Generated from protobuf field repeated .google.spanner.v1.ExecuteBatchDmlRequest.Statement statements = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -180,9 +180,9 @@ public function setStatements($var) } /** - * Required. A per-transaction sequence number used to identify this request. This field - * makes each request idempotent such that if the request is received multiple - * times, at most one will succeed. + * Required. A per-transaction sequence number used to identify this request. + * This field makes each request idempotent such that if the request is + * received multiple times, at most one will succeed. * The sequence number must be monotonically increasing within the * transaction. If a request arrives for the first time with an out-of-order * sequence number, the transaction may be aborted. Replays of previously @@ -197,9 +197,9 @@ public function getSeqno() } /** - * Required. A per-transaction sequence number used to identify this request. This field - * makes each request idempotent such that if the request is received multiple - * times, at most one will succeed. + * Required. A per-transaction sequence number used to identify this request. + * This field makes each request idempotent such that if the request is + * received multiple times, at most one will succeed. * The sequence number must be monotonically increasing within the * transaction. If a request arrives for the first time with an out-of-order * sequence number, the transaction may be aborted. Replays of previously diff --git a/Spanner/src/V1/ExecuteBatchDmlRequest/Statement.php b/Spanner/src/V1/ExecuteBatchDmlRequest/Statement.php index 3cf764dee646..cfbcda28eeac 100644 --- a/Spanner/src/V1/ExecuteBatchDmlRequest/Statement.php +++ b/Spanner/src/V1/ExecuteBatchDmlRequest/Statement.php @@ -37,7 +37,9 @@ class Statement extends \Google\Protobuf\Internal\Message /** * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as + * JSON strings. * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information @@ -67,7 +69,9 @@ class Statement extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\MapField $param_types * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as + * JSON strings. * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information @@ -148,7 +152,9 @@ public function setParams($var) /** * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as + * JSON strings. * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information @@ -165,7 +171,9 @@ public function getParamTypes() /** * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] as + * JSON strings. * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information diff --git a/Spanner/src/V1/ExecuteBatchDmlResponse.php b/Spanner/src/V1/ExecuteBatchDmlResponse.php index 927f0c868153..69dc354386c3 100644 --- a/Spanner/src/V1/ExecuteBatchDmlResponse.php +++ b/Spanner/src/V1/ExecuteBatchDmlResponse.php @@ -9,36 +9,45 @@ use Google\Protobuf\Internal\GPBUtil; /** - * The response for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list - * of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML statement that has successfully - * executed, in the same order as the statements in the request. If a statement - * fails, the status in the response body identifies the cause of the failure. + * The response for + * [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml]. Contains a list + * of [ResultSet][google.spanner.v1.ResultSet] messages, one for each DML + * statement that has successfully executed, in the same order as the statements + * in the request. If a statement fails, the status in the response body + * identifies the cause of the failure. * To check for DML statements that failed, use the following approach: - * 1. Check the status in the response message. The [google.rpc.Code][google.rpc.Code] enum + * 1. Check the status in the response message. The + * [google.rpc.Code][google.rpc.Code] enum * value `OK` indicates that all statements were executed successfully. * 2. If the status was not `OK`, check the number of result sets in the - * response. If the response contains `N` [ResultSet][google.spanner.v1.ResultSet] messages, then - * statement `N+1` in the request failed. + * response. If the response contains `N` + * [ResultSet][google.spanner.v1.ResultSet] messages, then statement `N+1` in + * the request failed. * Example 1: * * Request: 5 DML statements, all executed successfully. - * * Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the status `OK`. + * * Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, with the + * status `OK`. * Example 2: * * Request: 5 DML statements. The third statement has a syntax error. - * * Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax error (`INVALID_ARGUMENT`) - * status. The number of [ResultSet][google.spanner.v1.ResultSet] messages indicates that the third - * statement failed, and the fourth and fifth statements were not executed. + * * Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and a syntax + * error (`INVALID_ARGUMENT`) + * status. The number of [ResultSet][google.spanner.v1.ResultSet] messages + * indicates that the third statement failed, and the fourth and fifth + * statements were not executed. * * Generated from protobuf message google.spanner.v1.ExecuteBatchDmlResponse */ class ExecuteBatchDmlResponse extends \Google\Protobuf\Internal\Message { /** - * One [ResultSet][google.spanner.v1.ResultSet] for each statement in the request that ran successfully, - * in the same order as the statements in the request. Each [ResultSet][google.spanner.v1.ResultSet] does - * not contain any rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each [ResultSet][google.spanner.v1.ResultSet] contain - * the number of rows modified by the statement. - * Only the first [ResultSet][google.spanner.v1.ResultSet] in the response contains valid - * [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. + * One [ResultSet][google.spanner.v1.ResultSet] for each statement in the + * request that ran successfully, in the same order as the statements in the + * request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any + * rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each + * [ResultSet][google.spanner.v1.ResultSet] contain the number of rows + * modified by the statement. + * Only the first [ResultSet][google.spanner.v1.ResultSet] in the response + * contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. * * Generated from protobuf field repeated .google.spanner.v1.ResultSet result_sets = 1; */ @@ -58,12 +67,14 @@ class ExecuteBatchDmlResponse extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type \Google\Cloud\Spanner\V1\ResultSet[]|\Google\Protobuf\Internal\RepeatedField $result_sets - * One [ResultSet][google.spanner.v1.ResultSet] for each statement in the request that ran successfully, - * in the same order as the statements in the request. Each [ResultSet][google.spanner.v1.ResultSet] does - * not contain any rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each [ResultSet][google.spanner.v1.ResultSet] contain - * the number of rows modified by the statement. - * Only the first [ResultSet][google.spanner.v1.ResultSet] in the response contains valid - * [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. + * One [ResultSet][google.spanner.v1.ResultSet] for each statement in the + * request that ran successfully, in the same order as the statements in the + * request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any + * rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each + * [ResultSet][google.spanner.v1.ResultSet] contain the number of rows + * modified by the statement. + * Only the first [ResultSet][google.spanner.v1.ResultSet] in the response + * contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. * @type \Google\Rpc\Status $status * If all DML statements are executed successfully, the status is `OK`. * Otherwise, the error status of the first failed statement. @@ -75,12 +86,14 @@ public function __construct($data = NULL) { } /** - * One [ResultSet][google.spanner.v1.ResultSet] for each statement in the request that ran successfully, - * in the same order as the statements in the request. Each [ResultSet][google.spanner.v1.ResultSet] does - * not contain any rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each [ResultSet][google.spanner.v1.ResultSet] contain - * the number of rows modified by the statement. - * Only the first [ResultSet][google.spanner.v1.ResultSet] in the response contains valid - * [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. + * One [ResultSet][google.spanner.v1.ResultSet] for each statement in the + * request that ran successfully, in the same order as the statements in the + * request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any + * rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each + * [ResultSet][google.spanner.v1.ResultSet] contain the number of rows + * modified by the statement. + * Only the first [ResultSet][google.spanner.v1.ResultSet] in the response + * contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. * * Generated from protobuf field repeated .google.spanner.v1.ResultSet result_sets = 1; * @return \Google\Protobuf\Internal\RepeatedField @@ -91,12 +104,14 @@ public function getResultSets() } /** - * One [ResultSet][google.spanner.v1.ResultSet] for each statement in the request that ran successfully, - * in the same order as the statements in the request. Each [ResultSet][google.spanner.v1.ResultSet] does - * not contain any rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each [ResultSet][google.spanner.v1.ResultSet] contain - * the number of rows modified by the statement. - * Only the first [ResultSet][google.spanner.v1.ResultSet] in the response contains valid - * [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. + * One [ResultSet][google.spanner.v1.ResultSet] for each statement in the + * request that ran successfully, in the same order as the statements in the + * request. Each [ResultSet][google.spanner.v1.ResultSet] does not contain any + * rows. The [ResultSetStats][google.spanner.v1.ResultSetStats] in each + * [ResultSet][google.spanner.v1.ResultSet] contain the number of rows + * modified by the statement. + * Only the first [ResultSet][google.spanner.v1.ResultSet] in the response + * contains valid [ResultSetMetadata][google.spanner.v1.ResultSetMetadata]. * * Generated from protobuf field repeated .google.spanner.v1.ResultSet result_sets = 1; * @param \Google\Cloud\Spanner\V1\ResultSet[]|\Google\Protobuf\Internal\RepeatedField $var diff --git a/Spanner/src/V1/ExecuteSqlRequest.php b/Spanner/src/V1/ExecuteSqlRequest.php index 4e4f882c6ec4..1d11d82daac9 100644 --- a/Spanner/src/V1/ExecuteSqlRequest.php +++ b/Spanner/src/V1/ExecuteSqlRequest.php @@ -56,7 +56,8 @@ class ExecuteSqlRequest extends \Google\Protobuf\Internal\Message /** * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information @@ -68,18 +69,21 @@ class ExecuteSqlRequest extends \Google\Protobuf\Internal\Message /** * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last - * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new SQL statement execution to resume where the last one left - * off. The rest of the request parameters must exactly match the - * request that yielded this token. + * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + * interruption. Doing this enables the new SQL statement execution to resume + * where the last one left off. The rest of the request parameters must + * exactly match the request that yielded this token. * * Generated from protobuf field bytes resume_token = 6; */ private $resume_token = ''; /** * Used to control the amount of debugging information returned in - * [ResultSetStats][google.spanner.v1.ResultSetStats]. If [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only - * be set to [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. + * [ResultSetStats][google.spanner.v1.ResultSetStats]. If + * [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is + * set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only + * be set to + * [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. * * Generated from protobuf field .google.spanner.v1.ExecuteSqlRequest.QueryMode query_mode = 7; */ @@ -137,7 +141,8 @@ class ExecuteSqlRequest extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\MapField $param_types * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information @@ -145,14 +150,17 @@ class ExecuteSqlRequest extends \Google\Protobuf\Internal\Message * @type string $resume_token * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last - * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new SQL statement execution to resume where the last one left - * off. The rest of the request parameters must exactly match the - * request that yielded this token. + * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + * interruption. Doing this enables the new SQL statement execution to resume + * where the last one left off. The rest of the request parameters must + * exactly match the request that yielded this token. * @type int $query_mode * Used to control the amount of debugging information returned in - * [ResultSetStats][google.spanner.v1.ResultSetStats]. If [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only - * be set to [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. + * [ResultSetStats][google.spanner.v1.ResultSetStats]. If + * [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is + * set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only + * be set to + * [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. * @type string $partition_token * If present, results will be restricted to the specified partition * previously created using PartitionQuery(). There must be an exact @@ -307,7 +315,8 @@ public function setParams($var) /** * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information @@ -324,7 +333,8 @@ public function getParamTypes() /** * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information @@ -345,10 +355,10 @@ public function setParamTypes($var) /** * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last - * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new SQL statement execution to resume where the last one left - * off. The rest of the request parameters must exactly match the - * request that yielded this token. + * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + * interruption. Doing this enables the new SQL statement execution to resume + * where the last one left off. The rest of the request parameters must + * exactly match the request that yielded this token. * * Generated from protobuf field bytes resume_token = 6; * @return string @@ -361,10 +371,10 @@ public function getResumeToken() /** * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last - * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new SQL statement execution to resume where the last one left - * off. The rest of the request parameters must exactly match the - * request that yielded this token. + * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + * interruption. Doing this enables the new SQL statement execution to resume + * where the last one left off. The rest of the request parameters must + * exactly match the request that yielded this token. * * Generated from protobuf field bytes resume_token = 6; * @param string $var @@ -380,8 +390,11 @@ public function setResumeToken($var) /** * Used to control the amount of debugging information returned in - * [ResultSetStats][google.spanner.v1.ResultSetStats]. If [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only - * be set to [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. + * [ResultSetStats][google.spanner.v1.ResultSetStats]. If + * [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is + * set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only + * be set to + * [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. * * Generated from protobuf field .google.spanner.v1.ExecuteSqlRequest.QueryMode query_mode = 7; * @return int @@ -393,8 +406,11 @@ public function getQueryMode() /** * Used to control the amount of debugging information returned in - * [ResultSetStats][google.spanner.v1.ResultSetStats]. If [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only - * be set to [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. + * [ResultSetStats][google.spanner.v1.ResultSetStats]. If + * [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is + * set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only + * be set to + * [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. * * Generated from protobuf field .google.spanner.v1.ExecuteSqlRequest.QueryMode query_mode = 7; * @param int $var diff --git a/Spanner/src/V1/Gapic/SpannerGapicClient.php b/Spanner/src/V1/Gapic/SpannerGapicClient.php index 4be532cb2d5a..8f909f09fe7a 100644 --- a/Spanner/src/V1/Gapic/SpannerGapicClient.php +++ b/Spanner/src/V1/Gapic/SpannerGapicClient.php @@ -419,7 +419,8 @@ public function createSession($database, array $optionalArgs = []) * The API may return fewer than the requested number of sessions. If a * specific number of sessions are desired, the client can make additional * calls to BatchCreateSessions (adjusting - * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary). + * [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] + * as necessary). * @param array $optionalArgs { * Optional. * @@ -665,10 +666,12 @@ public function deleteSession($name, array $optionalArgs = []) * * Operations inside read-write transactions might return `ABORTED`. If * this occurs, the application should restart the transaction from - * the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. + * the beginning. See [Transaction][google.spanner.v1.Transaction] for more + * details. * * Larger result sets can be fetched in streaming fashion by calling - * [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead. + * [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] + * instead. * * Sample code: * ``` @@ -714,7 +717,8 @@ public function deleteSession($name, array $optionalArgs = []) * @type array $paramTypes * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL statement parameters. See the @@ -723,14 +727,17 @@ public function deleteSession($name, array $optionalArgs = []) * @type string $resumeToken * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last - * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new SQL statement execution to resume where the last one left - * off. The rest of the request parameters must exactly match the - * request that yielded this token. + * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + * interruption. Doing this enables the new SQL statement execution to resume + * where the last one left off. The rest of the request parameters must + * exactly match the request that yielded this token. * @type int $queryMode * Used to control the amount of debugging information returned in - * [ResultSetStats][google.spanner.v1.ResultSetStats]. If [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only - * be set to [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. + * [ResultSetStats][google.spanner.v1.ResultSetStats]. If + * [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is + * set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only + * be set to + * [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. * For allowed values, use constants defined on {@see \Google\Cloud\Spanner\V1\ExecuteSqlRequest\QueryMode} * @type string $partitionToken * If present, results will be restricted to the specified partition @@ -803,11 +810,11 @@ public function executeSql($session, $sql, array $optionalArgs = []) } /** - * Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the result - * set as a stream. Unlike [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there - * is no limit on the size of the returned result set. However, no - * individual row in the result set can exceed 100 MiB, and no - * column value can exceed 10 MiB. + * Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the + * result set as a stream. Unlike + * [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there is no limit on + * the size of the returned result set. However, no individual row in the + * result set can exceed 100 MiB, and no column value can exceed 10 MiB. * * Sample code: * ``` @@ -857,7 +864,8 @@ public function executeSql($session, $sql, array $optionalArgs = []) * @type array $paramTypes * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL statement parameters. See the @@ -866,14 +874,17 @@ public function executeSql($session, $sql, array $optionalArgs = []) * @type string $resumeToken * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last - * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new SQL statement execution to resume where the last one left - * off. The rest of the request parameters must exactly match the - * request that yielded this token. + * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + * interruption. Doing this enables the new SQL statement execution to resume + * where the last one left off. The rest of the request parameters must + * exactly match the request that yielded this token. * @type int $queryMode * Used to control the amount of debugging information returned in - * [ResultSetStats][google.spanner.v1.ResultSetStats]. If [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only - * be set to [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. + * [ResultSetStats][google.spanner.v1.ResultSetStats]. If + * [partition_token][google.spanner.v1.ExecuteSqlRequest.partition_token] is + * set, [query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] can only + * be set to + * [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. * For allowed values, use constants defined on {@see \Google\Cloud\Spanner\V1\ExecuteSqlRequest\QueryMode} * @type string $partitionToken * If present, results will be restricted to the specified partition @@ -949,9 +960,10 @@ public function executeStreamingSql($session, $sql, array $optionalArgs = []) * [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. * * Statements are executed in sequential order. A request can succeed even if - * a statement fails. The [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] field in the - * response provides information about the statement that failed. Clients must - * inspect this field to determine whether an error occurred. + * a statement fails. The + * [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] + * field in the response provides information about the statement that failed. + * Clients must inspect this field to determine whether an error occurred. * * Execution stops after the first failed statement; the remaining statements * are not executed. @@ -976,15 +988,15 @@ public function executeStreamingSql($session, $sql, array $optionalArgs = []) * To protect against replays, single-use transactions are not supported. The * caller must either supply an existing transaction ID or begin a new * transaction. - * @param Statement[] $statements Required. The list of statements to execute in this batch. Statements are executed - * serially, such that the effects of statement `i` are visible to statement - * `i+1`. Each statement must be a DML statement. Execution stops at the - * first failed statement; the remaining statements are not executed. + * @param Statement[] $statements Required. The list of statements to execute in this batch. Statements are + * executed serially, such that the effects of statement `i` are visible to + * statement `i+1`. Each statement must be a DML statement. Execution stops at + * the first failed statement; the remaining statements are not executed. * * Callers must provide at least one statement. - * @param int $seqno Required. A per-transaction sequence number used to identify this request. This field - * makes each request idempotent such that if the request is received multiple - * times, at most one will succeed. + * @param int $seqno Required. A per-transaction sequence number used to identify this request. + * This field makes each request idempotent such that if the request is + * received multiple times, at most one will succeed. * * The sequence number must be monotonically increasing within the * transaction. If a request arrives for the first time with an out-of-order @@ -1031,14 +1043,15 @@ public function executeBatchDml($session, $transaction, $statements, $seqno, arr /** * Reads rows from the database using key lookups and scans, as a * simple key/value style alternative to - * [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be used to - * return a result set larger than 10 MiB; if the read matches more + * [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be + * used to return a result set larger than 10 MiB; if the read matches more * data than that, the read fails with a `FAILED_PRECONDITION` * error. * * Reads inside read-write transactions might return `ABORTED`. If * this occurs, the application should restart the transaction from - * the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. + * the beginning. See [Transaction][google.spanner.v1.Transaction] for more + * details. * * Larger result sets can be yielded in streaming fashion by calling * [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead. @@ -1059,17 +1072,21 @@ public function executeBatchDml($session, $transaction, $statements, $seqno, arr * * @param string $session Required. The session in which the read should be performed. * @param string $table Required. The name of the table in the database to be read. - * @param string[] $columns Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be returned for each row matching - * this request. + * @param string[] $columns Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be + * returned for each row matching this request. * @param KeySet $keySet Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to be yielded, unless [index][google.spanner.v1.ReadRequest.index] - * is present. If [index][google.spanner.v1.ReadRequest.index] is present, then [key_set][google.spanner.v1.ReadRequest.key_set] instead names - * index keys in [index][google.spanner.v1.ReadRequest.index]. - * - * If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is empty, rows are yielded - * in table primary key order (if [index][google.spanner.v1.ReadRequest.index] is empty) or index key order - * (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is not - * empty, rows will be yielded in an unspecified order. + * primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to + * be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present. + * If [index][google.spanner.v1.ReadRequest.index] is present, then + * [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys + * in [index][google.spanner.v1.ReadRequest.index]. + * + * If the [partition_token][google.spanner.v1.ReadRequest.partition_token] + * field is empty, rows are yielded in table primary key order (if + * [index][google.spanner.v1.ReadRequest.index] is empty) or index key order + * (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the + * [partition_token][google.spanner.v1.ReadRequest.partition_token] field is + * not empty, rows will be yielded in an unspecified order. * * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. @@ -1080,9 +1097,12 @@ public function executeBatchDml($session, $transaction, $statements, $seqno, arr * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. * @type string $index - * If non-empty, the name of an index on [table][google.spanner.v1.ReadRequest.table]. This index is - * used instead of the table primary key when interpreting [key_set][google.spanner.v1.ReadRequest.key_set] - * and sorting result rows. See [key_set][google.spanner.v1.ReadRequest.key_set] for further information. + * If non-empty, the name of an index on + * [table][google.spanner.v1.ReadRequest.table]. This index is used instead of + * the table primary key when interpreting + * [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows. + * See [key_set][google.spanner.v1.ReadRequest.key_set] for further + * information. * @type int $limit * If greater than zero, only the first `limit` rows are yielded. If `limit` * is zero, the default is no limit. A limit cannot be specified if @@ -1090,9 +1110,9 @@ public function executeBatchDml($session, $transaction, $statements, $seqno, arr * @type string $resumeToken * If this request is resuming a previously interrupted read, * `resume_token` should be copied from the last - * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new read to resume where the last read left off. The - * rest of the request parameters must exactly match the request + * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + * interruption. Doing this enables the new read to resume where the last read + * left off. The rest of the request parameters must exactly match the request * that yielded this token. * @type string $partitionToken * If present, results will be restricted to the specified partition @@ -1150,9 +1170,9 @@ public function read($session, $table, $columns, $keySet, array $optionalArgs = } /** - * Like [Read][google.spanner.v1.Spanner.Read], except returns the result set as a - * stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no limit on the - * size of the returned result set. However, no individual row in + * Like [Read][google.spanner.v1.Spanner.Read], except returns the result set + * as a stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no + * limit on the size of the returned result set. However, no individual row in * the result set can exceed 100 MiB, and no column value can exceed * 10 MiB. * @@ -1176,17 +1196,21 @@ public function read($session, $table, $columns, $keySet, array $optionalArgs = * * @param string $session Required. The session in which the read should be performed. * @param string $table Required. The name of the table in the database to be read. - * @param string[] $columns Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be returned for each row matching - * this request. + * @param string[] $columns Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be + * returned for each row matching this request. * @param KeySet $keySet Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to be yielded, unless [index][google.spanner.v1.ReadRequest.index] - * is present. If [index][google.spanner.v1.ReadRequest.index] is present, then [key_set][google.spanner.v1.ReadRequest.key_set] instead names - * index keys in [index][google.spanner.v1.ReadRequest.index]. - * - * If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is empty, rows are yielded - * in table primary key order (if [index][google.spanner.v1.ReadRequest.index] is empty) or index key order - * (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is not - * empty, rows will be yielded in an unspecified order. + * primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to + * be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present. + * If [index][google.spanner.v1.ReadRequest.index] is present, then + * [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys + * in [index][google.spanner.v1.ReadRequest.index]. + * + * If the [partition_token][google.spanner.v1.ReadRequest.partition_token] + * field is empty, rows are yielded in table primary key order (if + * [index][google.spanner.v1.ReadRequest.index] is empty) or index key order + * (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the + * [partition_token][google.spanner.v1.ReadRequest.partition_token] field is + * not empty, rows will be yielded in an unspecified order. * * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. @@ -1197,9 +1221,12 @@ public function read($session, $table, $columns, $keySet, array $optionalArgs = * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. * @type string $index - * If non-empty, the name of an index on [table][google.spanner.v1.ReadRequest.table]. This index is - * used instead of the table primary key when interpreting [key_set][google.spanner.v1.ReadRequest.key_set] - * and sorting result rows. See [key_set][google.spanner.v1.ReadRequest.key_set] for further information. + * If non-empty, the name of an index on + * [table][google.spanner.v1.ReadRequest.table]. This index is used instead of + * the table primary key when interpreting + * [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows. + * See [key_set][google.spanner.v1.ReadRequest.key_set] for further + * information. * @type int $limit * If greater than zero, only the first `limit` rows are yielded. If `limit` * is zero, the default is no limit. A limit cannot be specified if @@ -1207,9 +1234,9 @@ public function read($session, $table, $columns, $keySet, array $optionalArgs = * @type string $resumeToken * If this request is resuming a previously interrupted read, * `resume_token` should be copied from the last - * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new read to resume where the last read left off. The - * rest of the request parameters must exactly match the request + * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + * interruption. Doing this enables the new read to resume where the last read + * left off. The rest of the request parameters must exactly match the request * that yielded this token. * @type string $partitionToken * If present, results will be restricted to the specified partition @@ -1266,7 +1293,8 @@ public function streamingRead($session, $table, $columns, $keySet, array $option /** * Begins a new transaction. This step can often be skipped: - * [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and + * [Read][google.spanner.v1.Spanner.Read], + * [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and * [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a * side-effect. * @@ -1335,19 +1363,15 @@ public function beginTransaction($session, $options, array $optionalArgs = []) * $spannerClient = new SpannerClient(); * try { * $formattedSession = $spannerClient->sessionName('[PROJECT]', '[INSTANCE]', '[DATABASE]', '[SESSION]'); - * $mutations = []; - * $response = $spannerClient->commit($formattedSession, $mutations); + * $response = $spannerClient->commit($formattedSession); * } finally { * $spannerClient->close(); * } * ``` * - * @param string $session Required. The session in which the transaction to be committed is running. - * @param Mutation[] $mutations The mutations to be executed when this transaction commits. All - * mutations are applied atomically, in the order they appear in - * this list. - * @param array $optionalArgs { - * Optional. + * @param string $session Required. The session in which the transaction to be committed is running. + * @param array $optionalArgs { + * Optional. * * @type string $transactionId * Commit a previously-started transaction. @@ -1361,6 +1385,10 @@ public function beginTransaction($session, $options, array $optionalArgs = []) * executed more than once. If this is undesirable, use * [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction] and * [Commit][google.spanner.v1.Spanner.Commit] instead. + * @type Mutation[] $mutations + * The mutations to be executed when this transaction commits. All + * mutations are applied atomically, in the order they appear in + * this list. * @type RetrySettings|array $retrySettings * Retry settings to use for this call. Can be a * {@see Google\ApiCore\RetrySettings} object, or an associative array @@ -1373,17 +1401,19 @@ public function beginTransaction($session, $options, array $optionalArgs = []) * @throws ApiException if the remote call fails * @experimental */ - public function commit($session, $mutations, array $optionalArgs = []) + public function commit($session, array $optionalArgs = []) { $request = new CommitRequest(); $request->setSession($session); - $request->setMutations($mutations); if (isset($optionalArgs['transactionId'])) { $request->setTransactionId($optionalArgs['transactionId']); } if (isset($optionalArgs['singleUseTransaction'])) { $request->setSingleUseTransaction($optionalArgs['singleUseTransaction']); } + if (isset($optionalArgs['mutations'])) { + $request->setMutations($optionalArgs['mutations']); + } $requestParams = new RequestParamsHeaderDescriptor([ 'session' => $request->getSession(), @@ -1403,8 +1433,9 @@ public function commit($session, $mutations, array $optionalArgs = []) /** * Rolls back a transaction, releasing any locks it holds. It is a good * idea to call this for any transaction that includes one or more - * [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and - * ultimately decides not to commit. + * [Read][google.spanner.v1.Spanner.Read] or + * [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately + * decides not to commit. * * `Rollback` returns `OK` if it successfully aborts the transaction, the * transaction was already aborted, or the transaction is not @@ -1461,10 +1492,11 @@ public function rollback($session, $transactionId, array $optionalArgs = []) /** * Creates a set of partition tokens that can be used to execute a query * operation in parallel. Each of the returned partition tokens can be used - * by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to specify a subset - * of the query result to read. The same session and read-only transaction - * must be used by the PartitionQueryRequest used to create the - * partition tokens and the ExecuteSqlRequests that use the partition tokens. + * by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to + * specify a subset of the query result to read. The same session and + * read-only transaction must be used by the PartitionQueryRequest used to + * create the partition tokens and the ExecuteSqlRequests that use the + * partition tokens. * * Partition tokens become invalid when the session used to create them * is deleted, is idle for too long, begins a new transaction, or becomes too @@ -1484,15 +1516,16 @@ public function rollback($session, $transactionId, array $optionalArgs = []) * ``` * * @param string $session Required. The session used to create the partitions. - * @param string $sql Required. The query request to generate partitions for. The request will fail if - * the query is not root partitionable. The query plan of a root + * @param string $sql Required. The query request to generate partitions for. The request will + * fail if the query is not root partitionable. The query plan of a root * partitionable query has a single distributed union operator. A distributed * union operator conceptually divides one or more tables into multiple * splits, remotely evaluates a subquery independently on each split, and * then unions all results. * * This must not contain DML commands, such as INSERT, UPDATE, or - * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a + * DELETE. Use + * [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a * PartitionedDml transaction for large, partition-friendly DML operations. * @param array $optionalArgs { * Optional. @@ -1516,7 +1549,8 @@ public function rollback($session, $transactionId, array $optionalArgs = []) * @type array $paramTypes * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. * * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL query parameters. See the @@ -1572,12 +1606,13 @@ public function partitionQuery($session, $sql, array $optionalArgs = []) /** * Creates a set of partition tokens that can be used to execute a read * operation in parallel. Each of the returned partition tokens can be used - * by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read - * result to read. The same session and read-only transaction must be used by - * the PartitionReadRequest used to create the partition tokens and the - * ReadRequests that use the partition tokens. There are no ordering - * guarantees on rows returned among the returned partition tokens, or even - * within each individual StreamingRead call issued with a partition_token. + * by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a + * subset of the read result to read. The same session and read-only + * transaction must be used by the PartitionReadRequest used to create the + * partition tokens and the ReadRequests that use the partition tokens. There + * are no ordering guarantees on rows returned among the returned partition + * tokens, or even within each individual StreamingRead call issued with a + * partition_token. * * Partition tokens become invalid when the session used to create them * is deleted, is idle for too long, begins a new transaction, or becomes too @@ -1600,8 +1635,11 @@ public function partitionQuery($session, $sql, array $optionalArgs = []) * @param string $session Required. The session used to create the partitions. * @param string $table Required. The name of the table in the database to be read. * @param KeySet $keySet Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless [index][google.spanner.v1.PartitionReadRequest.index] - * is present. If [index][google.spanner.v1.PartitionReadRequest.index] is present, then [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names + * primary keys of the rows in + * [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless + * [index][google.spanner.v1.PartitionReadRequest.index] is present. If + * [index][google.spanner.v1.PartitionReadRequest.index] is present, then + * [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names * index keys in [index][google.spanner.v1.PartitionReadRequest.index]. * * It is not an error for the `key_set` to name rows that do not @@ -1613,12 +1651,15 @@ public function partitionQuery($session, $sql, array $optionalArgs = []) * Read only snapshot transactions are supported, read/write and single use * transactions are not. * @type string $index - * If non-empty, the name of an index on [table][google.spanner.v1.PartitionReadRequest.table]. This index is - * used instead of the table primary key when interpreting [key_set][google.spanner.v1.PartitionReadRequest.key_set] - * and sorting result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] for further information. + * If non-empty, the name of an index on + * [table][google.spanner.v1.PartitionReadRequest.table]. This index is used + * instead of the table primary key when interpreting + * [key_set][google.spanner.v1.PartitionReadRequest.key_set] and sorting + * result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] + * for further information. * @type string[] $columns - * The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be returned for each row matching - * this request. + * The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be + * returned for each row matching this request. * @type PartitionOptions $partitionOptions * Additional options that affect how many partitions are created. * @type RetrySettings|array $retrySettings diff --git a/Spanner/src/V1/ListSessionsRequest.php b/Spanner/src/V1/ListSessionsRequest.php index 9f38c77849eb..48988d28becc 100644 --- a/Spanner/src/V1/ListSessionsRequest.php +++ b/Spanner/src/V1/ListSessionsRequest.php @@ -30,7 +30,8 @@ class ListSessionsRequest extends \Google\Protobuf\Internal\Message private $page_size = 0; /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] from a previous + * [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] + * from a previous * [ListSessionsResponse][google.spanner.v1.ListSessionsResponse]. * * Generated from protobuf field string page_token = 3; @@ -62,7 +63,8 @@ class ListSessionsRequest extends \Google\Protobuf\Internal\Message * to the server's maximum allowed page size. * @type string $page_token * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] from a previous + * [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] + * from a previous * [ListSessionsResponse][google.spanner.v1.ListSessionsResponse]. * @type string $filter * An expression for filtering the results of the request. Filter rules are @@ -135,7 +137,8 @@ public function setPageSize($var) /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] from a previous + * [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] + * from a previous * [ListSessionsResponse][google.spanner.v1.ListSessionsResponse]. * * Generated from protobuf field string page_token = 3; @@ -148,7 +151,8 @@ public function getPageToken() /** * If non-empty, `page_token` should contain a - * [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] from a previous + * [next_page_token][google.spanner.v1.ListSessionsResponse.next_page_token] + * from a previous * [ListSessionsResponse][google.spanner.v1.ListSessionsResponse]. * * Generated from protobuf field string page_token = 3; diff --git a/Spanner/src/V1/ListSessionsResponse.php b/Spanner/src/V1/ListSessionsResponse.php index caae91f405bc..3f7ee60ee8c8 100644 --- a/Spanner/src/V1/ListSessionsResponse.php +++ b/Spanner/src/V1/ListSessionsResponse.php @@ -23,8 +23,8 @@ class ListSessionsResponse extends \Google\Protobuf\Internal\Message private $sessions; /** * `next_page_token` can be sent in a subsequent - * [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more of the matching - * sessions. + * [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more + * of the matching sessions. * * Generated from protobuf field string next_page_token = 2; */ @@ -40,8 +40,8 @@ class ListSessionsResponse extends \Google\Protobuf\Internal\Message * The list of requested sessions. * @type string $next_page_token * `next_page_token` can be sent in a subsequent - * [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more of the matching - * sessions. + * [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more + * of the matching sessions. * } */ public function __construct($data = NULL) { @@ -77,8 +77,8 @@ public function setSessions($var) /** * `next_page_token` can be sent in a subsequent - * [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more of the matching - * sessions. + * [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more + * of the matching sessions. * * Generated from protobuf field string next_page_token = 2; * @return string @@ -90,8 +90,8 @@ public function getNextPageToken() /** * `next_page_token` can be sent in a subsequent - * [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more of the matching - * sessions. + * [ListSessions][google.spanner.v1.Spanner.ListSessions] call to fetch more + * of the matching sessions. * * Generated from protobuf field string next_page_token = 2; * @param string $var diff --git a/Spanner/src/V1/PartitionQueryRequest.php b/Spanner/src/V1/PartitionQueryRequest.php index e2f8a2556ff7..f35f52039b30 100644 --- a/Spanner/src/V1/PartitionQueryRequest.php +++ b/Spanner/src/V1/PartitionQueryRequest.php @@ -29,14 +29,15 @@ class PartitionQueryRequest extends \Google\Protobuf\Internal\Message */ private $transaction = null; /** - * Required. The query request to generate partitions for. The request will fail if - * the query is not root partitionable. The query plan of a root + * Required. The query request to generate partitions for. The request will + * fail if the query is not root partitionable. The query plan of a root * partitionable query has a single distributed union operator. A distributed * union operator conceptually divides one or more tables into multiple * splits, remotely evaluates a subquery independently on each split, and * then unions all results. * This must not contain DML commands, such as INSERT, UPDATE, or - * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a + * DELETE. Use + * [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a * PartitionedDml transaction for large, partition-friendly DML operations. * * Generated from protobuf field string sql = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -58,7 +59,8 @@ class PartitionQueryRequest extends \Google\Protobuf\Internal\Message /** * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL query parameters. See the * definition of [Type][google.spanner.v1.Type] for more information @@ -86,14 +88,15 @@ class PartitionQueryRequest extends \Google\Protobuf\Internal\Message * Read only snapshot transactions are supported, read/write and single use * transactions are not. * @type string $sql - * Required. The query request to generate partitions for. The request will fail if - * the query is not root partitionable. The query plan of a root + * Required. The query request to generate partitions for. The request will + * fail if the query is not root partitionable. The query plan of a root * partitionable query has a single distributed union operator. A distributed * union operator conceptually divides one or more tables into multiple * splits, remotely evaluates a subquery independently on each split, and * then unions all results. * This must not contain DML commands, such as INSERT, UPDATE, or - * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a + * DELETE. Use + * [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a * PartitionedDml transaction for large, partition-friendly DML operations. * @type \Google\Protobuf\Struct $params * Parameter names and values that bind to placeholders in the SQL string. @@ -107,7 +110,8 @@ class PartitionQueryRequest extends \Google\Protobuf\Internal\Message * @type array|\Google\Protobuf\Internal\MapField $param_types * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL query parameters. See the * definition of [Type][google.spanner.v1.Type] for more information @@ -176,14 +180,15 @@ public function setTransaction($var) } /** - * Required. The query request to generate partitions for. The request will fail if - * the query is not root partitionable. The query plan of a root + * Required. The query request to generate partitions for. The request will + * fail if the query is not root partitionable. The query plan of a root * partitionable query has a single distributed union operator. A distributed * union operator conceptually divides one or more tables into multiple * splits, remotely evaluates a subquery independently on each split, and * then unions all results. * This must not contain DML commands, such as INSERT, UPDATE, or - * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a + * DELETE. Use + * [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a * PartitionedDml transaction for large, partition-friendly DML operations. * * Generated from protobuf field string sql = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -195,14 +200,15 @@ public function getSql() } /** - * Required. The query request to generate partitions for. The request will fail if - * the query is not root partitionable. The query plan of a root + * Required. The query request to generate partitions for. The request will + * fail if the query is not root partitionable. The query plan of a root * partitionable query has a single distributed union operator. A distributed * union operator conceptually divides one or more tables into multiple * splits, remotely evaluates a subquery independently on each split, and * then unions all results. * This must not contain DML commands, such as INSERT, UPDATE, or - * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a + * DELETE. Use + * [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a * PartitionedDml transaction for large, partition-friendly DML operations. * * Generated from protobuf field string sql = 3 [(.google.api.field_behavior) = REQUIRED]; @@ -260,7 +266,8 @@ public function setParams($var) /** * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL query parameters. See the * definition of [Type][google.spanner.v1.Type] for more information @@ -277,7 +284,8 @@ public function getParamTypes() /** * It is not always possible for Cloud Spanner to infer the right SQL type * from a JSON value. For example, values of type `BYTES` and values - * of type `STRING` both appear in [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. + * of type `STRING` both appear in + * [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact * SQL type for some or all of the SQL query parameters. See the * definition of [Type][google.spanner.v1.Type] for more information diff --git a/Spanner/src/V1/PartitionReadRequest.php b/Spanner/src/V1/PartitionReadRequest.php index 82322695ce95..8eddee29f6c7 100644 --- a/Spanner/src/V1/PartitionReadRequest.php +++ b/Spanner/src/V1/PartitionReadRequest.php @@ -35,24 +35,30 @@ class PartitionReadRequest extends \Google\Protobuf\Internal\Message */ private $table = ''; /** - * If non-empty, the name of an index on [table][google.spanner.v1.PartitionReadRequest.table]. This index is - * used instead of the table primary key when interpreting [key_set][google.spanner.v1.PartitionReadRequest.key_set] - * and sorting result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] for further information. + * If non-empty, the name of an index on + * [table][google.spanner.v1.PartitionReadRequest.table]. This index is used + * instead of the table primary key when interpreting + * [key_set][google.spanner.v1.PartitionReadRequest.key_set] and sorting + * result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] + * for further information. * * Generated from protobuf field string index = 4; */ private $index = ''; /** - * The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be returned for each row matching - * this request. + * The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be + * returned for each row matching this request. * * Generated from protobuf field repeated string columns = 5; */ private $columns; /** * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless [index][google.spanner.v1.PartitionReadRequest.index] - * is present. If [index][google.spanner.v1.PartitionReadRequest.index] is present, then [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names + * primary keys of the rows in + * [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless + * [index][google.spanner.v1.PartitionReadRequest.index] is present. If + * [index][google.spanner.v1.PartitionReadRequest.index] is present, then + * [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names * index keys in [index][google.spanner.v1.PartitionReadRequest.index]. * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. @@ -81,16 +87,22 @@ class PartitionReadRequest extends \Google\Protobuf\Internal\Message * @type string $table * Required. The name of the table in the database to be read. * @type string $index - * If non-empty, the name of an index on [table][google.spanner.v1.PartitionReadRequest.table]. This index is - * used instead of the table primary key when interpreting [key_set][google.spanner.v1.PartitionReadRequest.key_set] - * and sorting result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] for further information. + * If non-empty, the name of an index on + * [table][google.spanner.v1.PartitionReadRequest.table]. This index is used + * instead of the table primary key when interpreting + * [key_set][google.spanner.v1.PartitionReadRequest.key_set] and sorting + * result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] + * for further information. * @type string[]|\Google\Protobuf\Internal\RepeatedField $columns - * The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be returned for each row matching - * this request. + * The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be + * returned for each row matching this request. * @type \Google\Cloud\Spanner\V1\KeySet $key_set * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless [index][google.spanner.v1.PartitionReadRequest.index] - * is present. If [index][google.spanner.v1.PartitionReadRequest.index] is present, then [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names + * primary keys of the rows in + * [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless + * [index][google.spanner.v1.PartitionReadRequest.index] is present. If + * [index][google.spanner.v1.PartitionReadRequest.index] is present, then + * [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names * index keys in [index][google.spanner.v1.PartitionReadRequest.index]. * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. @@ -184,9 +196,12 @@ public function setTable($var) } /** - * If non-empty, the name of an index on [table][google.spanner.v1.PartitionReadRequest.table]. This index is - * used instead of the table primary key when interpreting [key_set][google.spanner.v1.PartitionReadRequest.key_set] - * and sorting result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] for further information. + * If non-empty, the name of an index on + * [table][google.spanner.v1.PartitionReadRequest.table]. This index is used + * instead of the table primary key when interpreting + * [key_set][google.spanner.v1.PartitionReadRequest.key_set] and sorting + * result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] + * for further information. * * Generated from protobuf field string index = 4; * @return string @@ -197,9 +212,12 @@ public function getIndex() } /** - * If non-empty, the name of an index on [table][google.spanner.v1.PartitionReadRequest.table]. This index is - * used instead of the table primary key when interpreting [key_set][google.spanner.v1.PartitionReadRequest.key_set] - * and sorting result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] for further information. + * If non-empty, the name of an index on + * [table][google.spanner.v1.PartitionReadRequest.table]. This index is used + * instead of the table primary key when interpreting + * [key_set][google.spanner.v1.PartitionReadRequest.key_set] and sorting + * result rows. See [key_set][google.spanner.v1.PartitionReadRequest.key_set] + * for further information. * * Generated from protobuf field string index = 4; * @param string $var @@ -214,8 +232,8 @@ public function setIndex($var) } /** - * The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be returned for each row matching - * this request. + * The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be + * returned for each row matching this request. * * Generated from protobuf field repeated string columns = 5; * @return \Google\Protobuf\Internal\RepeatedField @@ -226,8 +244,8 @@ public function getColumns() } /** - * The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be returned for each row matching - * this request. + * The columns of [table][google.spanner.v1.PartitionReadRequest.table] to be + * returned for each row matching this request. * * Generated from protobuf field repeated string columns = 5; * @param string[]|\Google\Protobuf\Internal\RepeatedField $var @@ -243,8 +261,11 @@ public function setColumns($var) /** * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless [index][google.spanner.v1.PartitionReadRequest.index] - * is present. If [index][google.spanner.v1.PartitionReadRequest.index] is present, then [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names + * primary keys of the rows in + * [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless + * [index][google.spanner.v1.PartitionReadRequest.index] is present. If + * [index][google.spanner.v1.PartitionReadRequest.index] is present, then + * [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names * index keys in [index][google.spanner.v1.PartitionReadRequest.index]. * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. @@ -259,8 +280,11 @@ public function getKeySet() /** * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless [index][google.spanner.v1.PartitionReadRequest.index] - * is present. If [index][google.spanner.v1.PartitionReadRequest.index] is present, then [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names + * primary keys of the rows in + * [table][google.spanner.v1.PartitionReadRequest.table] to be yielded, unless + * [index][google.spanner.v1.PartitionReadRequest.index] is present. If + * [index][google.spanner.v1.PartitionReadRequest.index] is present, then + * [key_set][google.spanner.v1.PartitionReadRequest.key_set] instead names * index keys in [index][google.spanner.v1.PartitionReadRequest.index]. * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. diff --git a/Spanner/src/V1/ReadRequest.php b/Spanner/src/V1/ReadRequest.php index ef5f4b6c901b..a8d6733150ab 100644 --- a/Spanner/src/V1/ReadRequest.php +++ b/Spanner/src/V1/ReadRequest.php @@ -36,29 +36,36 @@ class ReadRequest extends \Google\Protobuf\Internal\Message */ private $table = ''; /** - * If non-empty, the name of an index on [table][google.spanner.v1.ReadRequest.table]. This index is - * used instead of the table primary key when interpreting [key_set][google.spanner.v1.ReadRequest.key_set] - * and sorting result rows. See [key_set][google.spanner.v1.ReadRequest.key_set] for further information. + * If non-empty, the name of an index on + * [table][google.spanner.v1.ReadRequest.table]. This index is used instead of + * the table primary key when interpreting + * [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows. + * See [key_set][google.spanner.v1.ReadRequest.key_set] for further + * information. * * Generated from protobuf field string index = 4; */ private $index = ''; /** - * Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be returned for each row matching - * this request. + * Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be + * returned for each row matching this request. * * Generated from protobuf field repeated string columns = 5 [(.google.api.field_behavior) = REQUIRED]; */ private $columns; /** * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to be yielded, unless [index][google.spanner.v1.ReadRequest.index] - * is present. If [index][google.spanner.v1.ReadRequest.index] is present, then [key_set][google.spanner.v1.ReadRequest.key_set] instead names - * index keys in [index][google.spanner.v1.ReadRequest.index]. - * If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is empty, rows are yielded - * in table primary key order (if [index][google.spanner.v1.ReadRequest.index] is empty) or index key order - * (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is not - * empty, rows will be yielded in an unspecified order. + * primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to + * be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present. + * If [index][google.spanner.v1.ReadRequest.index] is present, then + * [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys + * in [index][google.spanner.v1.ReadRequest.index]. + * If the [partition_token][google.spanner.v1.ReadRequest.partition_token] + * field is empty, rows are yielded in table primary key order (if + * [index][google.spanner.v1.ReadRequest.index] is empty) or index key order + * (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the + * [partition_token][google.spanner.v1.ReadRequest.partition_token] field is + * not empty, rows will be yielded in an unspecified order. * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. * @@ -76,9 +83,9 @@ class ReadRequest extends \Google\Protobuf\Internal\Message /** * If this request is resuming a previously interrupted read, * `resume_token` should be copied from the last - * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new read to resume where the last read left off. The - * rest of the request parameters must exactly match the request + * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + * interruption. Doing this enables the new read to resume where the last read + * left off. The rest of the request parameters must exactly match the request * that yielded this token. * * Generated from protobuf field bytes resume_token = 9; @@ -108,21 +115,28 @@ class ReadRequest extends \Google\Protobuf\Internal\Message * @type string $table * Required. The name of the table in the database to be read. * @type string $index - * If non-empty, the name of an index on [table][google.spanner.v1.ReadRequest.table]. This index is - * used instead of the table primary key when interpreting [key_set][google.spanner.v1.ReadRequest.key_set] - * and sorting result rows. See [key_set][google.spanner.v1.ReadRequest.key_set] for further information. + * If non-empty, the name of an index on + * [table][google.spanner.v1.ReadRequest.table]. This index is used instead of + * the table primary key when interpreting + * [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows. + * See [key_set][google.spanner.v1.ReadRequest.key_set] for further + * information. * @type string[]|\Google\Protobuf\Internal\RepeatedField $columns - * Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be returned for each row matching - * this request. + * Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be + * returned for each row matching this request. * @type \Google\Cloud\Spanner\V1\KeySet $key_set * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to be yielded, unless [index][google.spanner.v1.ReadRequest.index] - * is present. If [index][google.spanner.v1.ReadRequest.index] is present, then [key_set][google.spanner.v1.ReadRequest.key_set] instead names - * index keys in [index][google.spanner.v1.ReadRequest.index]. - * If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is empty, rows are yielded - * in table primary key order (if [index][google.spanner.v1.ReadRequest.index] is empty) or index key order - * (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is not - * empty, rows will be yielded in an unspecified order. + * primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to + * be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present. + * If [index][google.spanner.v1.ReadRequest.index] is present, then + * [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys + * in [index][google.spanner.v1.ReadRequest.index]. + * If the [partition_token][google.spanner.v1.ReadRequest.partition_token] + * field is empty, rows are yielded in table primary key order (if + * [index][google.spanner.v1.ReadRequest.index] is empty) or index key order + * (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the + * [partition_token][google.spanner.v1.ReadRequest.partition_token] field is + * not empty, rows will be yielded in an unspecified order. * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. * @type int|string $limit @@ -132,9 +146,9 @@ class ReadRequest extends \Google\Protobuf\Internal\Message * @type string $resume_token * If this request is resuming a previously interrupted read, * `resume_token` should be copied from the last - * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new read to resume where the last read left off. The - * rest of the request parameters must exactly match the request + * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + * interruption. Doing this enables the new read to resume where the last read + * left off. The rest of the request parameters must exactly match the request * that yielded this token. * @type string $partition_token * If present, results will be restricted to the specified partition @@ -229,9 +243,12 @@ public function setTable($var) } /** - * If non-empty, the name of an index on [table][google.spanner.v1.ReadRequest.table]. This index is - * used instead of the table primary key when interpreting [key_set][google.spanner.v1.ReadRequest.key_set] - * and sorting result rows. See [key_set][google.spanner.v1.ReadRequest.key_set] for further information. + * If non-empty, the name of an index on + * [table][google.spanner.v1.ReadRequest.table]. This index is used instead of + * the table primary key when interpreting + * [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows. + * See [key_set][google.spanner.v1.ReadRequest.key_set] for further + * information. * * Generated from protobuf field string index = 4; * @return string @@ -242,9 +259,12 @@ public function getIndex() } /** - * If non-empty, the name of an index on [table][google.spanner.v1.ReadRequest.table]. This index is - * used instead of the table primary key when interpreting [key_set][google.spanner.v1.ReadRequest.key_set] - * and sorting result rows. See [key_set][google.spanner.v1.ReadRequest.key_set] for further information. + * If non-empty, the name of an index on + * [table][google.spanner.v1.ReadRequest.table]. This index is used instead of + * the table primary key when interpreting + * [key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows. + * See [key_set][google.spanner.v1.ReadRequest.key_set] for further + * information. * * Generated from protobuf field string index = 4; * @param string $var @@ -259,8 +279,8 @@ public function setIndex($var) } /** - * Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be returned for each row matching - * this request. + * Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be + * returned for each row matching this request. * * Generated from protobuf field repeated string columns = 5 [(.google.api.field_behavior) = REQUIRED]; * @return \Google\Protobuf\Internal\RepeatedField @@ -271,8 +291,8 @@ public function getColumns() } /** - * Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be returned for each row matching - * this request. + * Required. The columns of [table][google.spanner.v1.ReadRequest.table] to be + * returned for each row matching this request. * * Generated from protobuf field repeated string columns = 5 [(.google.api.field_behavior) = REQUIRED]; * @param string[]|\Google\Protobuf\Internal\RepeatedField $var @@ -288,13 +308,17 @@ public function setColumns($var) /** * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to be yielded, unless [index][google.spanner.v1.ReadRequest.index] - * is present. If [index][google.spanner.v1.ReadRequest.index] is present, then [key_set][google.spanner.v1.ReadRequest.key_set] instead names - * index keys in [index][google.spanner.v1.ReadRequest.index]. - * If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is empty, rows are yielded - * in table primary key order (if [index][google.spanner.v1.ReadRequest.index] is empty) or index key order - * (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is not - * empty, rows will be yielded in an unspecified order. + * primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to + * be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present. + * If [index][google.spanner.v1.ReadRequest.index] is present, then + * [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys + * in [index][google.spanner.v1.ReadRequest.index]. + * If the [partition_token][google.spanner.v1.ReadRequest.partition_token] + * field is empty, rows are yielded in table primary key order (if + * [index][google.spanner.v1.ReadRequest.index] is empty) or index key order + * (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the + * [partition_token][google.spanner.v1.ReadRequest.partition_token] field is + * not empty, rows will be yielded in an unspecified order. * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. * @@ -308,13 +332,17 @@ public function getKeySet() /** * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to be yielded, unless [index][google.spanner.v1.ReadRequest.index] - * is present. If [index][google.spanner.v1.ReadRequest.index] is present, then [key_set][google.spanner.v1.ReadRequest.key_set] instead names - * index keys in [index][google.spanner.v1.ReadRequest.index]. - * If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is empty, rows are yielded - * in table primary key order (if [index][google.spanner.v1.ReadRequest.index] is empty) or index key order - * (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the [partition_token][google.spanner.v1.ReadRequest.partition_token] field is not - * empty, rows will be yielded in an unspecified order. + * primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to + * be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present. + * If [index][google.spanner.v1.ReadRequest.index] is present, then + * [key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys + * in [index][google.spanner.v1.ReadRequest.index]. + * If the [partition_token][google.spanner.v1.ReadRequest.partition_token] + * field is empty, rows are yielded in table primary key order (if + * [index][google.spanner.v1.ReadRequest.index] is empty) or index key order + * (if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the + * [partition_token][google.spanner.v1.ReadRequest.partition_token] field is + * not empty, rows will be yielded in an unspecified order. * It is not an error for the `key_set` to name rows that do not * exist in the database. Read yields nothing for nonexistent rows. * @@ -363,9 +391,9 @@ public function setLimit($var) /** * If this request is resuming a previously interrupted read, * `resume_token` should be copied from the last - * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new read to resume where the last read left off. The - * rest of the request parameters must exactly match the request + * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + * interruption. Doing this enables the new read to resume where the last read + * left off. The rest of the request parameters must exactly match the request * that yielded this token. * * Generated from protobuf field bytes resume_token = 9; @@ -379,9 +407,9 @@ public function getResumeToken() /** * If this request is resuming a previously interrupted read, * `resume_token` should be copied from the last - * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new read to resume where the last read left off. The - * rest of the request parameters must exactly match the request + * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the + * interruption. Doing this enables the new read to resume where the last read + * left off. The rest of the request parameters must exactly match the request * that yielded this token. * * Generated from protobuf field bytes resume_token = 9; diff --git a/Spanner/src/V1/SpannerGrpcClient.php b/Spanner/src/V1/SpannerGrpcClient.php index 18b69348577a..77dfdfe52630 100644 --- a/Spanner/src/V1/SpannerGrpcClient.php +++ b/Spanner/src/V1/SpannerGrpcClient.php @@ -139,10 +139,12 @@ public function DeleteSession(\Google\Cloud\Spanner\V1\DeleteSessionRequest $arg * * Operations inside read-write transactions might return `ABORTED`. If * this occurs, the application should restart the transaction from - * the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. + * the beginning. See [Transaction][google.spanner.v1.Transaction] for more + * details. * * Larger result sets can be fetched in streaming fashion by calling - * [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead. + * [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] + * instead. * @param \Google\Cloud\Spanner\V1\ExecuteSqlRequest $argument input argument * @param array $metadata metadata * @param array $options call options @@ -156,11 +158,11 @@ public function ExecuteSql(\Google\Cloud\Spanner\V1\ExecuteSqlRequest $argument, } /** - * Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the result - * set as a stream. Unlike [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there - * is no limit on the size of the returned result set. However, no - * individual row in the result set can exceed 100 MiB, and no - * column value can exceed 10 MiB. + * Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the + * result set as a stream. Unlike + * [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there is no limit on + * the size of the returned result set. However, no individual row in the + * result set can exceed 100 MiB, and no column value can exceed 10 MiB. * @param \Google\Cloud\Spanner\V1\ExecuteSqlRequest $argument input argument * @param array $metadata metadata * @param array $options call options @@ -179,9 +181,10 @@ public function ExecuteStreamingSql(\Google\Cloud\Spanner\V1\ExecuteSqlRequest $ * [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. * * Statements are executed in sequential order. A request can succeed even if - * a statement fails. The [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] field in the - * response provides information about the statement that failed. Clients must - * inspect this field to determine whether an error occurred. + * a statement fails. The + * [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] + * field in the response provides information about the statement that failed. + * Clients must inspect this field to determine whether an error occurred. * * Execution stops after the first failed statement; the remaining statements * are not executed. @@ -200,14 +203,15 @@ public function ExecuteBatchDml(\Google\Cloud\Spanner\V1\ExecuteBatchDmlRequest /** * Reads rows from the database using key lookups and scans, as a * simple key/value style alternative to - * [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be used to - * return a result set larger than 10 MiB; if the read matches more + * [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be + * used to return a result set larger than 10 MiB; if the read matches more * data than that, the read fails with a `FAILED_PRECONDITION` * error. * * Reads inside read-write transactions might return `ABORTED`. If * this occurs, the application should restart the transaction from - * the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. + * the beginning. See [Transaction][google.spanner.v1.Transaction] for more + * details. * * Larger result sets can be yielded in streaming fashion by calling * [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead. @@ -224,9 +228,9 @@ public function Read(\Google\Cloud\Spanner\V1\ReadRequest $argument, } /** - * Like [Read][google.spanner.v1.Spanner.Read], except returns the result set as a - * stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no limit on the - * size of the returned result set. However, no individual row in + * Like [Read][google.spanner.v1.Spanner.Read], except returns the result set + * as a stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no + * limit on the size of the returned result set. However, no individual row in * the result set can exceed 100 MiB, and no column value can exceed * 10 MiB. * @param \Google\Cloud\Spanner\V1\ReadRequest $argument input argument @@ -243,7 +247,8 @@ public function StreamingRead(\Google\Cloud\Spanner\V1\ReadRequest $argument, /** * Begins a new transaction. This step can often be skipped: - * [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and + * [Read][google.spanner.v1.Spanner.Read], + * [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and * [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a * side-effect. * @param \Google\Cloud\Spanner\V1\BeginTransactionRequest $argument input argument @@ -282,8 +287,9 @@ public function Commit(\Google\Cloud\Spanner\V1\CommitRequest $argument, /** * Rolls back a transaction, releasing any locks it holds. It is a good * idea to call this for any transaction that includes one or more - * [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and - * ultimately decides not to commit. + * [Read][google.spanner.v1.Spanner.Read] or + * [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately + * decides not to commit. * * `Rollback` returns `OK` if it successfully aborts the transaction, the * transaction was already aborted, or the transaction is not @@ -303,10 +309,11 @@ public function Rollback(\Google\Cloud\Spanner\V1\RollbackRequest $argument, /** * Creates a set of partition tokens that can be used to execute a query * operation in parallel. Each of the returned partition tokens can be used - * by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to specify a subset - * of the query result to read. The same session and read-only transaction - * must be used by the PartitionQueryRequest used to create the - * partition tokens and the ExecuteSqlRequests that use the partition tokens. + * by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to + * specify a subset of the query result to read. The same session and + * read-only transaction must be used by the PartitionQueryRequest used to + * create the partition tokens and the ExecuteSqlRequests that use the + * partition tokens. * * Partition tokens become invalid when the session used to create them * is deleted, is idle for too long, begins a new transaction, or becomes too @@ -327,12 +334,13 @@ public function PartitionQuery(\Google\Cloud\Spanner\V1\PartitionQueryRequest $a /** * Creates a set of partition tokens that can be used to execute a read * operation in parallel. Each of the returned partition tokens can be used - * by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read - * result to read. The same session and read-only transaction must be used by - * the PartitionReadRequest used to create the partition tokens and the - * ReadRequests that use the partition tokens. There are no ordering - * guarantees on rows returned among the returned partition tokens, or even - * within each individual StreamingRead call issued with a partition_token. + * by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a + * subset of the read result to read. The same session and read-only + * transaction must be used by the PartitionReadRequest used to create the + * partition tokens and the ReadRequests that use the partition tokens. There + * are no ordering guarantees on rows returned among the returned partition + * tokens, or even within each individual StreamingRead call issued with a + * partition_token. * * Partition tokens become invalid when the session used to create them * is deleted, is idle for too long, begins a new transaction, or becomes too diff --git a/Spanner/src/V1/resources/spanner_client_config.json b/Spanner/src/V1/resources/spanner_client_config.json index d1a29cad3c87..ea9f14d42c56 100644 --- a/Spanner/src/V1/resources/spanner_client_config.json +++ b/Spanner/src/V1/resources/spanner_client_config.json @@ -15,18 +15,18 @@ "initial_retry_delay_millis": 250, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 32000, - "initial_rpc_timeout_millis": 360000, + "initial_rpc_timeout_millis": 3600000, "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 360000, + "max_rpc_timeout_millis": 3600000, "total_timeout_millis": 3600000 }, "streaming": { "initial_retry_delay_millis": 250, "retry_delay_multiplier": 1.3, "max_retry_delay_millis": 32000, - "initial_rpc_timeout_millis": 360000, + "initial_rpc_timeout_millis": 3600000, "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 360000, + "max_rpc_timeout_millis": 3600000, "total_timeout_millis": 3600000 }, "long_running": { diff --git a/Spanner/synth.metadata b/Spanner/synth.metadata index 64142979c538..6e986cd7f5f2 100644 --- a/Spanner/synth.metadata +++ b/Spanner/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-10-31T10:02:21.428529Z", + "updateTime": "2019-11-14T11:03:16.534441Z", "sources": [ { "generator": { "name": "artman", - "version": "0.41.0", - "dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9" + "version": "0.41.1", + "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c0e494ca955a4fdd9ad460a5890a354ec3a3a0ff", - "internalRef": "277673798" + "sha": "bc76ffd87360ce1cd34e3a6eac28afd5e1efda76", + "internalRef": "280356106" } } ], diff --git a/Spanner/tests/Unit/Admin/Database/V1/DatabaseAdminClientTest.php b/Spanner/tests/Unit/Admin/Database/V1/DatabaseAdminClientTest.php index dfbdab5886f4..339719ecbdc5 100644 --- a/Spanner/tests/Unit/Admin/Database/V1/DatabaseAdminClientTest.php +++ b/Spanner/tests/Unit/Admin/Database/V1/DatabaseAdminClientTest.php @@ -76,85 +76,6 @@ private function createClient(array $options = []) return new DatabaseAdminClient($options); } - /** - * @test - */ - public function listDatabasesTest() - { - $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - - $this->assertTrue($transport->isExhausted()); - - // Mock response - $nextPageToken = ''; - $databasesElement = new Database(); - $databases = [$databasesElement]; - $expectedResponse = new ListDatabasesResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDatabases($databases); - $transport->addResponse($expectedResponse); - - // Mock request - $formattedParent = $client->instanceName('[PROJECT]', '[INSTANCE]'); - - $response = $client->listDatabases($formattedParent); - $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); - $resources = iterator_to_array($response->iterateAllElements()); - $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDatabases()[0], $resources[0]); - - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.spanner.admin.database.v1.DatabaseAdmin/ListDatabases', $actualFuncCall); - - $actualValue = $actualRequestObject->getParent(); - - $this->assertProtobufEquals($formattedParent, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listDatabasesExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient(['transport' => $transport]); - - $this->assertTrue($transport->isExhausted()); - - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - - // Mock request - $formattedParent = $client->instanceName('[PROJECT]', '[INSTANCE]'); - - try { - $client->listDatabases($formattedParent); - // If the $client 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 */ @@ -680,10 +601,10 @@ public function setIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request - $formattedResource = $client->databaseName('[PROJECT]', '[INSTANCE]', '[DATABASE]'); + $resource = 'resource-341064690'; $policy = new Policy(); - $response = $client->setIamPolicy($formattedResource, $policy); + $response = $client->setIamPolicy($resource, $policy); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -693,7 +614,7 @@ public function setIamPolicyTest() $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($formattedResource, $actualValue); + $this->assertProtobufEquals($resource, $actualValue); $actualValue = $actualRequestObject->getPolicy(); $this->assertProtobufEquals($policy, $actualValue); @@ -724,11 +645,11 @@ public function setIamPolicyExceptionTest() $transport->addResponse(null, $status); // Mock request - $formattedResource = $client->databaseName('[PROJECT]', '[INSTANCE]', '[DATABASE]'); + $resource = 'resource-341064690'; $policy = new Policy(); try { - $client->setIamPolicy($formattedResource, $policy); + $client->setIamPolicy($resource, $policy); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -760,9 +681,9 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request - $formattedResource = $client->databaseName('[PROJECT]', '[INSTANCE]', '[DATABASE]'); + $resource = 'resource-341064690'; - $response = $client->getIamPolicy($formattedResource); + $response = $client->getIamPolicy($resource); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -772,7 +693,7 @@ public function getIamPolicyTest() $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($formattedResource, $actualValue); + $this->assertProtobufEquals($resource, $actualValue); $this->assertTrue($transport->isExhausted()); } @@ -800,10 +721,10 @@ public function getIamPolicyExceptionTest() $transport->addResponse(null, $status); // Mock request - $formattedResource = $client->databaseName('[PROJECT]', '[INSTANCE]', '[DATABASE]'); + $resource = 'resource-341064690'; try { - $client->getIamPolicy($formattedResource); + $client->getIamPolicy($resource); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -831,10 +752,10 @@ public function testIamPermissionsTest() $transport->addResponse($expectedResponse); // Mock request - $formattedResource = $client->databaseName('[PROJECT]', '[INSTANCE]', '[DATABASE]'); + $resource = 'resource-341064690'; $permissions = []; - $response = $client->testIamPermissions($formattedResource, $permissions); + $response = $client->testIamPermissions($resource, $permissions); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -844,7 +765,7 @@ public function testIamPermissionsTest() $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($formattedResource, $actualValue); + $this->assertProtobufEquals($resource, $actualValue); $actualValue = $actualRequestObject->getPermissions(); $this->assertProtobufEquals($permissions, $actualValue); @@ -875,11 +796,90 @@ public function testIamPermissionsExceptionTest() $transport->addResponse(null, $status); // Mock request - $formattedResource = $client->databaseName('[PROJECT]', '[INSTANCE]', '[DATABASE]'); + $resource = 'resource-341064690'; $permissions = []; try { - $client->testIamPermissions($formattedResource, $permissions); + $client->testIamPermissions($resource, $permissions); + // If the $client 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 listDatabasesTest() + { + $transport = $this->createTransport(); + $client = $this->createClient(['transport' => $transport]); + + $this->assertTrue($transport->isExhausted()); + + // Mock response + $nextPageToken = ''; + $databasesElement = new Database(); + $databases = [$databasesElement]; + $expectedResponse = new ListDatabasesResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDatabases($databases); + $transport->addResponse($expectedResponse); + + // Mock request + $formattedParent = $client->instanceName('[PROJECT]', '[INSTANCE]'); + + $response = $client->listDatabases($formattedParent); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDatabases()[0], $resources[0]); + + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.spanner.admin.database.v1.DatabaseAdmin/ListDatabases', $actualFuncCall); + + $actualValue = $actualRequestObject->getParent(); + + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listDatabasesExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient(['transport' => $transport]); + + $this->assertTrue($transport->isExhausted()); + + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + + // Mock request + $formattedParent = $client->instanceName('[PROJECT]', '[INSTANCE]'); + + try { + $client->listDatabases($formattedParent); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { diff --git a/Spanner/tests/Unit/Admin/Instance/V1/InstanceAdminClientTest.php b/Spanner/tests/Unit/Admin/Instance/V1/InstanceAdminClientTest.php index 442960e6ea00..527a9b632d1e 100644 --- a/Spanner/tests/Unit/Admin/Instance/V1/InstanceAdminClientTest.php +++ b/Spanner/tests/Unit/Admin/Instance/V1/InstanceAdminClientTest.php @@ -790,10 +790,10 @@ public function setIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request - $formattedResource = $client->instanceName('[PROJECT]', '[INSTANCE]'); + $resource = 'resource-341064690'; $policy = new Policy(); - $response = $client->setIamPolicy($formattedResource, $policy); + $response = $client->setIamPolicy($resource, $policy); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -803,7 +803,7 @@ public function setIamPolicyTest() $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($formattedResource, $actualValue); + $this->assertProtobufEquals($resource, $actualValue); $actualValue = $actualRequestObject->getPolicy(); $this->assertProtobufEquals($policy, $actualValue); @@ -834,11 +834,11 @@ public function setIamPolicyExceptionTest() $transport->addResponse(null, $status); // Mock request - $formattedResource = $client->instanceName('[PROJECT]', '[INSTANCE]'); + $resource = 'resource-341064690'; $policy = new Policy(); try { - $client->setIamPolicy($formattedResource, $policy); + $client->setIamPolicy($resource, $policy); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -870,9 +870,9 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request - $formattedResource = $client->instanceName('[PROJECT]', '[INSTANCE]'); + $resource = 'resource-341064690'; - $response = $client->getIamPolicy($formattedResource); + $response = $client->getIamPolicy($resource); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -882,7 +882,7 @@ public function getIamPolicyTest() $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($formattedResource, $actualValue); + $this->assertProtobufEquals($resource, $actualValue); $this->assertTrue($transport->isExhausted()); } @@ -910,10 +910,10 @@ public function getIamPolicyExceptionTest() $transport->addResponse(null, $status); // Mock request - $formattedResource = $client->instanceName('[PROJECT]', '[INSTANCE]'); + $resource = 'resource-341064690'; try { - $client->getIamPolicy($formattedResource); + $client->getIamPolicy($resource); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -941,10 +941,10 @@ public function testIamPermissionsTest() $transport->addResponse($expectedResponse); // Mock request - $formattedResource = $client->instanceName('[PROJECT]', '[INSTANCE]'); + $resource = 'resource-341064690'; $permissions = []; - $response = $client->testIamPermissions($formattedResource, $permissions); + $response = $client->testIamPermissions($resource, $permissions); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -954,7 +954,7 @@ public function testIamPermissionsTest() $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($formattedResource, $actualValue); + $this->assertProtobufEquals($resource, $actualValue); $actualValue = $actualRequestObject->getPermissions(); $this->assertProtobufEquals($permissions, $actualValue); @@ -985,11 +985,11 @@ public function testIamPermissionsExceptionTest() $transport->addResponse(null, $status); // Mock request - $formattedResource = $client->instanceName('[PROJECT]', '[INSTANCE]'); + $resource = 'resource-341064690'; $permissions = []; try { - $client->testIamPermissions($formattedResource, $permissions); + $client->testIamPermissions($resource, $permissions); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { diff --git a/Spanner/tests/Unit/V1/SpannerClientTest.php b/Spanner/tests/Unit/V1/SpannerClientTest.php index 9ca8ba83b3b0..7b15cd4046f9 100644 --- a/Spanner/tests/Unit/V1/SpannerClientTest.php +++ b/Spanner/tests/Unit/V1/SpannerClientTest.php @@ -1014,9 +1014,8 @@ public function commitTest() // Mock request $formattedSession = $client->sessionName('[PROJECT]', '[INSTANCE]', '[DATABASE]', '[SESSION]'); - $mutations = []; - $response = $client->commit($formattedSession, $mutations); + $response = $client->commit($formattedSession); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -1027,9 +1026,6 @@ public function commitTest() $actualValue = $actualRequestObject->getSession(); $this->assertProtobufEquals($formattedSession, $actualValue); - $actualValue = $actualRequestObject->getMutations(); - - $this->assertProtobufEquals($mutations, $actualValue); $this->assertTrue($transport->isExhausted()); } @@ -1058,10 +1054,9 @@ public function commitExceptionTest() // Mock request $formattedSession = $client->sessionName('[PROJECT]', '[INSTANCE]', '[DATABASE]', '[SESSION]'); - $mutations = []; try { - $client->commit($formattedSession, $mutations); + $client->commit($formattedSession); // If the $client method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) {