Module client

Index

Classes

Functions

Functions

load(name: string, version: string, callback?: () => any)

Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method.

Parameters

  • name: string

    The name of the API to load.

  • version: string

    The version of the API to load

  • callback?: () => any optional

    the function that is called once the API interface is loaded

request(args: { path: string; method?: string; params?: any; headers?: any; body?: any; callback?: () => any; }): HttpRequest

Creates a HTTP request for making RESTful requests. An object encapsulating the various arguments for this method.

Parameters

  • args: { path: string; method?: string; params?: any; headers?: any; body?: any; callback?: () => any; }

Returns

HttpRequest

rpcRequest(method: string, version?: string, rpcParams?: any): RpcRequest

Creates an RPC Request directly. The method name and version identify the method to be executed and the RPC params are provided upon RPC creation.

Parameters

  • method: string

    The method to be executed.

  • version?: string optional

    The version of the API which defines the method to be executed. Defaults to v1

  • rpcParams?: any optional

    A key-value pair of the params to supply to this RPC

Returns

RpcRequest

setApiKey(apiKey: string)

Sets the API key for the application.

Parameters

  • apiKey: string

    The API key to set