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

chore: fix scheduler breaking change #2659

Merged
merged 1 commit into from
Jan 31, 2020
Merged
Changes from all 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
51 changes: 51 additions & 0 deletions Scheduler/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,57 @@
r'will be removed in the next major release',
'will be removed in a future release')

# Fix missing formatting method
s.replace(
'src/V1/Gapic/CloudSchedulerGapicClient.php',
r"private static \$jobNameTemplate;\n\s{4}private static \$locationNameTemplate;",
"""private static $jobNameTemplate;
private static $locationNameTemplate;
private static $projectNameTemplate;"""
)
s.replace(
'src/V1/Gapic/CloudSchedulerGapicClient.php',
"private static function getPathTemplateMap",
"""private static function getProjectNameTemplate()
{
if (null == self::$projectNameTemplate) {
self::$projectNameTemplate = new PathTemplate('projects/{project}');
}

return self::$projectNameTemplate;
}

private static function getPathTemplateMap"""
)
s.replace(
'src/V1/Gapic/CloudSchedulerGapicClient.php',
r"'job' => self::getJobNameTemplate\(\),\n\s{0,}'location' => self::getLocationNameTemplate\(\),",
"""'job' => self::getJobNameTemplate(),
'location' => self::getLocationNameTemplate(),
'project' => self::getProjectNameTemplate(),"""
)
s.replace(
'src/V1/Gapic/CloudSchedulerGapicClient.php',
r"\/\*\*\n\s{5}\* Parses a formatted name string and returns an",
"""/**
* Formats a string containing the fully-qualified path to represent
* a project resource.
*
* @param string $project
*
* @return string The formatted project resource.
*/
public static function projectName($project)
{
return self::getProjectNameTemplate()->render([
'project' => $project,
]);
}

/**
* Parses a formatted name string and returns an"""
)

### [START] protoc backwards compatibility fixes

# roll back to private properties.
Expand Down