get method

Future<CloudFunction> get(
  1. String name, {
  2. String? versionId,
  3. String? $fields,
})

Returns a function with the given name from the requested project.

Request parameters:

name - Required. The name of the function which details should be obtained. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/functions/\[^/\]+$.

versionId - Optional. The optional version of the function whose details should be obtained. The version of a 1st Gen function is an integer that starts from 1 and gets incremented on redeployments. Each deployment creates a config version of the underlying function. GCF may keep historical configs for old versions. This field can be specified to fetch the historical configs. Leave it blank or set to 0 to get the latest version of the function.

$fields - Selector specifying which fields to include in a partial response.

Completes with a CloudFunction.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<CloudFunction> get(
  core.String name, {
  core.String? versionId,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (versionId != null) 'versionId': [versionId],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$name');

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return CloudFunction.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}