accept method
Accepts a TermsOfService
.
Executing this method requires admin access.
Request parameters:
name
- Required. The resource name of the terms of service version.
Format: termsOfService/{version}
Value must have pattern ^termsOfService/\[^/\]+$
.
account
- Required. The account for which to accept the ToS. Format:
accounts/{account}
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 AcceptTermsOfServiceResponse.
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<AcceptTermsOfServiceResponse> accept(
core.String name, {
core.String? account,
core.String? regionCode,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (account != null) 'account': [account],
if (regionCode != null) 'regionCode': [regionCode],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'accounts/v1/' + core.Uri.encodeFull('$name') + ':accept';
final response_ = await _requester.request(
url_,
'POST',
queryParams: queryParams_,
);
return AcceptTermsOfServiceResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}