registerGcp method

Future<DeveloperRegistration> registerGcp(
  1. RegisterGcpRequest request,
  2. String name, {
  3. String? $fields,
})

Registers the GCP used for the API call to the shopping account passed in the request.

Will create a user with an "API developer" and add the "developer_email" as a contact with "API notifications" email preference on.

request - The metadata request object.

Request parameters:

name - Required. The name of the developer registration to be created for the merchant account that the GCP will be registered with. Format: accounts/{account}/developerRegistration Value must have pattern ^accounts/\[^/\]+/developerRegistration$.

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

Completes with a DeveloperRegistration.

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<DeveloperRegistration> registerGcp(
  RegisterGcpRequest request,
  core.String name, {
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

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

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