fetchIncentive method
Returns incentives for a given user.
Request parameters:
countryCode - Optional. User's country code. If not provided, the server
will default to "US". Possible country codes:
https://developers.google.com/google-ads/api/data/codes-formats#country_codes
email - Optional. Email of the user that the requested incentive is
meant for. Will be used for channel partners who do NOT use OAuth to
authenticate on behalf of user.
languageCode - Optional. User's language code. If not provided, the
server will default to "en". Possible language codes:
https://developers.google.com/google-ads/api/data/codes-formats#languages
type - Optional. The type of incentive to get. Defaults to ACQUISITION.
Possible string values are:
- "UNSPECIFIED" : Not specified.
- "UNKNOWN" : Unknown incentive type. Should not be used as a value explicitly.
- "ACQUISITION" : An acquisition incentive.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a GoogleAdsSearchads360V23ServicesFetchIncentiveResponse.
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<GoogleAdsSearchads360V23ServicesFetchIncentiveResponse>
fetchIncentive({
core.String? countryCode,
core.String? email,
core.String? languageCode,
core.String? type,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'countryCode': ?countryCode == null ? null : [countryCode],
'email': ?email == null ? null : [email],
'languageCode': ?languageCode == null ? null : [languageCode],
'type': ?type == null ? null : [type],
'fields': ?$fields == null ? null : [$fields],
};
const url_ = 'v23/incentives:fetchIncentive';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return GoogleAdsSearchads360V23ServicesFetchIncentiveResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}