ADK for TypeScript: API Reference
    Preparing search index...

    Class APIHubClient

    Client for the API Hub REST API.

    Each request sends a bearer token. The token is accessToken when it is set; otherwise the client mints one from serviceAccountJson, or from application default credentials when that is not set either. Minted tokens are cached and refreshed by google-auth-library.

    Implements

    • Returns the content of the first spec that path resolves to.

      • A path naming an API resolves to the first spec of its first version.
      • A path naming an API version resolves to the first spec of that version.
      • A path naming an API spec resolves to that spec.

      path may be a resource name such as projects/my-project/locations/us-central1/apis/my-api, or a console URL such as https://console.cloud.google.com/apigee/api-hub/locations/us-central1/apis/my-api?project=my-project.

      Parameters

      • path: string

        The API, API version or API spec to read.

      Returns Promise<string>

      The decoded spec content, or '' when the spec is empty.

      When the path cannot be parsed, when the API has no versions, when the version has no specs, or when a request fails.

    • Lists the APIs registered in a project and location.

      Parameters

      • project: string

        The Google Cloud project ID.

      • location: string

        The API Hub location, for example us-central1.

      Returns Promise<APIHubApi[]>

      The APIs, or an empty array when there are none.