get method

Future<GetTemplateResponse> get(
  1. String projectId, {
  2. String? gcsPath,
  3. String? location,
  4. String? view,
  5. String? $fields,
})

Get the template associated with a template.

Request parameters:

projectId - Required. The ID of the Cloud Platform project that the job belongs to.

gcsPath - Required. A Cloud Storage path to the template from which to create the job. Must be valid Cloud Storage URL, beginning with 'gs://'.

location - The regional endpoint to which to direct the request.

view - The view to retrieve. Defaults to METADATA_ONLY. Possible string values are:

  • "METADATA_ONLY" : Template view that retrieves only the metadata associated with the template.

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

Completes with a GetTemplateResponse.

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<GetTemplateResponse> get(
  core.String projectId, {
  core.String? gcsPath,
  core.String? location,
  core.String? view,
  core.String? $fields,
}) async {
  final _queryParams = <core.String, core.List<core.String>>{
    if (gcsPath != null) 'gcsPath': [gcsPath],
    if (location != null) 'location': [location],
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  final _url = 'v1b3/projects/' +
      commons.escapeVariable('$projectId') +
      '/templates:get';

  final _response = await _requester.request(
    _url,
    'GET',
    queryParams: _queryParams,
  );
  return GetTemplateResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);
}