blob: 99c67c876727a20f5c066ba1ec089a161a81423b [file] [log] [blame]
Gustav Wibling042e6462015-04-10 13:40:06 +02001// This is a generated file (see the discoveryapis_generator project).
2
Kevin Moore6d21e902021-01-15 06:41:08 -08003// ignore_for_file: camel_case_types
4// ignore_for_file: comment_references
Kevin Moore1ad61ef2021-01-22 17:52:58 -08005// ignore_for_file: file_names
Kevin Moore6d21e902021-01-15 06:41:08 -08006// ignore_for_file: library_names
7// ignore_for_file: lines_longer_than_80_chars
8// ignore_for_file: non_constant_identifier_names
Kevin Moore1ad61ef2021-01-22 17:52:58 -08009// ignore_for_file: prefer_expression_function_bodies
Kevin Moore6d21e902021-01-15 06:41:08 -080010// ignore_for_file: prefer_interpolation_to_compose_strings
Kevin Moore6d21e902021-01-15 06:41:08 -080011// ignore_for_file: unnecessary_brace_in_string_interps
12// ignore_for_file: unnecessary_cast
Kevin Moore1ad61ef2021-01-22 17:52:58 -080013// ignore_for_file: unnecessary_lambdas
Kevin Moore6d21e902021-01-15 06:41:08 -080014// ignore_for_file: unnecessary_string_interpolations
Jakob Andersenc21146a2018-05-25 09:46:20 +020015
Kevin Moore3fda8342021-01-28 09:39:59 -080016/// Google Play Game Services Publishing API - v1configuration
17///
18/// The Google Play Game Services Publishing API allows developers to configure
19/// their games in Game Services.
20///
21/// For more information, see <https://developers.google.com/games/>
Kevin Moored33cc812021-01-28 14:21:17 -080022///
23/// Create an instance of [GamesConfigurationApi] to access these resources:
24///
Kevin Moore88512712021-01-28 14:43:28 -080025/// - [AchievementConfigurationsResource]
26/// - [ImageConfigurationsResource]
27/// - [LeaderboardConfigurationsResource]
Kevin Moore6f98bc22021-01-28 11:22:28 -080028library gamesConfiguration.v1configuration;
Gustav Wibling1152ab62015-02-05 13:00:55 +010029
Gustav Wibling042e6462015-04-10 13:40:06 +020030import 'dart:async' as async;
31import 'dart:convert' as convert;
Kevin Moore8b4beef2021-01-27 20:42:25 -080032import 'dart:core' as core;
Gustav Wibling1152ab62015-02-05 13:00:55 +010033
Gustav Wibling042e6462015-04-10 13:40:06 +020034import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
Gustav Wibling1152ab62015-02-05 13:00:55 +010035import 'package:http/http.dart' as http;
Gustav Wibling1152ab62015-02-05 13:00:55 +010036
Kevin Moore8b4beef2021-01-27 20:42:25 -080037import '../src/user_agent.dart';
38
Martin Kustermann5eb85c12017-09-11 12:35:54 +020039export 'package:_discoveryapis_commons/_discoveryapis_commons.dart'
40 show
41 ApiRequestError,
42 DetailedApiRequestError,
43 Media,
44 UploadOptions,
45 ResumableUploadOptions,
46 DownloadOptions,
47 PartialDownloadOptions,
48 ByteRange;
Gustav Wibling042e6462015-04-10 13:40:06 +020049
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +020050/// The Google Play Game Services Publishing API allows developers to configure
51/// their games in Game Services.
Gustav Wibling1152ab62015-02-05 13:00:55 +010052class GamesConfigurationApi {
Martin Kustermann5eb85c12017-09-11 12:35:54 +020053 /// View and manage your Google Play Developer account
Kevin Moore298a64b2021-01-22 19:44:38 -080054 static const androidpublisherScope =
Kevin Moored0251702021-01-15 06:41:08 -080055 'https://www.googleapis.com/auth/androidpublisher';
Gustav Wibling1152ab62015-02-05 13:00:55 +010056
Gustav Wibling042e6462015-04-10 13:40:06 +020057 final commons.ApiRequester _requester;
Gustav Wibling1152ab62015-02-05 13:00:55 +010058
Kevin Moore88512712021-01-28 14:43:28 -080059 AchievementConfigurationsResource get achievementConfigurations =>
60 AchievementConfigurationsResource(_requester);
61 ImageConfigurationsResource get imageConfigurations =>
62 ImageConfigurationsResource(_requester);
63 LeaderboardConfigurationsResource get leaderboardConfigurations =>
64 LeaderboardConfigurationsResource(_requester);
Gustav Wibling1152ab62015-02-05 13:00:55 +010065
Martin Kustermann5eb85c12017-09-11 12:35:54 +020066 GamesConfigurationApi(http.Client client,
Kevin Moored0251702021-01-15 06:41:08 -080067 {core.String rootUrl = 'https://gamesconfiguration.googleapis.com/',
68 core.String servicePath = ''})
Martin Kustermann5eb85c12017-09-11 12:35:54 +020069 : _requester =
Kevin Moore298a64b2021-01-22 19:44:38 -080070 commons.ApiRequester(client, rootUrl, servicePath, userAgent);
Gustav Wibling1152ab62015-02-05 13:00:55 +010071}
72
Kevin Moore88512712021-01-28 14:43:28 -080073class AchievementConfigurationsResource {
Gustav Wibling042e6462015-04-10 13:40:06 +020074 final commons.ApiRequester _requester;
Gustav Wibling1152ab62015-02-05 13:00:55 +010075
Kevin Moore88512712021-01-28 14:43:28 -080076 AchievementConfigurationsResource(commons.ApiRequester client)
Martin Kustermann5eb85c12017-09-11 12:35:54 +020077 : _requester = client;
Gustav Wibling1152ab62015-02-05 13:00:55 +010078
Martin Kustermann5eb85c12017-09-11 12:35:54 +020079 /// Delete the achievement configuration with the given ID.
80 ///
81 /// Request parameters:
82 ///
83 /// [achievementId] - The ID of the achievement used by this method.
84 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +020085 /// [$fields] - Selector specifying which fields to include in a partial
86 /// response.
87 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +020088 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
89 /// error.
90 ///
91 /// If the used [http.Client] completes with an error when making a REST call,
92 /// this method will complete with the same error.
Kevin Mooredc994e82021-02-05 09:36:45 -080093 async.Future<void> delete(
Kevin Moore6d21e902021-01-15 06:41:08 -080094 core.String achievementId, {
Kevin Moore58e22332021-02-25 10:11:41 -080095 core.String? $fields,
Kevin Mooredc994e82021-02-05 09:36:45 -080096 }) async {
Kevin Moore6485d5a2021-02-08 14:56:40 -080097 final _queryParams = <core.String, core.List<core.String>>{
98 if ($fields != null) 'fields': [$fields],
99 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100100
Kevin Moore0c926a62021-02-05 11:30:57 -0800101 final _url = 'games/v1configuration/achievements/' +
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200102 commons.Escaper.ecapeVariable('$achievementId');
Gustav Wibling1152ab62015-02-05 13:00:55 +0100103
Kevin Mooredc994e82021-02-05 09:36:45 -0800104 await _requester.request(
Kevin Moore6d21e902021-01-15 06:41:08 -0800105 _url,
Kevin Moored0251702021-01-15 06:41:08 -0800106 'DELETE',
Kevin Moore6d21e902021-01-15 06:41:08 -0800107 queryParams: _queryParams,
Kevin Moorec007ffb2021-02-05 10:06:35 -0800108 downloadOptions: null,
Kevin Moore6d21e902021-01-15 06:41:08 -0800109 );
Gustav Wibling1152ab62015-02-05 13:00:55 +0100110 }
111
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200112 /// Retrieves the metadata of the achievement configuration with the given ID.
113 ///
114 /// Request parameters:
115 ///
116 /// [achievementId] - The ID of the achievement used by this method.
117 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200118 /// [$fields] - Selector specifying which fields to include in a partial
119 /// response.
120 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200121 /// Completes with a [AchievementConfiguration].
122 ///
123 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
124 /// error.
125 ///
126 /// If the used [http.Client] completes with an error when making a REST call,
127 /// this method will complete with the same error.
Kevin Moore6d21e902021-01-15 06:41:08 -0800128 async.Future<AchievementConfiguration> get(
129 core.String achievementId, {
Kevin Moore58e22332021-02-25 10:11:41 -0800130 core.String? $fields,
Kevin Mooredc994e82021-02-05 09:36:45 -0800131 }) async {
Kevin Moore6485d5a2021-02-08 14:56:40 -0800132 final _queryParams = <core.String, core.List<core.String>>{
133 if ($fields != null) 'fields': [$fields],
134 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100135
Kevin Moore0c926a62021-02-05 11:30:57 -0800136 final _url = 'games/v1configuration/achievements/' +
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200137 commons.Escaper.ecapeVariable('$achievementId');
Gustav Wibling1152ab62015-02-05 13:00:55 +0100138
Kevin Mooredc994e82021-02-05 09:36:45 -0800139 final _response = await _requester.request(
Kevin Moore6d21e902021-01-15 06:41:08 -0800140 _url,
Kevin Moored0251702021-01-15 06:41:08 -0800141 'GET',
Kevin Moore6d21e902021-01-15 06:41:08 -0800142 queryParams: _queryParams,
Kevin Moore6d21e902021-01-15 06:41:08 -0800143 );
Kevin Mooredc994e82021-02-05 09:36:45 -0800144 return AchievementConfiguration.fromJson(
145 _response as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100146 }
147
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200148 /// Insert a new achievement configuration in this application.
149 ///
150 /// [request] - The metadata request object.
151 ///
152 /// Request parameters:
153 ///
154 /// [applicationId] - The application ID from the Google Play developer
155 /// console.
156 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200157 /// [$fields] - Selector specifying which fields to include in a partial
158 /// response.
159 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200160 /// Completes with a [AchievementConfiguration].
161 ///
162 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
163 /// error.
164 ///
165 /// If the used [http.Client] completes with an error when making a REST call,
166 /// this method will complete with the same error.
167 async.Future<AchievementConfiguration> insert(
Kevin Moore6d21e902021-01-15 06:41:08 -0800168 AchievementConfiguration request,
169 core.String applicationId, {
Kevin Moore58e22332021-02-25 10:11:41 -0800170 core.String? $fields,
Kevin Mooredc994e82021-02-05 09:36:45 -0800171 }) async {
Kevin Moore58e22332021-02-25 10:11:41 -0800172 final _body = convert.json.encode(request.toJson());
Kevin Moore6485d5a2021-02-08 14:56:40 -0800173 final _queryParams = <core.String, core.List<core.String>>{
174 if ($fields != null) 'fields': [$fields],
175 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100176
Kevin Moore0c926a62021-02-05 11:30:57 -0800177 final _url = 'games/v1configuration/applications/' +
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200178 commons.Escaper.ecapeVariable('$applicationId') +
179 '/achievements';
Gustav Wibling1152ab62015-02-05 13:00:55 +0100180
Kevin Mooredc994e82021-02-05 09:36:45 -0800181 final _response = await _requester.request(
Kevin Moore6d21e902021-01-15 06:41:08 -0800182 _url,
Kevin Moored0251702021-01-15 06:41:08 -0800183 'POST',
Kevin Moore6d21e902021-01-15 06:41:08 -0800184 body: _body,
185 queryParams: _queryParams,
Kevin Moore6d21e902021-01-15 06:41:08 -0800186 );
Kevin Mooredc994e82021-02-05 09:36:45 -0800187 return AchievementConfiguration.fromJson(
188 _response as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100189 }
190
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200191 /// Returns a list of the achievement configurations in this application.
192 ///
193 /// Request parameters:
194 ///
195 /// [applicationId] - The application ID from the Google Play developer
196 /// console.
197 ///
Jonas Finnemann Jensenef0c8a32020-10-07 20:58:20 +0200198 /// [maxResults] - The maximum number of resource configurations to return in
199 /// the response, used for paging. For any response, the actual number of
200 /// resources returned may be less than the specified `maxResults`.
201 ///
Kevin Moore8810e8b2021-01-19 13:22:15 -0800202 /// [pageToken] - The token returned by the previous request.
203 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200204 /// [$fields] - Selector specifying which fields to include in a partial
205 /// response.
206 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200207 /// Completes with a [AchievementConfigurationListResponse].
208 ///
209 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
210 /// error.
211 ///
212 /// If the used [http.Client] completes with an error when making a REST call,
213 /// this method will complete with the same error.
214 async.Future<AchievementConfigurationListResponse> list(
Kevin Moore6d21e902021-01-15 06:41:08 -0800215 core.String applicationId, {
Kevin Moore58e22332021-02-25 10:11:41 -0800216 core.int? maxResults,
217 core.String? pageToken,
218 core.String? $fields,
Kevin Mooredc994e82021-02-05 09:36:45 -0800219 }) async {
Kevin Moore6485d5a2021-02-08 14:56:40 -0800220 final _queryParams = <core.String, core.List<core.String>>{
221 if (maxResults != null) 'maxResults': ['${maxResults}'],
222 if (pageToken != null) 'pageToken': [pageToken],
223 if ($fields != null) 'fields': [$fields],
224 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100225
Kevin Moore0c926a62021-02-05 11:30:57 -0800226 final _url = 'games/v1configuration/applications/' +
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200227 commons.Escaper.ecapeVariable('$applicationId') +
228 '/achievements';
Gustav Wibling1152ab62015-02-05 13:00:55 +0100229
Kevin Mooredc994e82021-02-05 09:36:45 -0800230 final _response = await _requester.request(
Kevin Moore6d21e902021-01-15 06:41:08 -0800231 _url,
Kevin Moored0251702021-01-15 06:41:08 -0800232 'GET',
Kevin Moore6d21e902021-01-15 06:41:08 -0800233 queryParams: _queryParams,
Kevin Moore6d21e902021-01-15 06:41:08 -0800234 );
Kevin Mooredc994e82021-02-05 09:36:45 -0800235 return AchievementConfigurationListResponse.fromJson(
236 _response as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100237 }
238
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200239 /// Update the metadata of the achievement configuration with the given ID.
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200240 ///
241 /// [request] - The metadata request object.
242 ///
243 /// Request parameters:
244 ///
245 /// [achievementId] - The ID of the achievement used by this method.
246 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200247 /// [$fields] - Selector specifying which fields to include in a partial
248 /// response.
249 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200250 /// Completes with a [AchievementConfiguration].
251 ///
252 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
253 /// error.
254 ///
255 /// If the used [http.Client] completes with an error when making a REST call,
256 /// this method will complete with the same error.
257 async.Future<AchievementConfiguration> update(
Kevin Moore6d21e902021-01-15 06:41:08 -0800258 AchievementConfiguration request,
259 core.String achievementId, {
Kevin Moore58e22332021-02-25 10:11:41 -0800260 core.String? $fields,
Kevin Mooredc994e82021-02-05 09:36:45 -0800261 }) async {
Kevin Moore58e22332021-02-25 10:11:41 -0800262 final _body = convert.json.encode(request.toJson());
Kevin Moore6485d5a2021-02-08 14:56:40 -0800263 final _queryParams = <core.String, core.List<core.String>>{
264 if ($fields != null) 'fields': [$fields],
265 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100266
Kevin Moore0c926a62021-02-05 11:30:57 -0800267 final _url = 'games/v1configuration/achievements/' +
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200268 commons.Escaper.ecapeVariable('$achievementId');
Gustav Wibling1152ab62015-02-05 13:00:55 +0100269
Kevin Mooredc994e82021-02-05 09:36:45 -0800270 final _response = await _requester.request(
Kevin Moore6d21e902021-01-15 06:41:08 -0800271 _url,
Kevin Moored0251702021-01-15 06:41:08 -0800272 'PUT',
Kevin Moore6d21e902021-01-15 06:41:08 -0800273 body: _body,
274 queryParams: _queryParams,
Kevin Moore6d21e902021-01-15 06:41:08 -0800275 );
Kevin Mooredc994e82021-02-05 09:36:45 -0800276 return AchievementConfiguration.fromJson(
277 _response as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100278 }
Gustav Wibling1152ab62015-02-05 13:00:55 +0100279}
280
Kevin Moore88512712021-01-28 14:43:28 -0800281class ImageConfigurationsResource {
Gustav Wibling042e6462015-04-10 13:40:06 +0200282 final commons.ApiRequester _requester;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100283
Kevin Moore88512712021-01-28 14:43:28 -0800284 ImageConfigurationsResource(commons.ApiRequester client)
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200285 : _requester = client;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100286
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200287 /// Uploads an image for a resource with the given ID and image type.
288 ///
289 /// Request parameters:
290 ///
291 /// [resourceId] - The ID of the resource used by this method.
292 ///
293 /// [imageType] - Selects which image in a resource for this method.
294 /// Possible string values are:
Jonas Finnemann Jensenef0c8a32020-10-07 20:58:20 +0200295 /// - "IMAGE_TYPE_UNSPECIFIED" : Default value. This value is unused.
296 /// - "ACHIEVEMENT_ICON" : The icon image for an achievement resource.
297 /// - "LEADERBOARD_ICON" : The icon image for a leaderboard resource.
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200298 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200299 /// [$fields] - Selector specifying which fields to include in a partial
300 /// response.
301 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200302 /// [uploadMedia] - The media to upload.
303 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200304 /// Completes with a [ImageConfiguration].
305 ///
306 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
307 /// error.
308 ///
309 /// If the used [http.Client] completes with an error when making a REST call,
310 /// this method will complete with the same error.
311 async.Future<ImageConfiguration> upload(
Kevin Moore6d21e902021-01-15 06:41:08 -0800312 core.String resourceId,
313 core.String imageType, {
Kevin Moore58e22332021-02-25 10:11:41 -0800314 core.String? $fields,
315 commons.Media? uploadMedia,
Kevin Mooredc994e82021-02-05 09:36:45 -0800316 }) async {
Kevin Moore6485d5a2021-02-08 14:56:40 -0800317 final _queryParams = <core.String, core.List<core.String>>{
318 if ($fields != null) 'fields': [$fields],
319 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100320
Kevin Moore0c926a62021-02-05 11:30:57 -0800321 core.String _url;
Kevin Moore1cda8a12021-02-05 10:26:47 -0800322 if (uploadMedia == null) {
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200323 _url = 'games/v1configuration/images/' +
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200324 commons.Escaper.ecapeVariable('$resourceId') +
325 '/imageType/' +
326 commons.Escaper.ecapeVariable('$imageType');
Gustav Wibling1152ab62015-02-05 13:00:55 +0100327 } else {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200328 _url = '/upload/games/v1configuration/images/' +
329 commons.Escaper.ecapeVariable('$resourceId') +
330 '/imageType/' +
331 commons.Escaper.ecapeVariable('$imageType');
Gustav Wibling1152ab62015-02-05 13:00:55 +0100332 }
333
Kevin Mooredc994e82021-02-05 09:36:45 -0800334 final _response = await _requester.request(
Kevin Moore6d21e902021-01-15 06:41:08 -0800335 _url,
Kevin Moored0251702021-01-15 06:41:08 -0800336 'POST',
Kevin Moore6d21e902021-01-15 06:41:08 -0800337 queryParams: _queryParams,
Kevin Moore1cda8a12021-02-05 10:26:47 -0800338 uploadMedia: uploadMedia,
Kevin Moore21bc4732021-02-24 11:23:07 -0800339 uploadOptions: commons.UploadOptions.defaultOptions,
Kevin Moore6d21e902021-01-15 06:41:08 -0800340 );
Kevin Mooredc994e82021-02-05 09:36:45 -0800341 return ImageConfiguration.fromJson(
342 _response as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100343 }
Gustav Wibling1152ab62015-02-05 13:00:55 +0100344}
345
Kevin Moore88512712021-01-28 14:43:28 -0800346class LeaderboardConfigurationsResource {
Gustav Wibling042e6462015-04-10 13:40:06 +0200347 final commons.ApiRequester _requester;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100348
Kevin Moore88512712021-01-28 14:43:28 -0800349 LeaderboardConfigurationsResource(commons.ApiRequester client)
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200350 : _requester = client;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100351
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200352 /// Delete the leaderboard configuration with the given ID.
353 ///
354 /// Request parameters:
355 ///
356 /// [leaderboardId] - The ID of the leaderboard.
357 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200358 /// [$fields] - Selector specifying which fields to include in a partial
359 /// response.
360 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200361 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
362 /// error.
363 ///
364 /// If the used [http.Client] completes with an error when making a REST call,
365 /// this method will complete with the same error.
Kevin Mooredc994e82021-02-05 09:36:45 -0800366 async.Future<void> delete(
Kevin Moore6d21e902021-01-15 06:41:08 -0800367 core.String leaderboardId, {
Kevin Moore58e22332021-02-25 10:11:41 -0800368 core.String? $fields,
Kevin Mooredc994e82021-02-05 09:36:45 -0800369 }) async {
Kevin Moore6485d5a2021-02-08 14:56:40 -0800370 final _queryParams = <core.String, core.List<core.String>>{
371 if ($fields != null) 'fields': [$fields],
372 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100373
Kevin Moore0c926a62021-02-05 11:30:57 -0800374 final _url = 'games/v1configuration/leaderboards/' +
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200375 commons.Escaper.ecapeVariable('$leaderboardId');
Gustav Wibling1152ab62015-02-05 13:00:55 +0100376
Kevin Mooredc994e82021-02-05 09:36:45 -0800377 await _requester.request(
Kevin Moore6d21e902021-01-15 06:41:08 -0800378 _url,
Kevin Moored0251702021-01-15 06:41:08 -0800379 'DELETE',
Kevin Moore6d21e902021-01-15 06:41:08 -0800380 queryParams: _queryParams,
Kevin Moorec007ffb2021-02-05 10:06:35 -0800381 downloadOptions: null,
Kevin Moore6d21e902021-01-15 06:41:08 -0800382 );
Gustav Wibling1152ab62015-02-05 13:00:55 +0100383 }
384
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200385 /// Retrieves the metadata of the leaderboard configuration with the given ID.
386 ///
387 /// Request parameters:
388 ///
389 /// [leaderboardId] - The ID of the leaderboard.
390 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200391 /// [$fields] - Selector specifying which fields to include in a partial
392 /// response.
393 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200394 /// Completes with a [LeaderboardConfiguration].
395 ///
396 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
397 /// error.
398 ///
399 /// If the used [http.Client] completes with an error when making a REST call,
400 /// this method will complete with the same error.
Kevin Moore6d21e902021-01-15 06:41:08 -0800401 async.Future<LeaderboardConfiguration> get(
402 core.String leaderboardId, {
Kevin Moore58e22332021-02-25 10:11:41 -0800403 core.String? $fields,
Kevin Mooredc994e82021-02-05 09:36:45 -0800404 }) async {
Kevin Moore6485d5a2021-02-08 14:56:40 -0800405 final _queryParams = <core.String, core.List<core.String>>{
406 if ($fields != null) 'fields': [$fields],
407 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100408
Kevin Moore0c926a62021-02-05 11:30:57 -0800409 final _url = 'games/v1configuration/leaderboards/' +
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200410 commons.Escaper.ecapeVariable('$leaderboardId');
Gustav Wibling1152ab62015-02-05 13:00:55 +0100411
Kevin Mooredc994e82021-02-05 09:36:45 -0800412 final _response = await _requester.request(
Kevin Moore6d21e902021-01-15 06:41:08 -0800413 _url,
Kevin Moored0251702021-01-15 06:41:08 -0800414 'GET',
Kevin Moore6d21e902021-01-15 06:41:08 -0800415 queryParams: _queryParams,
Kevin Moore6d21e902021-01-15 06:41:08 -0800416 );
Kevin Mooredc994e82021-02-05 09:36:45 -0800417 return LeaderboardConfiguration.fromJson(
418 _response as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100419 }
420
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200421 /// Insert a new leaderboard configuration in this application.
422 ///
423 /// [request] - The metadata request object.
424 ///
425 /// Request parameters:
426 ///
427 /// [applicationId] - The application ID from the Google Play developer
428 /// console.
429 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200430 /// [$fields] - Selector specifying which fields to include in a partial
431 /// response.
432 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200433 /// Completes with a [LeaderboardConfiguration].
434 ///
435 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
436 /// error.
437 ///
438 /// If the used [http.Client] completes with an error when making a REST call,
439 /// this method will complete with the same error.
440 async.Future<LeaderboardConfiguration> insert(
Kevin Moore6d21e902021-01-15 06:41:08 -0800441 LeaderboardConfiguration request,
442 core.String applicationId, {
Kevin Moore58e22332021-02-25 10:11:41 -0800443 core.String? $fields,
Kevin Mooredc994e82021-02-05 09:36:45 -0800444 }) async {
Kevin Moore58e22332021-02-25 10:11:41 -0800445 final _body = convert.json.encode(request.toJson());
Kevin Moore6485d5a2021-02-08 14:56:40 -0800446 final _queryParams = <core.String, core.List<core.String>>{
447 if ($fields != null) 'fields': [$fields],
448 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100449
Kevin Moore0c926a62021-02-05 11:30:57 -0800450 final _url = 'games/v1configuration/applications/' +
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200451 commons.Escaper.ecapeVariable('$applicationId') +
452 '/leaderboards';
Gustav Wibling1152ab62015-02-05 13:00:55 +0100453
Kevin Mooredc994e82021-02-05 09:36:45 -0800454 final _response = await _requester.request(
Kevin Moore6d21e902021-01-15 06:41:08 -0800455 _url,
Kevin Moored0251702021-01-15 06:41:08 -0800456 'POST',
Kevin Moore6d21e902021-01-15 06:41:08 -0800457 body: _body,
458 queryParams: _queryParams,
Kevin Moore6d21e902021-01-15 06:41:08 -0800459 );
Kevin Mooredc994e82021-02-05 09:36:45 -0800460 return LeaderboardConfiguration.fromJson(
461 _response as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100462 }
463
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200464 /// Returns a list of the leaderboard configurations in this application.
465 ///
466 /// Request parameters:
467 ///
468 /// [applicationId] - The application ID from the Google Play developer
469 /// console.
470 ///
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200471 /// [maxResults] - The maximum number of resource configurations to return in
Jonas Finnemann Jensenef0c8a32020-10-07 20:58:20 +0200472 /// the response, used for paging. For any response, the actual number of
473 /// resources returned may be less than the specified `maxResults`.
474 ///
475 /// [pageToken] - The token returned by the previous request.
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200476 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200477 /// [$fields] - Selector specifying which fields to include in a partial
478 /// response.
479 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200480 /// Completes with a [LeaderboardConfigurationListResponse].
481 ///
482 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
483 /// error.
484 ///
485 /// If the used [http.Client] completes with an error when making a REST call,
486 /// this method will complete with the same error.
487 async.Future<LeaderboardConfigurationListResponse> list(
Kevin Moore6d21e902021-01-15 06:41:08 -0800488 core.String applicationId, {
Kevin Moore58e22332021-02-25 10:11:41 -0800489 core.int? maxResults,
490 core.String? pageToken,
491 core.String? $fields,
Kevin Mooredc994e82021-02-05 09:36:45 -0800492 }) async {
Kevin Moore6485d5a2021-02-08 14:56:40 -0800493 final _queryParams = <core.String, core.List<core.String>>{
494 if (maxResults != null) 'maxResults': ['${maxResults}'],
495 if (pageToken != null) 'pageToken': [pageToken],
496 if ($fields != null) 'fields': [$fields],
497 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100498
Kevin Moore0c926a62021-02-05 11:30:57 -0800499 final _url = 'games/v1configuration/applications/' +
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200500 commons.Escaper.ecapeVariable('$applicationId') +
501 '/leaderboards';
Gustav Wibling1152ab62015-02-05 13:00:55 +0100502
Kevin Mooredc994e82021-02-05 09:36:45 -0800503 final _response = await _requester.request(
Kevin Moore6d21e902021-01-15 06:41:08 -0800504 _url,
Kevin Moored0251702021-01-15 06:41:08 -0800505 'GET',
Kevin Moore6d21e902021-01-15 06:41:08 -0800506 queryParams: _queryParams,
Kevin Moore6d21e902021-01-15 06:41:08 -0800507 );
Kevin Mooredc994e82021-02-05 09:36:45 -0800508 return LeaderboardConfigurationListResponse.fromJson(
509 _response as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100510 }
511
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200512 /// Update the metadata of the leaderboard configuration with the given ID.
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200513 ///
514 /// [request] - The metadata request object.
515 ///
516 /// Request parameters:
517 ///
518 /// [leaderboardId] - The ID of the leaderboard.
519 ///
Martin Kustermann7a3b5f52017-10-23 11:34:19 +0200520 /// [$fields] - Selector specifying which fields to include in a partial
521 /// response.
522 ///
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200523 /// Completes with a [LeaderboardConfiguration].
524 ///
525 /// Completes with a [commons.ApiRequestError] if the API endpoint returned an
526 /// error.
527 ///
528 /// If the used [http.Client] completes with an error when making a REST call,
529 /// this method will complete with the same error.
530 async.Future<LeaderboardConfiguration> update(
Kevin Moore6d21e902021-01-15 06:41:08 -0800531 LeaderboardConfiguration request,
532 core.String leaderboardId, {
Kevin Moore58e22332021-02-25 10:11:41 -0800533 core.String? $fields,
Kevin Mooredc994e82021-02-05 09:36:45 -0800534 }) async {
Kevin Moore58e22332021-02-25 10:11:41 -0800535 final _body = convert.json.encode(request.toJson());
Kevin Moore6485d5a2021-02-08 14:56:40 -0800536 final _queryParams = <core.String, core.List<core.String>>{
537 if ($fields != null) 'fields': [$fields],
538 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100539
Kevin Moore0c926a62021-02-05 11:30:57 -0800540 final _url = 'games/v1configuration/leaderboards/' +
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200541 commons.Escaper.ecapeVariable('$leaderboardId');
Gustav Wibling1152ab62015-02-05 13:00:55 +0100542
Kevin Mooredc994e82021-02-05 09:36:45 -0800543 final _response = await _requester.request(
Kevin Moore6d21e902021-01-15 06:41:08 -0800544 _url,
Kevin Moored0251702021-01-15 06:41:08 -0800545 'PUT',
Kevin Moore6d21e902021-01-15 06:41:08 -0800546 body: _body,
547 queryParams: _queryParams,
Kevin Moore6d21e902021-01-15 06:41:08 -0800548 );
Kevin Mooredc994e82021-02-05 09:36:45 -0800549 return LeaderboardConfiguration.fromJson(
550 _response as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100551 }
Gustav Wibling1152ab62015-02-05 13:00:55 +0100552}
553
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200554/// An achievement configuration resource.
Gustav Wibling1152ab62015-02-05 13:00:55 +0100555class AchievementConfiguration {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200556 /// The type of the achievement.
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200557 /// Possible string values are:
558 /// - "ACHIEVEMENT_TYPE_UNSPECIFIED" : Default value. This value is unused.
559 /// - "STANDARD" : Achievement is either locked or unlocked.
560 /// - "INCREMENTAL" : Achievement is incremental.
Kevin Moore58e22332021-02-25 10:11:41 -0800561 core.String? achievementType;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200562
563 /// The draft data of the achievement.
Kevin Moore58e22332021-02-25 10:11:41 -0800564 AchievementConfigurationDetail? draft;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200565
566 /// The ID of the achievement.
Kevin Moore58e22332021-02-25 10:11:41 -0800567 core.String? id;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200568
569 /// The initial state of the achievement.
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200570 /// Possible string values are:
571 /// - "INITIAL_STATE_UNSPECIFIED" : Default value. This value is unused.
572 /// - "HIDDEN" : Achievement is hidden.
573 /// - "REVEALED" : Achievement is revealed.
Kevin Moore58e22332021-02-25 10:11:41 -0800574 core.String? initialState;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200575
Kevin Moorea7bb1772021-01-28 16:13:03 -0800576 /// Uniquely identifies the type of this resource.
577 ///
578 /// Value is always the fixed string
579 /// `gamesConfiguration#achievementConfiguration`.
Kevin Moore58e22332021-02-25 10:11:41 -0800580 core.String? kind;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200581
582 /// The read-only published data of the achievement.
Kevin Moore58e22332021-02-25 10:11:41 -0800583 AchievementConfigurationDetail? published;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200584
Kevin Moorea7bb1772021-01-28 16:13:03 -0800585 /// Steps to unlock.
586 ///
587 /// Only applicable to incremental achievements.
Kevin Moore58e22332021-02-25 10:11:41 -0800588 core.int? stepsToUnlock;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200589
590 /// The token for this resource.
Kevin Moore58e22332021-02-25 10:11:41 -0800591 core.String? token;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100592
Gustav Wibling1152ab62015-02-05 13:00:55 +0100593 AchievementConfiguration();
594
595 AchievementConfiguration.fromJson(core.Map _json) {
Kevin Moored0251702021-01-15 06:41:08 -0800596 if (_json.containsKey('achievementType')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800597 achievementType = _json['achievementType'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100598 }
Kevin Moored0251702021-01-15 06:41:08 -0800599 if (_json.containsKey('draft')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800600 draft = AchievementConfigurationDetail.fromJson(
601 _json['draft'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100602 }
Kevin Moored0251702021-01-15 06:41:08 -0800603 if (_json.containsKey('id')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800604 id = _json['id'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100605 }
Kevin Moored0251702021-01-15 06:41:08 -0800606 if (_json.containsKey('initialState')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800607 initialState = _json['initialState'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100608 }
Kevin Moored0251702021-01-15 06:41:08 -0800609 if (_json.containsKey('kind')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800610 kind = _json['kind'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100611 }
Kevin Moored0251702021-01-15 06:41:08 -0800612 if (_json.containsKey('published')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800613 published = AchievementConfigurationDetail.fromJson(
614 _json['published'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100615 }
Kevin Moored0251702021-01-15 06:41:08 -0800616 if (_json.containsKey('stepsToUnlock')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800617 stepsToUnlock = _json['stepsToUnlock'] as core.int;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100618 }
Kevin Moored0251702021-01-15 06:41:08 -0800619 if (_json.containsKey('token')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800620 token = _json['token'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100621 }
622 }
623
Kevin Moore58e22332021-02-25 10:11:41 -0800624 core.Map<core.String, core.Object?> toJson() => {
625 if (achievementType != null) 'achievementType': achievementType!,
626 if (draft != null) 'draft': draft!.toJson(),
627 if (id != null) 'id': id!,
628 if (initialState != null) 'initialState': initialState!,
629 if (kind != null) 'kind': kind!,
630 if (published != null) 'published': published!.toJson(),
631 if (stepsToUnlock != null) 'stepsToUnlock': stepsToUnlock!,
632 if (token != null) 'token': token!,
Kevin Moorec321b0a2021-02-08 12:27:09 -0800633 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100634}
635
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200636/// An achievement configuration detail.
Gustav Wibling1152ab62015-02-05 13:00:55 +0100637class AchievementConfigurationDetail {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200638 /// Localized strings for the achievement description.
Kevin Moore58e22332021-02-25 10:11:41 -0800639 LocalizedStringBundle? description;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200640
Kevin Moorea7bb1772021-01-28 16:13:03 -0800641 /// The icon url of this achievement.
642 ///
643 /// Writes to this field are ignored.
Kevin Moore58e22332021-02-25 10:11:41 -0800644 core.String? iconUrl;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200645
Kevin Moorea7bb1772021-01-28 16:13:03 -0800646 /// Uniquely identifies the type of this resource.
647 ///
648 /// Value is always the fixed string
649 /// `gamesConfiguration#achievementConfigurationDetail`.
Kevin Moore58e22332021-02-25 10:11:41 -0800650 core.String? kind;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200651
652 /// Localized strings for the achievement name.
Kevin Moore58e22332021-02-25 10:11:41 -0800653 LocalizedStringBundle? name;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200654
655 /// Point value for the achievement.
Kevin Moore58e22332021-02-25 10:11:41 -0800656 core.int? pointValue;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200657
Kevin Moorea7bb1772021-01-28 16:13:03 -0800658 /// The sort rank of this achievement.
659 ///
660 /// Writes to this field are ignored.
Kevin Moore58e22332021-02-25 10:11:41 -0800661 core.int? sortRank;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100662
Gustav Wibling1152ab62015-02-05 13:00:55 +0100663 AchievementConfigurationDetail();
664
665 AchievementConfigurationDetail.fromJson(core.Map _json) {
Kevin Moored0251702021-01-15 06:41:08 -0800666 if (_json.containsKey('description')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800667 description = LocalizedStringBundle.fromJson(
668 _json['description'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100669 }
Kevin Moored0251702021-01-15 06:41:08 -0800670 if (_json.containsKey('iconUrl')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800671 iconUrl = _json['iconUrl'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100672 }
Kevin Moored0251702021-01-15 06:41:08 -0800673 if (_json.containsKey('kind')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800674 kind = _json['kind'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100675 }
Kevin Moored0251702021-01-15 06:41:08 -0800676 if (_json.containsKey('name')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800677 name = LocalizedStringBundle.fromJson(
678 _json['name'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100679 }
Kevin Moored0251702021-01-15 06:41:08 -0800680 if (_json.containsKey('pointValue')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800681 pointValue = _json['pointValue'] as core.int;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100682 }
Kevin Moored0251702021-01-15 06:41:08 -0800683 if (_json.containsKey('sortRank')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800684 sortRank = _json['sortRank'] as core.int;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100685 }
686 }
687
Kevin Moore58e22332021-02-25 10:11:41 -0800688 core.Map<core.String, core.Object?> toJson() => {
689 if (description != null) 'description': description!.toJson(),
690 if (iconUrl != null) 'iconUrl': iconUrl!,
691 if (kind != null) 'kind': kind!,
692 if (name != null) 'name': name!.toJson(),
693 if (pointValue != null) 'pointValue': pointValue!,
694 if (sortRank != null) 'sortRank': sortRank!,
Kevin Moorec321b0a2021-02-08 12:27:09 -0800695 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100696}
697
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200698/// A ListConfigurations response.
Gustav Wibling1152ab62015-02-05 13:00:55 +0100699class AchievementConfigurationListResponse {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200700 /// The achievement configurations.
Kevin Moore58e22332021-02-25 10:11:41 -0800701 core.List<AchievementConfiguration>? items;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200702
Kevin Moorea7bb1772021-01-28 16:13:03 -0800703 /// Uniquely identifies the type of this resource.
704 ///
705 /// Value is always the fixed string
706 /// `gamesConfiguration#achievementConfigurationListResponse`.
Kevin Moore58e22332021-02-25 10:11:41 -0800707 core.String? kind;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200708
709 /// The pagination token for the next page of results.
Kevin Moore58e22332021-02-25 10:11:41 -0800710 core.String? nextPageToken;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100711
Gustav Wibling1152ab62015-02-05 13:00:55 +0100712 AchievementConfigurationListResponse();
713
714 AchievementConfigurationListResponse.fromJson(core.Map _json) {
Kevin Moored0251702021-01-15 06:41:08 -0800715 if (_json.containsKey('items')) {
716 items = (_json['items'] as core.List)
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800717 .map<AchievementConfiguration>((value) =>
718 AchievementConfiguration.fromJson(
719 value as core.Map<core.String, core.dynamic>))
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200720 .toList();
Gustav Wibling1152ab62015-02-05 13:00:55 +0100721 }
Kevin Moored0251702021-01-15 06:41:08 -0800722 if (_json.containsKey('kind')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800723 kind = _json['kind'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100724 }
Kevin Moored0251702021-01-15 06:41:08 -0800725 if (_json.containsKey('nextPageToken')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800726 nextPageToken = _json['nextPageToken'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100727 }
728 }
729
Kevin Moore58e22332021-02-25 10:11:41 -0800730 core.Map<core.String, core.Object?> toJson() => {
Kevin Moorec321b0a2021-02-08 12:27:09 -0800731 if (items != null)
Kevin Moore58e22332021-02-25 10:11:41 -0800732 'items': items!.map((value) => value.toJson()).toList(),
733 if (kind != null) 'kind': kind!,
734 if (nextPageToken != null) 'nextPageToken': nextPageToken!,
Kevin Moorec321b0a2021-02-08 12:27:09 -0800735 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100736}
737
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200738/// A number affix resource.
Gustav Wibling1152ab62015-02-05 13:00:55 +0100739class GamesNumberAffixConfiguration {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200740 /// When the language requires special treatment of "small" numbers (as with
Jonas Finnemann Jensenef0c8a32020-10-07 20:58:20 +0200741 /// 2, 3, and 4 in Czech; or numbers ending 2, 3, or 4 but not 12, 13, or 14
742 /// in Polish).
Kevin Moore58e22332021-02-25 10:11:41 -0800743 LocalizedStringBundle? few;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200744
745 /// When the language requires special treatment of "large" numbers (as with
746 /// numbers ending 11-99 in Maltese).
Kevin Moore58e22332021-02-25 10:11:41 -0800747 LocalizedStringBundle? many;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200748
749 /// When the language requires special treatment of numbers like one (as with
750 /// the number 1 in English and most other languages; in Russian, any number
751 /// ending in 1 but not ending in 11 is in this class).
Kevin Moore58e22332021-02-25 10:11:41 -0800752 LocalizedStringBundle? one;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200753
754 /// When the language does not require special treatment of the given quantity
755 /// (as with all numbers in Chinese, or 42 in English).
Kevin Moore58e22332021-02-25 10:11:41 -0800756 LocalizedStringBundle? other;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200757
758 /// When the language requires special treatment of numbers like two (as with
Jonas Finnemann Jensenef0c8a32020-10-07 20:58:20 +0200759 /// 2 in Welsh, or 102 in Slovenian).
Kevin Moore58e22332021-02-25 10:11:41 -0800760 LocalizedStringBundle? two;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200761
762 /// When the language requires special treatment of the number 0 (as in
763 /// Arabic).
Kevin Moore58e22332021-02-25 10:11:41 -0800764 LocalizedStringBundle? zero;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100765
Gustav Wibling1152ab62015-02-05 13:00:55 +0100766 GamesNumberAffixConfiguration();
767
768 GamesNumberAffixConfiguration.fromJson(core.Map _json) {
Kevin Moored0251702021-01-15 06:41:08 -0800769 if (_json.containsKey('few')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800770 few = LocalizedStringBundle.fromJson(
771 _json['few'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100772 }
Kevin Moored0251702021-01-15 06:41:08 -0800773 if (_json.containsKey('many')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800774 many = LocalizedStringBundle.fromJson(
775 _json['many'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100776 }
Kevin Moored0251702021-01-15 06:41:08 -0800777 if (_json.containsKey('one')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800778 one = LocalizedStringBundle.fromJson(
779 _json['one'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100780 }
Kevin Moored0251702021-01-15 06:41:08 -0800781 if (_json.containsKey('other')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800782 other = LocalizedStringBundle.fromJson(
783 _json['other'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100784 }
Kevin Moored0251702021-01-15 06:41:08 -0800785 if (_json.containsKey('two')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800786 two = LocalizedStringBundle.fromJson(
787 _json['two'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100788 }
Kevin Moored0251702021-01-15 06:41:08 -0800789 if (_json.containsKey('zero')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800790 zero = LocalizedStringBundle.fromJson(
791 _json['zero'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100792 }
793 }
794
Kevin Moore58e22332021-02-25 10:11:41 -0800795 core.Map<core.String, core.Object?> toJson() => {
796 if (few != null) 'few': few!.toJson(),
797 if (many != null) 'many': many!.toJson(),
798 if (one != null) 'one': one!.toJson(),
799 if (other != null) 'other': other!.toJson(),
800 if (two != null) 'two': two!.toJson(),
801 if (zero != null) 'zero': zero!.toJson(),
Kevin Moorec321b0a2021-02-08 12:27:09 -0800802 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100803}
804
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200805/// A number format resource.
Gustav Wibling1152ab62015-02-05 13:00:55 +0100806class GamesNumberFormatConfiguration {
Kevin Moorea7bb1772021-01-28 16:13:03 -0800807 /// The curreny code string.
808 ///
809 /// Only used for CURRENCY format type.
Kevin Moore58e22332021-02-25 10:11:41 -0800810 core.String? currencyCode;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200811
Kevin Moorea7bb1772021-01-28 16:13:03 -0800812 /// The number of decimal places for number.
813 ///
814 /// Only used for NUMERIC format type.
Kevin Moore58e22332021-02-25 10:11:41 -0800815 core.int? numDecimalPlaces;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200816
817 /// The formatting for the number.
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200818 /// Possible string values are:
819 /// - "NUMBER_FORMAT_TYPE_UNSPECIFIED" : Default value. This value is unused.
820 /// - "NUMERIC" : Numbers are formatted to have no digits or fixed number of
Jonas Finnemann Jensenef0c8a32020-10-07 20:58:20 +0200821 /// digits after the decimal point according to locale. An optional custom
822 /// unit can be added.
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200823 /// - "TIME_DURATION" : Numbers are formatted to hours, minutes and seconds.
824 /// - "CURRENCY" : Numbers are formatted to currency according to locale.
Kevin Moore58e22332021-02-25 10:11:41 -0800825 core.String? numberFormatType;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200826
Kevin Moorea7bb1772021-01-28 16:13:03 -0800827 /// An optional suffix for the NUMERIC format type.
828 ///
829 /// These strings follow the same plural rules as all Android string
830 /// resources.
Kevin Moore58e22332021-02-25 10:11:41 -0800831 GamesNumberAffixConfiguration? suffix;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100832
Gustav Wibling1152ab62015-02-05 13:00:55 +0100833 GamesNumberFormatConfiguration();
834
835 GamesNumberFormatConfiguration.fromJson(core.Map _json) {
Kevin Moored0251702021-01-15 06:41:08 -0800836 if (_json.containsKey('currencyCode')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800837 currencyCode = _json['currencyCode'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100838 }
Kevin Moored0251702021-01-15 06:41:08 -0800839 if (_json.containsKey('numDecimalPlaces')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800840 numDecimalPlaces = _json['numDecimalPlaces'] as core.int;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100841 }
Kevin Moored0251702021-01-15 06:41:08 -0800842 if (_json.containsKey('numberFormatType')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800843 numberFormatType = _json['numberFormatType'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100844 }
Kevin Moored0251702021-01-15 06:41:08 -0800845 if (_json.containsKey('suffix')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800846 suffix = GamesNumberAffixConfiguration.fromJson(
847 _json['suffix'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100848 }
849 }
850
Kevin Moore58e22332021-02-25 10:11:41 -0800851 core.Map<core.String, core.Object?> toJson() => {
852 if (currencyCode != null) 'currencyCode': currencyCode!,
853 if (numDecimalPlaces != null) 'numDecimalPlaces': numDecimalPlaces!,
854 if (numberFormatType != null) 'numberFormatType': numberFormatType!,
855 if (suffix != null) 'suffix': suffix!.toJson(),
Kevin Moorec321b0a2021-02-08 12:27:09 -0800856 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100857}
858
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200859/// An image configuration resource.
Gustav Wibling1152ab62015-02-05 13:00:55 +0100860class ImageConfiguration {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200861 /// The image type for the image.
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200862 /// Possible string values are:
863 /// - "IMAGE_TYPE_UNSPECIFIED" : Default value. This value is unused.
864 /// - "ACHIEVEMENT_ICON" : The icon image for an achievement resource.
865 /// - "LEADERBOARD_ICON" : The icon image for a leaderboard resource.
Kevin Moore58e22332021-02-25 10:11:41 -0800866 core.String? imageType;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200867
Kevin Moorea7bb1772021-01-28 16:13:03 -0800868 /// Uniquely identifies the type of this resource.
869 ///
870 /// Value is always the fixed string `gamesConfiguration#imageConfiguration`.
Kevin Moore58e22332021-02-25 10:11:41 -0800871 core.String? kind;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200872
873 /// The resource ID of resource which the image belongs to.
Kevin Moore58e22332021-02-25 10:11:41 -0800874 core.String? resourceId;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200875
876 /// The url for this image.
Kevin Moore58e22332021-02-25 10:11:41 -0800877 core.String? url;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100878
Gustav Wibling1152ab62015-02-05 13:00:55 +0100879 ImageConfiguration();
880
881 ImageConfiguration.fromJson(core.Map _json) {
Kevin Moored0251702021-01-15 06:41:08 -0800882 if (_json.containsKey('imageType')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800883 imageType = _json['imageType'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100884 }
Kevin Moored0251702021-01-15 06:41:08 -0800885 if (_json.containsKey('kind')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800886 kind = _json['kind'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100887 }
Kevin Moored0251702021-01-15 06:41:08 -0800888 if (_json.containsKey('resourceId')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800889 resourceId = _json['resourceId'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100890 }
Kevin Moored0251702021-01-15 06:41:08 -0800891 if (_json.containsKey('url')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800892 url = _json['url'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100893 }
894 }
895
Kevin Moore58e22332021-02-25 10:11:41 -0800896 core.Map<core.String, core.Object?> toJson() => {
897 if (imageType != null) 'imageType': imageType!,
898 if (kind != null) 'kind': kind!,
899 if (resourceId != null) 'resourceId': resourceId!,
900 if (url != null) 'url': url!,
Kevin Moorec321b0a2021-02-08 12:27:09 -0800901 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100902}
903
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200904/// An leaderboard configuration resource.
Gustav Wibling1152ab62015-02-05 13:00:55 +0100905class LeaderboardConfiguration {
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200906 /// The draft data of the leaderboard.
Kevin Moore58e22332021-02-25 10:11:41 -0800907 LeaderboardConfigurationDetail? draft;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200908
909 /// The ID of the leaderboard.
Kevin Moore58e22332021-02-25 10:11:41 -0800910 core.String? id;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200911
Kevin Moorea7bb1772021-01-28 16:13:03 -0800912 /// Uniquely identifies the type of this resource.
913 ///
914 /// Value is always the fixed string
915 /// `gamesConfiguration#leaderboardConfiguration`.
Kevin Moore58e22332021-02-25 10:11:41 -0800916 core.String? kind;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200917
918 /// The read-only published data of the leaderboard.
Kevin Moore58e22332021-02-25 10:11:41 -0800919 LeaderboardConfigurationDetail? published;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200920
921 /// Maximum score that can be posted to this leaderboard.
Kevin Moore58e22332021-02-25 10:11:41 -0800922 core.String? scoreMax;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200923
924 /// Minimum score that can be posted to this leaderboard.
Kevin Moore58e22332021-02-25 10:11:41 -0800925 core.String? scoreMin;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200926
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200927 ///
928 /// Possible string values are:
929 /// - "SCORE_ORDER_UNSPECIFIED" : Default value. This value is unused.
930 /// - "LARGER_IS_BETTER" : Larger scores posted are ranked higher.
931 /// - "SMALLER_IS_BETTER" : Smaller scores posted are ranked higher.
Kevin Moore58e22332021-02-25 10:11:41 -0800932 core.String? scoreOrder;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200933
934 /// The token for this resource.
Kevin Moore58e22332021-02-25 10:11:41 -0800935 core.String? token;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100936
Gustav Wibling1152ab62015-02-05 13:00:55 +0100937 LeaderboardConfiguration();
938
939 LeaderboardConfiguration.fromJson(core.Map _json) {
Kevin Moored0251702021-01-15 06:41:08 -0800940 if (_json.containsKey('draft')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800941 draft = LeaderboardConfigurationDetail.fromJson(
942 _json['draft'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100943 }
Kevin Moored0251702021-01-15 06:41:08 -0800944 if (_json.containsKey('id')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800945 id = _json['id'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100946 }
Kevin Moored0251702021-01-15 06:41:08 -0800947 if (_json.containsKey('kind')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800948 kind = _json['kind'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100949 }
Kevin Moored0251702021-01-15 06:41:08 -0800950 if (_json.containsKey('published')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -0800951 published = LeaderboardConfigurationDetail.fromJson(
952 _json['published'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +0100953 }
Kevin Moored0251702021-01-15 06:41:08 -0800954 if (_json.containsKey('scoreMax')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800955 scoreMax = _json['scoreMax'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100956 }
Kevin Moored0251702021-01-15 06:41:08 -0800957 if (_json.containsKey('scoreMin')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800958 scoreMin = _json['scoreMin'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100959 }
Kevin Moored0251702021-01-15 06:41:08 -0800960 if (_json.containsKey('scoreOrder')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800961 scoreOrder = _json['scoreOrder'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100962 }
Kevin Moored0251702021-01-15 06:41:08 -0800963 if (_json.containsKey('token')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -0800964 token = _json['token'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +0100965 }
966 }
967
Kevin Moore58e22332021-02-25 10:11:41 -0800968 core.Map<core.String, core.Object?> toJson() => {
969 if (draft != null) 'draft': draft!.toJson(),
970 if (id != null) 'id': id!,
971 if (kind != null) 'kind': kind!,
972 if (published != null) 'published': published!.toJson(),
973 if (scoreMax != null) 'scoreMax': scoreMax!,
974 if (scoreMin != null) 'scoreMin': scoreMin!,
975 if (scoreOrder != null) 'scoreOrder': scoreOrder!,
976 if (token != null) 'token': token!,
Kevin Moorec321b0a2021-02-08 12:27:09 -0800977 };
Gustav Wibling1152ab62015-02-05 13:00:55 +0100978}
979
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +0200980/// A leaderboard configuration detail.
Gustav Wibling1152ab62015-02-05 13:00:55 +0100981class LeaderboardConfigurationDetail {
Kevin Moorea7bb1772021-01-28 16:13:03 -0800982 /// The icon url of this leaderboard.
983 ///
984 /// Writes to this field are ignored.
Kevin Moore58e22332021-02-25 10:11:41 -0800985 core.String? iconUrl;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200986
Kevin Moorea7bb1772021-01-28 16:13:03 -0800987 /// Uniquely identifies the type of this resource.
988 ///
989 /// Value is always the fixed string
990 /// `gamesConfiguration#leaderboardConfigurationDetail`.
Kevin Moore58e22332021-02-25 10:11:41 -0800991 core.String? kind;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200992
993 /// Localized strings for the leaderboard name.
Kevin Moore58e22332021-02-25 10:11:41 -0800994 LocalizedStringBundle? name;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200995
996 /// The score formatting for the leaderboard.
Kevin Moore58e22332021-02-25 10:11:41 -0800997 GamesNumberFormatConfiguration? scoreFormat;
Martin Kustermann5eb85c12017-09-11 12:35:54 +0200998
Kevin Moorea7bb1772021-01-28 16:13:03 -0800999 /// The sort rank of this leaderboard.
1000 ///
1001 /// Writes to this field are ignored.
Kevin Moore58e22332021-02-25 10:11:41 -08001002 core.int? sortRank;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001003
Gustav Wibling1152ab62015-02-05 13:00:55 +01001004 LeaderboardConfigurationDetail();
1005
1006 LeaderboardConfigurationDetail.fromJson(core.Map _json) {
Kevin Moored0251702021-01-15 06:41:08 -08001007 if (_json.containsKey('iconUrl')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -08001008 iconUrl = _json['iconUrl'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001009 }
Kevin Moored0251702021-01-15 06:41:08 -08001010 if (_json.containsKey('kind')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -08001011 kind = _json['kind'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001012 }
Kevin Moored0251702021-01-15 06:41:08 -08001013 if (_json.containsKey('name')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001014 name = LocalizedStringBundle.fromJson(
1015 _json['name'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +01001016 }
Kevin Moored0251702021-01-15 06:41:08 -08001017 if (_json.containsKey('scoreFormat')) {
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001018 scoreFormat = GamesNumberFormatConfiguration.fromJson(
1019 _json['scoreFormat'] as core.Map<core.String, core.dynamic>);
Gustav Wibling1152ab62015-02-05 13:00:55 +01001020 }
Kevin Moored0251702021-01-15 06:41:08 -08001021 if (_json.containsKey('sortRank')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -08001022 sortRank = _json['sortRank'] as core.int;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001023 }
1024 }
1025
Kevin Moore58e22332021-02-25 10:11:41 -08001026 core.Map<core.String, core.Object?> toJson() => {
1027 if (iconUrl != null) 'iconUrl': iconUrl!,
1028 if (kind != null) 'kind': kind!,
1029 if (name != null) 'name': name!.toJson(),
1030 if (scoreFormat != null) 'scoreFormat': scoreFormat!.toJson(),
1031 if (sortRank != null) 'sortRank': sortRank!,
Kevin Moorec321b0a2021-02-08 12:27:09 -08001032 };
Gustav Wibling1152ab62015-02-05 13:00:55 +01001033}
1034
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +02001035/// A ListConfigurations response.
Gustav Wibling1152ab62015-02-05 13:00:55 +01001036class LeaderboardConfigurationListResponse {
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001037 /// The leaderboard configurations.
Kevin Moore58e22332021-02-25 10:11:41 -08001038 core.List<LeaderboardConfiguration>? items;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001039
Kevin Moorea7bb1772021-01-28 16:13:03 -08001040 /// Uniquely identifies the type of this resource.
1041 ///
1042 /// Value is always the fixed string
1043 /// `gamesConfiguration#leaderboardConfigurationListResponse`.
Kevin Moore58e22332021-02-25 10:11:41 -08001044 core.String? kind;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001045
1046 /// The pagination token for the next page of results.
Kevin Moore58e22332021-02-25 10:11:41 -08001047 core.String? nextPageToken;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001048
Gustav Wibling1152ab62015-02-05 13:00:55 +01001049 LeaderboardConfigurationListResponse();
1050
1051 LeaderboardConfigurationListResponse.fromJson(core.Map _json) {
Kevin Moored0251702021-01-15 06:41:08 -08001052 if (_json.containsKey('items')) {
1053 items = (_json['items'] as core.List)
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001054 .map<LeaderboardConfiguration>((value) =>
1055 LeaderboardConfiguration.fromJson(
1056 value as core.Map<core.String, core.dynamic>))
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001057 .toList();
Gustav Wibling1152ab62015-02-05 13:00:55 +01001058 }
Kevin Moored0251702021-01-15 06:41:08 -08001059 if (_json.containsKey('kind')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -08001060 kind = _json['kind'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001061 }
Kevin Moored0251702021-01-15 06:41:08 -08001062 if (_json.containsKey('nextPageToken')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -08001063 nextPageToken = _json['nextPageToken'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001064 }
1065 }
1066
Kevin Moore58e22332021-02-25 10:11:41 -08001067 core.Map<core.String, core.Object?> toJson() => {
Kevin Moorec321b0a2021-02-08 12:27:09 -08001068 if (items != null)
Kevin Moore58e22332021-02-25 10:11:41 -08001069 'items': items!.map((value) => value.toJson()).toList(),
1070 if (kind != null) 'kind': kind!,
1071 if (nextPageToken != null) 'nextPageToken': nextPageToken!,
Kevin Moorec321b0a2021-02-08 12:27:09 -08001072 };
Gustav Wibling1152ab62015-02-05 13:00:55 +01001073}
1074
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +02001075/// A localized string resource.
Gustav Wibling1152ab62015-02-05 13:00:55 +01001076class LocalizedString {
Kevin Moorea7bb1772021-01-28 16:13:03 -08001077 /// Uniquely identifies the type of this resource.
1078 ///
1079 /// Value is always the fixed string `gamesConfiguration#localizedString`.
Kevin Moore58e22332021-02-25 10:11:41 -08001080 core.String? kind;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001081
1082 /// The locale string.
Kevin Moore58e22332021-02-25 10:11:41 -08001083 core.String? locale;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001084
1085 /// The string value.
Kevin Moore58e22332021-02-25 10:11:41 -08001086 core.String? value;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001087
Gustav Wibling1152ab62015-02-05 13:00:55 +01001088 LocalizedString();
1089
1090 LocalizedString.fromJson(core.Map _json) {
Kevin Moored0251702021-01-15 06:41:08 -08001091 if (_json.containsKey('kind')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -08001092 kind = _json['kind'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001093 }
Kevin Moored0251702021-01-15 06:41:08 -08001094 if (_json.containsKey('locale')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -08001095 locale = _json['locale'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001096 }
Kevin Moored0251702021-01-15 06:41:08 -08001097 if (_json.containsKey('value')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -08001098 value = _json['value'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001099 }
1100 }
1101
Kevin Moore58e22332021-02-25 10:11:41 -08001102 core.Map<core.String, core.Object?> toJson() => {
1103 if (kind != null) 'kind': kind!,
1104 if (locale != null) 'locale': locale!,
1105 if (value != null) 'value': value!,
Kevin Moorec321b0a2021-02-08 12:27:09 -08001106 };
Gustav Wibling1152ab62015-02-05 13:00:55 +01001107}
1108
Jonas Finnemann Jensen94d5b4d2020-05-07 12:00:14 +02001109/// A localized string bundle resource.
Gustav Wibling1152ab62015-02-05 13:00:55 +01001110class LocalizedStringBundle {
Kevin Moorea7bb1772021-01-28 16:13:03 -08001111 /// Uniquely identifies the type of this resource.
1112 ///
1113 /// Value is always the fixed string
1114 /// `gamesConfiguration#localizedStringBundle`.
Kevin Moore58e22332021-02-25 10:11:41 -08001115 core.String? kind;
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001116
1117 /// The locale strings.
Kevin Moore58e22332021-02-25 10:11:41 -08001118 core.List<LocalizedString>? translations;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001119
Gustav Wibling1152ab62015-02-05 13:00:55 +01001120 LocalizedStringBundle();
1121
1122 LocalizedStringBundle.fromJson(core.Map _json) {
Kevin Moored0251702021-01-15 06:41:08 -08001123 if (_json.containsKey('kind')) {
Kevin Mooref03b2ee2021-01-25 10:57:57 -08001124 kind = _json['kind'] as core.String;
Gustav Wibling1152ab62015-02-05 13:00:55 +01001125 }
Kevin Moored0251702021-01-15 06:41:08 -08001126 if (_json.containsKey('translations')) {
1127 translations = (_json['translations'] as core.List)
Kevin Moorec4dbd8e2021-01-26 14:40:35 -08001128 .map<LocalizedString>((value) => LocalizedString.fromJson(
1129 value as core.Map<core.String, core.dynamic>))
Martin Kustermann5eb85c12017-09-11 12:35:54 +02001130 .toList();
Gustav Wibling1152ab62015-02-05 13:00:55 +01001131 }
1132 }
1133
Kevin Moore58e22332021-02-25 10:11:41 -08001134 core.Map<core.String, core.Object?> toJson() => {
1135 if (kind != null) 'kind': kind!,
Kevin Moorec321b0a2021-02-08 12:27:09 -08001136 if (translations != null)
Kevin Moore58e22332021-02-25 10:11:41 -08001137 'translations': translations!.map((value) => value.toJson()).toList(),
Kevin Moorec321b0a2021-02-08 12:27:09 -08001138 };
Gustav Wibling1152ab62015-02-05 13:00:55 +01001139}