Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing KMS resource name method in post-processing #5043

Merged
merged 5 commits into from
Jan 25, 2022
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Kms/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,34 @@
r"(.{0,})\]\((/.{0,})\)",
r"\1](https://cloud.google.com\2)"
)

# fix backwards-compatibility issues due to removed resource name helpers
f = open("src/V1/Gapic/KeyManagementServiceGapicClient.php", "r")
if "public static function cryptoKeyPathName" not in f.read():
s.replace(
"src/V1/Gapic/KeyManagementServiceGapicClient.php",
r"^}$",
r"""
/**
* Formats a string containing the fully-qualified path to represent
* a crypto_key_path resource.
*
* @param string $project
* @param string $location
* @param string $keyRing
* @param string $cryptoKeyPath
*
* @return string The formatted crypto_key_path resource.
* @deprecated Use cryptoKeyName instead
*/
public static function cryptoKeyPathName($project, $location, $keyRing, $cryptoKeyPath)
{
return self::getCryptoKeyPathNameTemplate()->render([
'project' => $project,
'location' => $location,
'key_ring' => $keyRing,
'crypto_key_path' => $cryptoKeyPath,
]);
}
}"""
)