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?)

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.
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/fallback.ts

createApiCall
createApiCall(func, settings, descriptor?)

gRPC-fallback version of createApiCall

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.

Throws exception on unsupported streaming calls

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.

lro
lro(options)

gRPC-fallback version of lro

Parameters :
Name Optional
options No

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/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()

Copyright 2020 Google LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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/pathTemplate.ts

splitPathTemplate
splitPathTemplate(data)

Split the path template by /. It can not be simply splitted by / because there might be / in the segments. For example: 'a/b/{a=hello/world}' we do not want to break the brackets pair so above path will be splitted as ['a', 'b', '{a=hello/world}']

Parameters :
Name Optional
data No
Returns : string[]

src/warnings.ts

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

result-matching ""

    No results matching ""