get method

Future<Function_> get(
  1. String name, {
  2. String? revision,
  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/\[^/\]+$.

revision - Optional. The optional version of the 1st gen 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. GCF may keep historical configs for old versions of 1st gen function. This field can be specified to fetch the historical configs. This field is valid only for GCF 1st gen function.

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

Completes with a Function_.

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<Function_> get(
  core.String name, {
  core.String? revision,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (revision != null) 'revision': [revision],
    if ($fields != null) 'fields': [$fields],
  };

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

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