GetProjectIDPlanIDFromPlanCheckRun returns the project ID and plan ID from a plan check run singleton resource name. Format: projects/{project}/plans/{plan}/planCheckRun
(name string)
| 261 | // GetProjectIDPlanIDFromPlanCheckRun returns the project ID and plan ID from a plan check run singleton resource name. |
| 262 | // Format: projects/{project}/plans/{plan}/planCheckRun |
| 263 | func GetProjectIDPlanIDFromPlanCheckRun(name string) (string, int64, error) { |
| 264 | // Remove the trailing "/planCheckRun" suffix |
| 265 | if !strings.HasSuffix(name, "/planCheckRun") { |
| 266 | return "", 0, errors.Errorf("invalid plan check run name %q, expected suffix /planCheckRun", name) |
| 267 | } |
| 268 | planName := strings.TrimSuffix(name, "/planCheckRun") |
| 269 | projectID, planID, err := GetProjectIDPlanID(planName) |
| 270 | if err != nil { |
| 271 | return "", 0, err |
| 272 | } |
| 273 | return projectID, planID, nil |
| 274 | } |
| 275 | |
| 276 | // GetProjectIDPlanIDFromRolloutName returns the project ID and plan ID from a resource name. |
| 277 | func GetProjectIDPlanIDFromRolloutName(name string) (string, int64, error) { |
no test coverage detected