GetProjectIDQueryHistoryID returns the project ID and query history ID from a resource name.
(name string)
| 106 | |
| 107 | // GetProjectIDQueryHistoryID returns the project ID and query history ID from a resource name. |
| 108 | func GetProjectIDQueryHistoryID(name string) (string, string, error) { |
| 109 | tokens, err := GetNameParentTokens(name, ProjectNamePrefix, QueryHistoryNamePrefix) |
| 110 | if err != nil { |
| 111 | return "", "", err |
| 112 | } |
| 113 | return tokens[0], tokens[1], nil |
| 114 | } |
| 115 | |
| 116 | // FormatAccessGrant returns the resource name for an access grant. |
| 117 | func FormatAccessGrant(projectID string, id string) string { |