Skip to content

Commit 115f604

Browse files
committed
update Datastore GAPIC V2
1 parent 9b1f5a2 commit 115f604

78 files changed

Lines changed: 254 additions & 2380 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Datastore/owlbot.py

Lines changed: 19 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Google LLC
1+
# Copyright 2024 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -30,65 +30,27 @@
3030
# Added so that we can pass copy_excludes in the owlbot_main() call
3131
_tracked_paths.add(src)
3232

33-
php.owlbot_main(
34-
src=src,
35-
dest=dest,
36-
copy_excludes=[
37-
src / "*/proto/src/Google/Cloud/Datastore/V1/TransactionOptions/ReadOnly.php"
38-
]
39-
)
33+
php.owlbot_main(src=src, dest=dest)
4034

41-
42-
# Fix class references in gapic samples
43-
for version in ['V1']:
44-
pathExpr = 'src/' + version + '/Gapic/DatastoreGapicClient.php'
45-
46-
types = {
47-
'= new DatastoreClient': r'= new Google\\Cloud\\Datastore\\' + version + r'\\DatastoreClient',
48-
'= Mode::': r'= Google\\Cloud\\Datastore\\' + version + r'\\CommitRequest\\Mode::',
49-
'new PartitionId': r'new Google\\Cloud\\Datastore\\' + version + r'\\PartitionId',
50-
}
51-
52-
for search, replace in types.items():
53-
s.replace(
54-
pathExpr,
55-
search,
56-
replace)
57-
58-
# remove ReadOnly class_alias code
35+
# remove class_alias code
5936
s.replace(
60-
"src/V*/**/PBReadOnly.php",
61-
r"^// Adding a class alias for backwards compatibility with the \"readonly\" keyword.$"
37+
"src/V*/**/*.php",
38+
r"^// Adding a class alias for backwards compatibility with the previous class name.$"
6239
+ "\n"
63-
+ r"^class_alias\(PBReadOnly::class, __NAMESPACE__ . '\\ReadOnly'\);$"
40+
+ r"^class_alias\(.*\);$"
6441
+ "\n",
6542
'')
6643

67-
### [START] protoc backwards compatibility fixes
68-
69-
# roll back to private properties.
70-
s.replace(
71-
"src/**/V*/**/*.php",
72-
r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$",
73-
r"""Generated from protobuf field \1
74-
*/
75-
private $""")
76-
77-
# Replace "Unwrapped" with "Value" for method names.
78-
s.replace(
79-
"src/**/V*/**/*.php",
80-
r"public function ([s|g]\w{3,})Unwrapped",
81-
r"public function \1Value"
82-
)
83-
84-
### [END] protoc backwards compatibility fixes
85-
86-
# fix relative cloud.google.com links
87-
s.replace(
88-
"src/**/V*/**/*.php",
89-
r"(.{0,})\]\((/.{0,})\)",
90-
r"\1](https://cloud.google.com\2)"
91-
)
92-
93-
# Address breaking changes
94-
subprocess.run('git show 8ada2c97c72ffabf5c3031021378874f8caa8804 | git apply', shell=True)
44+
# format generated clients
45+
subprocess.run([
46+
'npm',
47+
'exec',
48+
'--yes',
49+
'--package=@prettier/plugin-php@^0.19',
50+
'--',
51+
'prettier',
52+
'**/Client/*',
53+
'--write',
54+
'--parser=php',
55+
'--single-quote',
56+
'--print-width=120'])

Datastore/src/V1/AggregationQuery/Aggregation.php

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Datastore/src/V1/AggregationQuery/Aggregation/Avg.php

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Datastore/src/V1/AggregationQuery/Aggregation/Count.php

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Datastore/src/V1/AggregationQuery/Aggregation/Sum.php

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Datastore/src/V1/AggregationQuery_Aggregation.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

Datastore/src/V1/AggregationQuery_Aggregation_Count.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

Datastore/src/V1/AggregationResultBatch.php

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Datastore/src/V1/AllocateIdsRequest.php

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Datastore/src/V1/BeginTransactionRequest.php

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)