Skip to content

Commit

Permalink
chore: fix phpdoc in postprocessing (#5053)
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer authored Jan 28, 2022
1 parent ab44e61 commit bd90834
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions VideoIntelligence/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,26 @@
r"\1](https://cloud.google.com\2)"
)

# fix phpdoc examples for optional-to-required parameters
f = open("src/V1/Gapic/VideoIntelligenceServiceGapicClient.php", "r")
if ' * $operationResponse = $videoIntelligenceServiceClient->annotateVideo();' in f.read():
s.replace(
"src/V1/Gapic/VideoIntelligenceServiceGapicClient.php",
r"^ \* \$operationResponse = \$videoIntelligenceServiceClient->annotateVideo\(\);$",
r""" * $inputUri = 'gs://cloud-samples-data/video/cat.mp4';
* $featuresElement = Feature::LABEL_DETECTION;
* $features = [$featuresElement];
* $operationResponse = $videoIntelligenceServiceClient->annotateVideo(['inputUri' => $inputUri, 'features' => $features]);"""
)
s.replace(
"src/V1/Gapic/VideoIntelligenceServiceGapicClient.php",
r"^ \* \$operationResponse = \$videoIntelligenceServiceClient->annotateVideo\(\);$",
r""" * $inputUri = 'gs://cloud-samples-data/video/cat.mp4';
* $featuresElement = Feature::LABEL_DETECTION;
* $features = [$featuresElement];
* $operationResponse = $videoIntelligenceServiceClient->annotateVideo(['inputUri' => $inputUri, 'features' => $features]);"""
)

# format generated clients
subprocess.run([
'npm',
Expand Down

0 comments on commit bd90834

Please sign in to comment.