Skip to content

Commit

Permalink
chore!: migrate AnalyticsAdmin to new surface (#7940)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer authored Jan 6, 2025
1 parent c7a9102 commit fb1bd09
Show file tree
Hide file tree
Showing 509 changed files with 4,031 additions and 38,124 deletions.
2 changes: 1 addition & 1 deletion AnalyticsAdmin/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
deep-copy-regex:
- source: /google/analytics/admin/(v1alpha|v1beta)/.*-php/(.*)
- source: /google/analytics/admin/(v1beta|v1alpha)/.*-php/(.*)
dest: /owl-bot-staging/AnalyticsAdmin/$1/$2
api-name: AnalyticsAdmin
62 changes: 23 additions & 39 deletions AnalyticsAdmin/owlbot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,43 +30,27 @@
# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(
src=src,
dest=dest,
copy_excludes=[
src / "**/V1beta/[A-Z]*_*.php",
src / "**/V1beta/*GrpcClient.php",
]
)
php.owlbot_main(src=src, dest=dest)

# Change the wording for the deprecation warning.
# remove class_alias code
s.replace(
'src/*/*_*.php',
r'will be removed in the next major release',
'will be removed in a future release')

### [START] protoc backwards compatibility fixes

# roll back to private properties.
s.replace(
"src/**/V*/**/*.php",
r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$",
r"""Generated from protobuf field \1
*/
private $""")

# Replace "Unwrapped" with "Value" for method names.
s.replace(
"src/**/V*/**/*.php",
r"public function ([s|g]\w{3,})Unwrapped",
r"public function \1Value"
)

### [END] protoc backwards compatibility fixes

# fix relative cloud.google.com links
s.replace(
"src/**/V*/**/*.php",
r"(.{0,})\]\((/.{0,})\)",
r"\1](https://cloud.google.com\2)"
)
"src/V*/**/*.php",
r"^// Adding a class alias for backwards compatibility with the previous class name.$"
+ "\n"
+ r"^class_alias\(.*\);$"
+ "\n",
'')

# format generated clients
subprocess.run([
'npm',
'exec',
'--yes',
'--package=@prettier/plugin-php@^0.16',
'--',
'prettier',
'**/Client/*',
'--write',
'--parser=php',
'--single-quote',
'--print-width=120'])
4 changes: 2 additions & 2 deletions AnalyticsAdmin/src/V1alpha/AccessBetweenFilter.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AnalyticsAdmin/src/V1alpha/AccessBinding.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions AnalyticsAdmin/src/V1alpha/AccessDateRange.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AnalyticsAdmin/src/V1alpha/AccessDimension.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AnalyticsAdmin/src/V1alpha/AccessDimensionHeader.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AnalyticsAdmin/src/V1alpha/AccessDimensionValue.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AnalyticsAdmin/src/V1alpha/AccessFilter.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AnalyticsAdmin/src/V1alpha/AccessInListFilter.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AnalyticsAdmin/src/V1alpha/AccessMetric.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AnalyticsAdmin/src/V1alpha/AccessMetricHeader.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AnalyticsAdmin/src/V1alpha/AccessMetricValue.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions AnalyticsAdmin/src/V1alpha/AccessNumericFilter.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions AnalyticsAdmin/src/V1alpha/AccessNumericFilter/Operation.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions AnalyticsAdmin/src/V1alpha/AccessNumericFilter_Operation.php

This file was deleted.

2 changes: 1 addition & 1 deletion AnalyticsAdmin/src/V1alpha/AccessOrderBy.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions AnalyticsAdmin/src/V1alpha/AccessOrderBy/DimensionOrderBy.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions AnalyticsAdmin/src/V1alpha/AccessOrderBy/MetricOrderBy.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions AnalyticsAdmin/src/V1alpha/AccessOrderBy_DimensionOrderBy.php

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions AnalyticsAdmin/src/V1alpha/AccessOrderBy_MetricOrderBy.php

This file was deleted.

10 changes: 5 additions & 5 deletions AnalyticsAdmin/src/V1alpha/AccessQuota.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions AnalyticsAdmin/src/V1alpha/AccessQuotaStatus.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fb1bd09

Please sign in to comment.