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

PathTemplate support #59

Closed
alexander-fenster opened this issue Oct 17, 2019 · 0 comments · Fixed by #71
Closed

PathTemplate support #59

alexander-fenster opened this issue Oct 17, 2019 · 0 comments · Fixed by #71
Assignees
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Milestone

Comments

@alexander-fenster
Copy link
Contributor

alexander-fenster commented Oct 17, 2019

    // This API contains "path templates"; forward-slash-separated
    // identifiers to uniquely identify resources within the API.
    // Create useful helper objects for these.
    this._pathTemplates = {
      locationPathTemplate: new gaxModule.PathTemplate(
        'projects/{project}/locations/{location}'
      ),
    };
  /**
   * Return a fully-qualified location resource name string.
   *
   * @param {String} project
   * @param {String} location
   * @returns {String}
   */
  locationPath(project, location) {
    return this._pathTemplates.locationPathTemplate.render({
      project: project,
      location: location,
    });
  }
  /**
   * Parse the glossaryName from a glossary resource.
   *
   * @param {String} glossaryName
   *   A fully-qualified path representing a glossary resources.
   * @returns {String} - A string representing the location.
   */
  matchLocationFromGlossaryName(glossaryName) {
    return this._pathTemplates.glossaryPathTemplate.match(glossaryName)
      .location;
  }
@alexander-fenster alexander-fenster added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Oct 17, 2019
@alexander-fenster alexander-fenster added this to the Beta milestone Oct 17, 2019
@alexander-fenster alexander-fenster self-assigned this Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant