Index

src/bundlingCalls/bundlingUtils.ts

computeBundleId
computeBundleId(obj, discriminatorFields)

Compute the identifier of the obj. The objects of the same ID will be bundled together.

Parameters :
Name Optional Description
obj No
  • The request object.
discriminatorFields No
  • The array of field names. A field name may include '.' as a separator, which is used to indicate object traversal.

src/gax.ts

constructSettings
constructSettings(serviceName, clientConfig, configOverrides, retryNames, otherArgs?, promise?)

Constructs a dictionary mapping method names to CallSettings.

The clientConfig parameter is parsed from a client configuration JSON file of the form:

 {
   "interfaces": {
     "google.fake.v1.ServiceName": {
       "retry_codes": {
         "idempotent": ["UNAVAILABLE", "DEADLINE_EXCEEDED"],
         "non_idempotent": []
       },
       "retry_params": {
         "default": {
           "initial_retry_delay_millis": 100,
           "retry_delay_multiplier": 1.2,
           "max_retry_delay_millis": 1000,
           "initial_rpc_timeout_millis": 2000,
           "rpc_timeout_multiplier": 1.5,
           "max_rpc_timeout_millis": 30000,
           "total_timeout_millis": 45000
         }
       },
       "methods": {
         "CreateFoo": {
           "retry_codes_name": "idempotent",
           "retry_params_name": "default"
         },
         "Publish": {
           "retry_codes_name": "non_idempotent",
           "retry_params_name": "default",
           "bundling": {
             "element_count_threshold": 40,
             "element_count_limit": 200,
             "request_byte_threshold": 90000,
             "request_byte_limit": 100000,
             "delay_threshold_millis": 100
           }
         }
       }
     }
   }
 }
Parameters :
Name Optional Description
serviceName No
  • The fully-qualified name of this service, used as a key into the client config file (in the example above, this value should be 'google.fake.v1.ServiceName').
clientConfig No
  • A dictionary parsed from the standard API client config file.
configOverrides No
  • A dictionary in the same structure of client_config to override the settings.
retryNames No
  • A dictionary mapping the strings referring to response status codes to objects representing those codes.
otherArgs Yes
  • the non-request arguments to be passed to the API calls.
promise Yes
  • A constructor for a promise that implements the ES6 specification of promise. If not provided, native promises will be used.
createBackoffSettings
createBackoffSettings(initialRetryDelayMillis, retryDelayMultiplier, maxRetryDelayMillis, initialRpcTimeoutMillis, rpcTimeoutMultiplier, maxRpcTimeoutMillis, totalTimeoutMillis)

Parameters to the exponential backoff algorithm for retrying.

Parameters :
Name Optional Description
initialRetryDelayMillis No
  • the initial delay time, in milliseconds, between the completion of the first failed request and the initiation of the first retrying request.
retryDelayMultiplier No
  • the multiplier by which to increase the delay time between the completion of failed requests, and the initiation of the subsequent retrying request.
maxRetryDelayMillis No
  • the maximum delay time, in milliseconds, between requests. When this value is reached, retryDelayMultiplier will no longer be used to increase delay time.
initialRpcTimeoutMillis No
  • the initial timeout parameter to the request.
rpcTimeoutMultiplier No
  • the multiplier by which to increase the timeout parameter between failed requests.
maxRpcTimeoutMillis No
  • the maximum timeout parameter, in milliseconds, for a request. When this value is reached, rpcTimeoutMultiplier will no longer be used to increase the timeout.
totalTimeoutMillis No
  • the total time, in milliseconds, starting from when the initial request is sent, after which an error will be returned, regardless of the retrying attempts made meanwhile.
Returns : BackoffSettings

a new settings.

createDefaultBackoffSettings
createDefaultBackoffSettings()
createMaxRetriesBackoffSettings
createMaxRetriesBackoffSettings(initialRetryDelayMillis, retryDelayMultiplier, maxRetryDelayMillis, initialRpcTimeoutMillis, rpcTimeoutMultiplier, maxRpcTimeoutMillis, maxRetries)

Parameters to the exponential backoff algorithm for retrying. This function is unsupported, and intended for internal use only.

Parameters :
Name Optional Description
initialRetryDelayMillis No
  • the initial delay time, in milliseconds, between the completion of the first failed request and the initiation of the first retrying request.
retryDelayMultiplier No
  • the multiplier by which to increase the delay time between the completion of failed requests, and the initiation of the subsequent retrying request.
maxRetryDelayMillis No
  • the maximum delay time, in milliseconds, between requests. When this value is reached, retryDelayMultiplier will no longer be used to increase delay time.
initialRpcTimeoutMillis No
  • the initial timeout parameter to the request.
rpcTimeoutMultiplier No
  • the multiplier by which to increase the timeout parameter between failed requests.
maxRpcTimeoutMillis No
  • the maximum timeout parameter, in milliseconds, for a request. When this value is reached, rpcTimeoutMultiplier will no longer be used to increase the timeout.
maxRetries No
  • the maximum number of retrying attempts that will be made. If reached, an error will be returned.
Returns : BackoffSettings

a new settings.

createRetryOptions
createRetryOptions(retryCodes, backoffSettings)

Per-call configurable settings for retrying upon transient failure.

Parameters :
Name Optional Description
retryCodes No
  • a list of Google API canonical error codes upon which a retry should be attempted.
backoffSettings No
  • configures the retry exponential backoff algorithm.
Returns : RetryOptions

A new RetryOptions object.

src/createApiCall.ts

createApiCall
createApiCall(func, settings, descriptor?)

Converts an rpc call into an API call governed by the settings.

In typical usage, func will be a promise to a callable used to make an rpc request. This will mostly likely be a bound method from a request stub used to make an rpc call. It is not a direct function but a Promise instance, because of its asynchronism (typically, obtaining the auth information).

The result is a function which manages the API call with the given settings and the options on the invocation.

Parameters :
Name Optional Description
func No
  • is either a promise to be used to make a bare RPC call, or just a bare RPC call.
settings No
  • provides the settings for this call
descriptor Yes
  • optionally specify the descriptor for the method call.
Returns : GaxCall

func - a bound method on a request stub used to make an rpc call.

src/apiCaller.ts

createAPICaller
createAPICaller(settings, descriptor)
Parameters :
Name Optional
settings No
descriptor No
Returns : APICaller

src/pathTemplate.ts

formatSegments
formatSegments(segments)

Creates the string representattion for the segments.

Parameters :
Name Optional Description
segments No
  • The array of segments.
Returns : string
  • A string representing segments in the path template format.

src/routingHeader.ts

fromParams
fromParams(params)

Helpers for constructing routing headers.

These headers are used by Google infrastructure to determine how to route requests, especially for services that are regional.

Generally, these headers are specified as gRPC metadata.

Parameters :
Name Optional
params No
Returns : string

src/isbrowser.ts

isBrowser
isBrowser()
Returns : boolean

src/index.ts

lro
lro(options)
Parameters :
Name Optional
options No

src/bundlingCalls/bundleExecutor.ts

noop
noop()

src/longRunningCalls/longrunning.ts

operation
operation(op, longrunningDescriptor, backoffSettings, callOptions?)

Method used to create Operation objects.

Parameters :
Name Optional Description
op No
  • The operation to be wrapped.
longrunningDescriptor No
  • This defines the operations service client and unpacking mechanisms for the operation.
backoffSettings No
  • The backoff settings used in in polling the operation.
callOptions Yes
  • CallOptions used in making get operation requests.

src/warnings.ts

warn
warn(code, message)
Parameters :
Name Optional
code No
message No

result-matching ""

    No results matching ""