retrieveLatest method

Future<TermsOfService> retrieveLatest({
  1. String? kind,
  2. String? regionCode,
  3. String? $fields,
})

Retrieves the latest version of the TermsOfService for a given kind and region_code.

Request parameters:

kind - Required. The Kind this terms of service version applies to. Possible string values are:

  • "TERMS_OF_SERVICE_KIND_UNSPECIFIED" : Default value. This value is unused.
  • "MERCHANT_CENTER" : Merchant Center application.

regionCode - Required. Region code as defined by CLDR. This is either a country when the ToS applies specifically to that country or 001 when it applies globally.

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

Completes with a TermsOfService.

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

  const url_ = 'accounts/v1/termsOfService:retrieveLatest';

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