GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • ADK for TypeScript: API Reference

This view

  • Original page
  • New address

GeezerVison is showing adk.dev — APIHubClient | ADK for TypeScript: API Reference - v2.5.0

  • APIHubClient

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

  • BaseAPIHubClient
  • Defined in core/src/tools/apihub_tool/clients/apihub_client.ts:85

Constructors

constructor

  • new APIHubClient(options?: APIHubClientOptions): APIHubClient

    Parameters

    • options: APIHubClientOptions = {}

    Returns APIHubClient

    • Defined in core/src/tools/apihub_tool/clients/apihub_client.ts:90

Methods

getApi

  • getApi(apiResourceName: string): Promise<APIHubApi>

    Gets an API by resource name.

    Parameters

    • apiResourceName: string

      projects/{p}/locations/{l}/apis/{a}.

    Returns Promise<APIHubApi>

    • Defined in core/src/tools/apihub_tool/clients/apihub_client.ts:168

getApiVersion

  • getApiVersion(apiVersionName: string): Promise<APIHubApiVersion>

    Gets an API version by resource name.

    Parameters

    • apiVersionName: string

      projects/{p}/locations/{l}/apis/{a}/versions/{v}.

    Returns Promise<APIHubApiVersion>

    • Defined in core/src/tools/apihub_tool/clients/apihub_client.ts:177

getSpecContent

  • getSpecContent(path: string): Promise<string>

    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.

    Throws

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

    Implementation of BaseAPIHubClient.getSpecContent

    • Defined in core/src/tools/apihub_tool/clients/apihub_client.ts:115

listApis

  • listApis(project: string, location: string): Promise<APIHubApi[]>

    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.

    • Defined in core/src/tools/apihub_tool/clients/apihub_client.ts:156
Constructors
constructor
Methods
getApigetApiVersiongetSpecContentlistApis
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.