Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 1 | // This is a generated file (see the discoveryapis_generator project). |
| 2 | |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 3 | // ignore_for_file: camel_case_types |
| 4 | // ignore_for_file: comment_references |
Kevin Moore | 1ad61ef | 2021-01-22 17:52:58 -0800 | [diff] [blame] | 5 | // ignore_for_file: file_names |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 6 | // ignore_for_file: library_names |
| 7 | // ignore_for_file: lines_longer_than_80_chars |
| 8 | // ignore_for_file: non_constant_identifier_names |
Kevin Moore | 1ad61ef | 2021-01-22 17:52:58 -0800 | [diff] [blame] | 9 | // ignore_for_file: prefer_expression_function_bodies |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 10 | // ignore_for_file: prefer_interpolation_to_compose_strings |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 11 | // ignore_for_file: unnecessary_brace_in_string_interps |
| 12 | // ignore_for_file: unnecessary_cast |
Kevin Moore | 1ad61ef | 2021-01-22 17:52:58 -0800 | [diff] [blame] | 13 | // ignore_for_file: unnecessary_lambdas |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 14 | // ignore_for_file: unnecessary_string_interpolations |
Jakob Andersen | c21146a | 2018-05-25 09:46:20 +0200 | [diff] [blame] | 15 | |
Kevin Moore | 3fda834 | 2021-01-28 09:39:59 -0800 | [diff] [blame] | 16 | /// 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 Moore | d33cc81 | 2021-01-28 14:21:17 -0800 | [diff] [blame] | 22 | /// |
| 23 | /// Create an instance of [GamesConfigurationApi] to access these resources: |
| 24 | /// |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 25 | /// - [AchievementConfigurationsResource] |
| 26 | /// - [ImageConfigurationsResource] |
| 27 | /// - [LeaderboardConfigurationsResource] |
Kevin Moore | 6f98bc2 | 2021-01-28 11:22:28 -0800 | [diff] [blame] | 28 | library gamesConfiguration.v1configuration; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 29 | |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 30 | import 'dart:async' as async; |
| 31 | import 'dart:convert' as convert; |
Kevin Moore | 8b4beef | 2021-01-27 20:42:25 -0800 | [diff] [blame] | 32 | import 'dart:core' as core; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 33 | |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 34 | import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 35 | import 'package:http/http.dart' as http; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 36 | |
Kevin Moore | 8b4beef | 2021-01-27 20:42:25 -0800 | [diff] [blame] | 37 | import '../src/user_agent.dart'; |
| 38 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 39 | export '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 Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 49 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 50 | /// The Google Play Game Services Publishing API allows developers to configure |
| 51 | /// their games in Game Services. |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 52 | class GamesConfigurationApi { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 53 | /// View and manage your Google Play Developer account |
Kevin Moore | 298a64b | 2021-01-22 19:44:38 -0800 | [diff] [blame] | 54 | static const androidpublisherScope = |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 55 | 'https://www.googleapis.com/auth/androidpublisher'; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 56 | |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 57 | final commons.ApiRequester _requester; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 58 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 59 | AchievementConfigurationsResource get achievementConfigurations => |
| 60 | AchievementConfigurationsResource(_requester); |
| 61 | ImageConfigurationsResource get imageConfigurations => |
| 62 | ImageConfigurationsResource(_requester); |
| 63 | LeaderboardConfigurationsResource get leaderboardConfigurations => |
| 64 | LeaderboardConfigurationsResource(_requester); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 65 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 66 | GamesConfigurationApi(http.Client client, |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 67 | {core.String rootUrl = 'https://gamesconfiguration.googleapis.com/', |
| 68 | core.String servicePath = ''}) |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 69 | : _requester = |
Kevin Moore | 298a64b | 2021-01-22 19:44:38 -0800 | [diff] [blame] | 70 | commons.ApiRequester(client, rootUrl, servicePath, userAgent); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 71 | } |
| 72 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 73 | class AchievementConfigurationsResource { |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 74 | final commons.ApiRequester _requester; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 75 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 76 | AchievementConfigurationsResource(commons.ApiRequester client) |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 77 | : _requester = client; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 78 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 79 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 85 | /// [$fields] - Selector specifying which fields to include in a partial |
| 86 | /// response. |
| 87 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 88 | /// 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 Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 93 | async.Future<void> delete( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 94 | core.String achievementId, { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 95 | core.String? $fields, |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 96 | }) async { |
Kevin Moore | 6485d5a | 2021-02-08 14:56:40 -0800 | [diff] [blame] | 97 | final _queryParams = <core.String, core.List<core.String>>{ |
| 98 | if ($fields != null) 'fields': [$fields], |
| 99 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 100 | |
Kevin Moore | 0c926a6 | 2021-02-05 11:30:57 -0800 | [diff] [blame] | 101 | final _url = 'games/v1configuration/achievements/' + |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 102 | commons.Escaper.ecapeVariable('$achievementId'); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 103 | |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 104 | await _requester.request( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 105 | _url, |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 106 | 'DELETE', |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 107 | queryParams: _queryParams, |
Kevin Moore | c007ffb | 2021-02-05 10:06:35 -0800 | [diff] [blame] | 108 | downloadOptions: null, |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 109 | ); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 110 | } |
| 111 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 112 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 118 | /// [$fields] - Selector specifying which fields to include in a partial |
| 119 | /// response. |
| 120 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 121 | /// 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 Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 128 | async.Future<AchievementConfiguration> get( |
| 129 | core.String achievementId, { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 130 | core.String? $fields, |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 131 | }) async { |
Kevin Moore | 6485d5a | 2021-02-08 14:56:40 -0800 | [diff] [blame] | 132 | final _queryParams = <core.String, core.List<core.String>>{ |
| 133 | if ($fields != null) 'fields': [$fields], |
| 134 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 135 | |
Kevin Moore | 0c926a6 | 2021-02-05 11:30:57 -0800 | [diff] [blame] | 136 | final _url = 'games/v1configuration/achievements/' + |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 137 | commons.Escaper.ecapeVariable('$achievementId'); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 138 | |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 139 | final _response = await _requester.request( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 140 | _url, |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 141 | 'GET', |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 142 | queryParams: _queryParams, |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 143 | ); |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 144 | return AchievementConfiguration.fromJson( |
| 145 | _response as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 146 | } |
| 147 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 148 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 157 | /// [$fields] - Selector specifying which fields to include in a partial |
| 158 | /// response. |
| 159 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 160 | /// 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 Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 168 | AchievementConfiguration request, |
| 169 | core.String applicationId, { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 170 | core.String? $fields, |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 171 | }) async { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 172 | final _body = convert.json.encode(request.toJson()); |
Kevin Moore | 6485d5a | 2021-02-08 14:56:40 -0800 | [diff] [blame] | 173 | final _queryParams = <core.String, core.List<core.String>>{ |
| 174 | if ($fields != null) 'fields': [$fields], |
| 175 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 176 | |
Kevin Moore | 0c926a6 | 2021-02-05 11:30:57 -0800 | [diff] [blame] | 177 | final _url = 'games/v1configuration/applications/' + |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 178 | commons.Escaper.ecapeVariable('$applicationId') + |
| 179 | '/achievements'; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 180 | |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 181 | final _response = await _requester.request( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 182 | _url, |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 183 | 'POST', |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 184 | body: _body, |
| 185 | queryParams: _queryParams, |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 186 | ); |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 187 | return AchievementConfiguration.fromJson( |
| 188 | _response as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 189 | } |
| 190 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 191 | /// 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 Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 198 | /// [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 Moore | 8810e8b | 2021-01-19 13:22:15 -0800 | [diff] [blame] | 202 | /// [pageToken] - The token returned by the previous request. |
| 203 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 204 | /// [$fields] - Selector specifying which fields to include in a partial |
| 205 | /// response. |
| 206 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 207 | /// 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 Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 215 | core.String applicationId, { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 216 | core.int? maxResults, |
| 217 | core.String? pageToken, |
| 218 | core.String? $fields, |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 219 | }) async { |
Kevin Moore | 6485d5a | 2021-02-08 14:56:40 -0800 | [diff] [blame] | 220 | 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 Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 225 | |
Kevin Moore | 0c926a6 | 2021-02-05 11:30:57 -0800 | [diff] [blame] | 226 | final _url = 'games/v1configuration/applications/' + |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 227 | commons.Escaper.ecapeVariable('$applicationId') + |
| 228 | '/achievements'; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 229 | |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 230 | final _response = await _requester.request( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 231 | _url, |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 232 | 'GET', |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 233 | queryParams: _queryParams, |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 234 | ); |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 235 | return AchievementConfigurationListResponse.fromJson( |
| 236 | _response as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 237 | } |
| 238 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 239 | /// Update the metadata of the achievement configuration with the given ID. |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 240 | /// |
| 241 | /// [request] - The metadata request object. |
| 242 | /// |
| 243 | /// Request parameters: |
| 244 | /// |
| 245 | /// [achievementId] - The ID of the achievement used by this method. |
| 246 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 247 | /// [$fields] - Selector specifying which fields to include in a partial |
| 248 | /// response. |
| 249 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 250 | /// 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 Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 258 | AchievementConfiguration request, |
| 259 | core.String achievementId, { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 260 | core.String? $fields, |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 261 | }) async { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 262 | final _body = convert.json.encode(request.toJson()); |
Kevin Moore | 6485d5a | 2021-02-08 14:56:40 -0800 | [diff] [blame] | 263 | final _queryParams = <core.String, core.List<core.String>>{ |
| 264 | if ($fields != null) 'fields': [$fields], |
| 265 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 266 | |
Kevin Moore | 0c926a6 | 2021-02-05 11:30:57 -0800 | [diff] [blame] | 267 | final _url = 'games/v1configuration/achievements/' + |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 268 | commons.Escaper.ecapeVariable('$achievementId'); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 269 | |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 270 | final _response = await _requester.request( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 271 | _url, |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 272 | 'PUT', |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 273 | body: _body, |
| 274 | queryParams: _queryParams, |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 275 | ); |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 276 | return AchievementConfiguration.fromJson( |
| 277 | _response as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 278 | } |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 279 | } |
| 280 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 281 | class ImageConfigurationsResource { |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 282 | final commons.ApiRequester _requester; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 283 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 284 | ImageConfigurationsResource(commons.ApiRequester client) |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 285 | : _requester = client; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 286 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 287 | /// 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 Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 295 | /// - "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 Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 298 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 299 | /// [$fields] - Selector specifying which fields to include in a partial |
| 300 | /// response. |
| 301 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 302 | /// [uploadMedia] - The media to upload. |
| 303 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 304 | /// 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 Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 312 | core.String resourceId, |
| 313 | core.String imageType, { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 314 | core.String? $fields, |
| 315 | commons.Media? uploadMedia, |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 316 | }) async { |
Kevin Moore | 6485d5a | 2021-02-08 14:56:40 -0800 | [diff] [blame] | 317 | final _queryParams = <core.String, core.List<core.String>>{ |
| 318 | if ($fields != null) 'fields': [$fields], |
| 319 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 320 | |
Kevin Moore | 0c926a6 | 2021-02-05 11:30:57 -0800 | [diff] [blame] | 321 | core.String _url; |
Kevin Moore | 1cda8a1 | 2021-02-05 10:26:47 -0800 | [diff] [blame] | 322 | if (uploadMedia == null) { |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 323 | _url = 'games/v1configuration/images/' + |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 324 | commons.Escaper.ecapeVariable('$resourceId') + |
| 325 | '/imageType/' + |
| 326 | commons.Escaper.ecapeVariable('$imageType'); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 327 | } else { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 328 | _url = '/upload/games/v1configuration/images/' + |
| 329 | commons.Escaper.ecapeVariable('$resourceId') + |
| 330 | '/imageType/' + |
| 331 | commons.Escaper.ecapeVariable('$imageType'); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 332 | } |
| 333 | |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 334 | final _response = await _requester.request( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 335 | _url, |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 336 | 'POST', |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 337 | queryParams: _queryParams, |
Kevin Moore | 1cda8a1 | 2021-02-05 10:26:47 -0800 | [diff] [blame] | 338 | uploadMedia: uploadMedia, |
Kevin Moore | 21bc473 | 2021-02-24 11:23:07 -0800 | [diff] [blame] | 339 | uploadOptions: commons.UploadOptions.defaultOptions, |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 340 | ); |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 341 | return ImageConfiguration.fromJson( |
| 342 | _response as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 343 | } |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 344 | } |
| 345 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 346 | class LeaderboardConfigurationsResource { |
Gustav Wibling | 042e646 | 2015-04-10 13:40:06 +0200 | [diff] [blame] | 347 | final commons.ApiRequester _requester; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 348 | |
Kevin Moore | 8851271 | 2021-01-28 14:43:28 -0800 | [diff] [blame] | 349 | LeaderboardConfigurationsResource(commons.ApiRequester client) |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 350 | : _requester = client; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 351 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 352 | /// Delete the leaderboard configuration with the given ID. |
| 353 | /// |
| 354 | /// Request parameters: |
| 355 | /// |
| 356 | /// [leaderboardId] - The ID of the leaderboard. |
| 357 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 358 | /// [$fields] - Selector specifying which fields to include in a partial |
| 359 | /// response. |
| 360 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 361 | /// 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 Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 366 | async.Future<void> delete( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 367 | core.String leaderboardId, { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 368 | core.String? $fields, |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 369 | }) async { |
Kevin Moore | 6485d5a | 2021-02-08 14:56:40 -0800 | [diff] [blame] | 370 | final _queryParams = <core.String, core.List<core.String>>{ |
| 371 | if ($fields != null) 'fields': [$fields], |
| 372 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 373 | |
Kevin Moore | 0c926a6 | 2021-02-05 11:30:57 -0800 | [diff] [blame] | 374 | final _url = 'games/v1configuration/leaderboards/' + |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 375 | commons.Escaper.ecapeVariable('$leaderboardId'); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 376 | |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 377 | await _requester.request( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 378 | _url, |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 379 | 'DELETE', |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 380 | queryParams: _queryParams, |
Kevin Moore | c007ffb | 2021-02-05 10:06:35 -0800 | [diff] [blame] | 381 | downloadOptions: null, |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 382 | ); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 383 | } |
| 384 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 385 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 391 | /// [$fields] - Selector specifying which fields to include in a partial |
| 392 | /// response. |
| 393 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 394 | /// 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 Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 401 | async.Future<LeaderboardConfiguration> get( |
| 402 | core.String leaderboardId, { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 403 | core.String? $fields, |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 404 | }) async { |
Kevin Moore | 6485d5a | 2021-02-08 14:56:40 -0800 | [diff] [blame] | 405 | final _queryParams = <core.String, core.List<core.String>>{ |
| 406 | if ($fields != null) 'fields': [$fields], |
| 407 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 408 | |
Kevin Moore | 0c926a6 | 2021-02-05 11:30:57 -0800 | [diff] [blame] | 409 | final _url = 'games/v1configuration/leaderboards/' + |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 410 | commons.Escaper.ecapeVariable('$leaderboardId'); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 411 | |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 412 | final _response = await _requester.request( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 413 | _url, |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 414 | 'GET', |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 415 | queryParams: _queryParams, |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 416 | ); |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 417 | return LeaderboardConfiguration.fromJson( |
| 418 | _response as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 419 | } |
| 420 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 421 | /// 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 Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 430 | /// [$fields] - Selector specifying which fields to include in a partial |
| 431 | /// response. |
| 432 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 433 | /// 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 Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 441 | LeaderboardConfiguration request, |
| 442 | core.String applicationId, { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 443 | core.String? $fields, |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 444 | }) async { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 445 | final _body = convert.json.encode(request.toJson()); |
Kevin Moore | 6485d5a | 2021-02-08 14:56:40 -0800 | [diff] [blame] | 446 | final _queryParams = <core.String, core.List<core.String>>{ |
| 447 | if ($fields != null) 'fields': [$fields], |
| 448 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 449 | |
Kevin Moore | 0c926a6 | 2021-02-05 11:30:57 -0800 | [diff] [blame] | 450 | final _url = 'games/v1configuration/applications/' + |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 451 | commons.Escaper.ecapeVariable('$applicationId') + |
| 452 | '/leaderboards'; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 453 | |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 454 | final _response = await _requester.request( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 455 | _url, |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 456 | 'POST', |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 457 | body: _body, |
| 458 | queryParams: _queryParams, |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 459 | ); |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 460 | return LeaderboardConfiguration.fromJson( |
| 461 | _response as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 462 | } |
| 463 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 464 | /// 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 Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 471 | /// [maxResults] - The maximum number of resource configurations to return in |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 472 | /// 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 Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 476 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 477 | /// [$fields] - Selector specifying which fields to include in a partial |
| 478 | /// response. |
| 479 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 480 | /// 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 Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 488 | core.String applicationId, { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 489 | core.int? maxResults, |
| 490 | core.String? pageToken, |
| 491 | core.String? $fields, |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 492 | }) async { |
Kevin Moore | 6485d5a | 2021-02-08 14:56:40 -0800 | [diff] [blame] | 493 | 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 Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 498 | |
Kevin Moore | 0c926a6 | 2021-02-05 11:30:57 -0800 | [diff] [blame] | 499 | final _url = 'games/v1configuration/applications/' + |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 500 | commons.Escaper.ecapeVariable('$applicationId') + |
| 501 | '/leaderboards'; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 502 | |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 503 | final _response = await _requester.request( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 504 | _url, |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 505 | 'GET', |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 506 | queryParams: _queryParams, |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 507 | ); |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 508 | return LeaderboardConfigurationListResponse.fromJson( |
| 509 | _response as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 510 | } |
| 511 | |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 512 | /// Update the metadata of the leaderboard configuration with the given ID. |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 513 | /// |
| 514 | /// [request] - The metadata request object. |
| 515 | /// |
| 516 | /// Request parameters: |
| 517 | /// |
| 518 | /// [leaderboardId] - The ID of the leaderboard. |
| 519 | /// |
Martin Kustermann | 7a3b5f5 | 2017-10-23 11:34:19 +0200 | [diff] [blame] | 520 | /// [$fields] - Selector specifying which fields to include in a partial |
| 521 | /// response. |
| 522 | /// |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 523 | /// 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 Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 531 | LeaderboardConfiguration request, |
| 532 | core.String leaderboardId, { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 533 | core.String? $fields, |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 534 | }) async { |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 535 | final _body = convert.json.encode(request.toJson()); |
Kevin Moore | 6485d5a | 2021-02-08 14:56:40 -0800 | [diff] [blame] | 536 | final _queryParams = <core.String, core.List<core.String>>{ |
| 537 | if ($fields != null) 'fields': [$fields], |
| 538 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 539 | |
Kevin Moore | 0c926a6 | 2021-02-05 11:30:57 -0800 | [diff] [blame] | 540 | final _url = 'games/v1configuration/leaderboards/' + |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 541 | commons.Escaper.ecapeVariable('$leaderboardId'); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 542 | |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 543 | final _response = await _requester.request( |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 544 | _url, |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 545 | 'PUT', |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 546 | body: _body, |
| 547 | queryParams: _queryParams, |
Kevin Moore | 6d21e90 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 548 | ); |
Kevin Moore | dc994e8 | 2021-02-05 09:36:45 -0800 | [diff] [blame] | 549 | return LeaderboardConfiguration.fromJson( |
| 550 | _response as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 551 | } |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 552 | } |
| 553 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 554 | /// An achievement configuration resource. |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 555 | class AchievementConfiguration { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 556 | /// The type of the achievement. |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 557 | /// 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 Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 561 | core.String? achievementType; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 562 | |
| 563 | /// The draft data of the achievement. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 564 | AchievementConfigurationDetail? draft; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 565 | |
| 566 | /// The ID of the achievement. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 567 | core.String? id; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 568 | |
| 569 | /// The initial state of the achievement. |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 570 | /// 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 Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 574 | core.String? initialState; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 575 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 576 | /// Uniquely identifies the type of this resource. |
| 577 | /// |
| 578 | /// Value is always the fixed string |
| 579 | /// `gamesConfiguration#achievementConfiguration`. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 580 | core.String? kind; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 581 | |
| 582 | /// The read-only published data of the achievement. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 583 | AchievementConfigurationDetail? published; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 584 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 585 | /// Steps to unlock. |
| 586 | /// |
| 587 | /// Only applicable to incremental achievements. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 588 | core.int? stepsToUnlock; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 589 | |
| 590 | /// The token for this resource. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 591 | core.String? token; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 592 | |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 593 | AchievementConfiguration(); |
| 594 | |
| 595 | AchievementConfiguration.fromJson(core.Map _json) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 596 | if (_json.containsKey('achievementType')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 597 | achievementType = _json['achievementType'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 598 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 599 | if (_json.containsKey('draft')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 600 | draft = AchievementConfigurationDetail.fromJson( |
| 601 | _json['draft'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 602 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 603 | if (_json.containsKey('id')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 604 | id = _json['id'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 605 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 606 | if (_json.containsKey('initialState')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 607 | initialState = _json['initialState'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 608 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 609 | if (_json.containsKey('kind')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 610 | kind = _json['kind'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 611 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 612 | if (_json.containsKey('published')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 613 | published = AchievementConfigurationDetail.fromJson( |
| 614 | _json['published'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 615 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 616 | if (_json.containsKey('stepsToUnlock')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 617 | stepsToUnlock = _json['stepsToUnlock'] as core.int; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 618 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 619 | if (_json.containsKey('token')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 620 | token = _json['token'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 621 | } |
| 622 | } |
| 623 | |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 624 | 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 Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 633 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 634 | } |
| 635 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 636 | /// An achievement configuration detail. |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 637 | class AchievementConfigurationDetail { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 638 | /// Localized strings for the achievement description. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 639 | LocalizedStringBundle? description; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 640 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 641 | /// The icon url of this achievement. |
| 642 | /// |
| 643 | /// Writes to this field are ignored. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 644 | core.String? iconUrl; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 645 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 646 | /// Uniquely identifies the type of this resource. |
| 647 | /// |
| 648 | /// Value is always the fixed string |
| 649 | /// `gamesConfiguration#achievementConfigurationDetail`. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 650 | core.String? kind; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 651 | |
| 652 | /// Localized strings for the achievement name. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 653 | LocalizedStringBundle? name; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 654 | |
| 655 | /// Point value for the achievement. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 656 | core.int? pointValue; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 657 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 658 | /// The sort rank of this achievement. |
| 659 | /// |
| 660 | /// Writes to this field are ignored. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 661 | core.int? sortRank; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 662 | |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 663 | AchievementConfigurationDetail(); |
| 664 | |
| 665 | AchievementConfigurationDetail.fromJson(core.Map _json) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 666 | if (_json.containsKey('description')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 667 | description = LocalizedStringBundle.fromJson( |
| 668 | _json['description'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 669 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 670 | if (_json.containsKey('iconUrl')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 671 | iconUrl = _json['iconUrl'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 672 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 673 | if (_json.containsKey('kind')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 674 | kind = _json['kind'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 675 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 676 | if (_json.containsKey('name')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 677 | name = LocalizedStringBundle.fromJson( |
| 678 | _json['name'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 679 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 680 | if (_json.containsKey('pointValue')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 681 | pointValue = _json['pointValue'] as core.int; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 682 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 683 | if (_json.containsKey('sortRank')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 684 | sortRank = _json['sortRank'] as core.int; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 685 | } |
| 686 | } |
| 687 | |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 688 | 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 Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 695 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 696 | } |
| 697 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 698 | /// A ListConfigurations response. |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 699 | class AchievementConfigurationListResponse { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 700 | /// The achievement configurations. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 701 | core.List<AchievementConfiguration>? items; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 702 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 703 | /// Uniquely identifies the type of this resource. |
| 704 | /// |
| 705 | /// Value is always the fixed string |
| 706 | /// `gamesConfiguration#achievementConfigurationListResponse`. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 707 | core.String? kind; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 708 | |
| 709 | /// The pagination token for the next page of results. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 710 | core.String? nextPageToken; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 711 | |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 712 | AchievementConfigurationListResponse(); |
| 713 | |
| 714 | AchievementConfigurationListResponse.fromJson(core.Map _json) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 715 | if (_json.containsKey('items')) { |
| 716 | items = (_json['items'] as core.List) |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 717 | .map<AchievementConfiguration>((value) => |
| 718 | AchievementConfiguration.fromJson( |
| 719 | value as core.Map<core.String, core.dynamic>)) |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 720 | .toList(); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 721 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 722 | if (_json.containsKey('kind')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 723 | kind = _json['kind'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 724 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 725 | if (_json.containsKey('nextPageToken')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 726 | nextPageToken = _json['nextPageToken'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 727 | } |
| 728 | } |
| 729 | |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 730 | core.Map<core.String, core.Object?> toJson() => { |
Kevin Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 731 | if (items != null) |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 732 | 'items': items!.map((value) => value.toJson()).toList(), |
| 733 | if (kind != null) 'kind': kind!, |
| 734 | if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
Kevin Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 735 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 736 | } |
| 737 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 738 | /// A number affix resource. |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 739 | class GamesNumberAffixConfiguration { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 740 | /// When the language requires special treatment of "small" numbers (as with |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 741 | /// 2, 3, and 4 in Czech; or numbers ending 2, 3, or 4 but not 12, 13, or 14 |
| 742 | /// in Polish). |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 743 | LocalizedStringBundle? few; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 744 | |
| 745 | /// When the language requires special treatment of "large" numbers (as with |
| 746 | /// numbers ending 11-99 in Maltese). |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 747 | LocalizedStringBundle? many; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 748 | |
| 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 Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 752 | LocalizedStringBundle? one; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 753 | |
| 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 Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 756 | LocalizedStringBundle? other; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 757 | |
| 758 | /// When the language requires special treatment of numbers like two (as with |
Jonas Finnemann Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 759 | /// 2 in Welsh, or 102 in Slovenian). |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 760 | LocalizedStringBundle? two; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 761 | |
| 762 | /// When the language requires special treatment of the number 0 (as in |
| 763 | /// Arabic). |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 764 | LocalizedStringBundle? zero; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 765 | |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 766 | GamesNumberAffixConfiguration(); |
| 767 | |
| 768 | GamesNumberAffixConfiguration.fromJson(core.Map _json) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 769 | if (_json.containsKey('few')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 770 | few = LocalizedStringBundle.fromJson( |
| 771 | _json['few'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 772 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 773 | if (_json.containsKey('many')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 774 | many = LocalizedStringBundle.fromJson( |
| 775 | _json['many'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 776 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 777 | if (_json.containsKey('one')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 778 | one = LocalizedStringBundle.fromJson( |
| 779 | _json['one'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 780 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 781 | if (_json.containsKey('other')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 782 | other = LocalizedStringBundle.fromJson( |
| 783 | _json['other'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 784 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 785 | if (_json.containsKey('two')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 786 | two = LocalizedStringBundle.fromJson( |
| 787 | _json['two'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 788 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 789 | if (_json.containsKey('zero')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 790 | zero = LocalizedStringBundle.fromJson( |
| 791 | _json['zero'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 792 | } |
| 793 | } |
| 794 | |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 795 | 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 Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 802 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 803 | } |
| 804 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 805 | /// A number format resource. |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 806 | class GamesNumberFormatConfiguration { |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 807 | /// The curreny code string. |
| 808 | /// |
| 809 | /// Only used for CURRENCY format type. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 810 | core.String? currencyCode; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 811 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 812 | /// The number of decimal places for number. |
| 813 | /// |
| 814 | /// Only used for NUMERIC format type. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 815 | core.int? numDecimalPlaces; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 816 | |
| 817 | /// The formatting for the number. |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 818 | /// 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 Jensen | ef0c8a3 | 2020-10-07 20:58:20 +0200 | [diff] [blame] | 821 | /// digits after the decimal point according to locale. An optional custom |
| 822 | /// unit can be added. |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 823 | /// - "TIME_DURATION" : Numbers are formatted to hours, minutes and seconds. |
| 824 | /// - "CURRENCY" : Numbers are formatted to currency according to locale. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 825 | core.String? numberFormatType; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 826 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 827 | /// An optional suffix for the NUMERIC format type. |
| 828 | /// |
| 829 | /// These strings follow the same plural rules as all Android string |
| 830 | /// resources. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 831 | GamesNumberAffixConfiguration? suffix; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 832 | |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 833 | GamesNumberFormatConfiguration(); |
| 834 | |
| 835 | GamesNumberFormatConfiguration.fromJson(core.Map _json) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 836 | if (_json.containsKey('currencyCode')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 837 | currencyCode = _json['currencyCode'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 838 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 839 | if (_json.containsKey('numDecimalPlaces')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 840 | numDecimalPlaces = _json['numDecimalPlaces'] as core.int; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 841 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 842 | if (_json.containsKey('numberFormatType')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 843 | numberFormatType = _json['numberFormatType'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 844 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 845 | if (_json.containsKey('suffix')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 846 | suffix = GamesNumberAffixConfiguration.fromJson( |
| 847 | _json['suffix'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 848 | } |
| 849 | } |
| 850 | |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 851 | 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 Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 856 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 857 | } |
| 858 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 859 | /// An image configuration resource. |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 860 | class ImageConfiguration { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 861 | /// The image type for the image. |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 862 | /// 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 Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 866 | core.String? imageType; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 867 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 868 | /// Uniquely identifies the type of this resource. |
| 869 | /// |
| 870 | /// Value is always the fixed string `gamesConfiguration#imageConfiguration`. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 871 | core.String? kind; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 872 | |
| 873 | /// The resource ID of resource which the image belongs to. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 874 | core.String? resourceId; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 875 | |
| 876 | /// The url for this image. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 877 | core.String? url; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 878 | |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 879 | ImageConfiguration(); |
| 880 | |
| 881 | ImageConfiguration.fromJson(core.Map _json) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 882 | if (_json.containsKey('imageType')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 883 | imageType = _json['imageType'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 884 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 885 | if (_json.containsKey('kind')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 886 | kind = _json['kind'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 887 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 888 | if (_json.containsKey('resourceId')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 889 | resourceId = _json['resourceId'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 890 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 891 | if (_json.containsKey('url')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 892 | url = _json['url'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 893 | } |
| 894 | } |
| 895 | |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 896 | 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 Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 901 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 902 | } |
| 903 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 904 | /// An leaderboard configuration resource. |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 905 | class LeaderboardConfiguration { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 906 | /// The draft data of the leaderboard. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 907 | LeaderboardConfigurationDetail? draft; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 908 | |
| 909 | /// The ID of the leaderboard. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 910 | core.String? id; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 911 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 912 | /// Uniquely identifies the type of this resource. |
| 913 | /// |
| 914 | /// Value is always the fixed string |
| 915 | /// `gamesConfiguration#leaderboardConfiguration`. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 916 | core.String? kind; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 917 | |
| 918 | /// The read-only published data of the leaderboard. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 919 | LeaderboardConfigurationDetail? published; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 920 | |
| 921 | /// Maximum score that can be posted to this leaderboard. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 922 | core.String? scoreMax; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 923 | |
| 924 | /// Minimum score that can be posted to this leaderboard. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 925 | core.String? scoreMin; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 926 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 927 | /// |
| 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 Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 932 | core.String? scoreOrder; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 933 | |
| 934 | /// The token for this resource. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 935 | core.String? token; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 936 | |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 937 | LeaderboardConfiguration(); |
| 938 | |
| 939 | LeaderboardConfiguration.fromJson(core.Map _json) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 940 | if (_json.containsKey('draft')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 941 | draft = LeaderboardConfigurationDetail.fromJson( |
| 942 | _json['draft'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 943 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 944 | if (_json.containsKey('id')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 945 | id = _json['id'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 946 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 947 | if (_json.containsKey('kind')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 948 | kind = _json['kind'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 949 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 950 | if (_json.containsKey('published')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 951 | published = LeaderboardConfigurationDetail.fromJson( |
| 952 | _json['published'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 953 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 954 | if (_json.containsKey('scoreMax')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 955 | scoreMax = _json['scoreMax'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 956 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 957 | if (_json.containsKey('scoreMin')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 958 | scoreMin = _json['scoreMin'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 959 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 960 | if (_json.containsKey('scoreOrder')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 961 | scoreOrder = _json['scoreOrder'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 962 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 963 | if (_json.containsKey('token')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 964 | token = _json['token'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 965 | } |
| 966 | } |
| 967 | |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 968 | 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 Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 977 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 978 | } |
| 979 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 980 | /// A leaderboard configuration detail. |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 981 | class LeaderboardConfigurationDetail { |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 982 | /// The icon url of this leaderboard. |
| 983 | /// |
| 984 | /// Writes to this field are ignored. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 985 | core.String? iconUrl; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 986 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 987 | /// Uniquely identifies the type of this resource. |
| 988 | /// |
| 989 | /// Value is always the fixed string |
| 990 | /// `gamesConfiguration#leaderboardConfigurationDetail`. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 991 | core.String? kind; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 992 | |
| 993 | /// Localized strings for the leaderboard name. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 994 | LocalizedStringBundle? name; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 995 | |
| 996 | /// The score formatting for the leaderboard. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 997 | GamesNumberFormatConfiguration? scoreFormat; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 998 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 999 | /// The sort rank of this leaderboard. |
| 1000 | /// |
| 1001 | /// Writes to this field are ignored. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1002 | core.int? sortRank; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1003 | |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1004 | LeaderboardConfigurationDetail(); |
| 1005 | |
| 1006 | LeaderboardConfigurationDetail.fromJson(core.Map _json) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1007 | if (_json.containsKey('iconUrl')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 1008 | iconUrl = _json['iconUrl'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1009 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1010 | if (_json.containsKey('kind')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 1011 | kind = _json['kind'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1012 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1013 | if (_json.containsKey('name')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1014 | name = LocalizedStringBundle.fromJson( |
| 1015 | _json['name'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1016 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1017 | if (_json.containsKey('scoreFormat')) { |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1018 | scoreFormat = GamesNumberFormatConfiguration.fromJson( |
| 1019 | _json['scoreFormat'] as core.Map<core.String, core.dynamic>); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1020 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1021 | if (_json.containsKey('sortRank')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 1022 | sortRank = _json['sortRank'] as core.int; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1023 | } |
| 1024 | } |
| 1025 | |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1026 | 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 Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 1032 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1033 | } |
| 1034 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1035 | /// A ListConfigurations response. |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1036 | class LeaderboardConfigurationListResponse { |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1037 | /// The leaderboard configurations. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1038 | core.List<LeaderboardConfiguration>? items; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1039 | |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 1040 | /// Uniquely identifies the type of this resource. |
| 1041 | /// |
| 1042 | /// Value is always the fixed string |
| 1043 | /// `gamesConfiguration#leaderboardConfigurationListResponse`. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1044 | core.String? kind; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1045 | |
| 1046 | /// The pagination token for the next page of results. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1047 | core.String? nextPageToken; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1048 | |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1049 | LeaderboardConfigurationListResponse(); |
| 1050 | |
| 1051 | LeaderboardConfigurationListResponse.fromJson(core.Map _json) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1052 | if (_json.containsKey('items')) { |
| 1053 | items = (_json['items'] as core.List) |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1054 | .map<LeaderboardConfiguration>((value) => |
| 1055 | LeaderboardConfiguration.fromJson( |
| 1056 | value as core.Map<core.String, core.dynamic>)) |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1057 | .toList(); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1058 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1059 | if (_json.containsKey('kind')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 1060 | kind = _json['kind'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1061 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1062 | if (_json.containsKey('nextPageToken')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 1063 | nextPageToken = _json['nextPageToken'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1064 | } |
| 1065 | } |
| 1066 | |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1067 | core.Map<core.String, core.Object?> toJson() => { |
Kevin Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 1068 | if (items != null) |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1069 | 'items': items!.map((value) => value.toJson()).toList(), |
| 1070 | if (kind != null) 'kind': kind!, |
| 1071 | if (nextPageToken != null) 'nextPageToken': nextPageToken!, |
Kevin Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 1072 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1073 | } |
| 1074 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1075 | /// A localized string resource. |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1076 | class LocalizedString { |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 1077 | /// Uniquely identifies the type of this resource. |
| 1078 | /// |
| 1079 | /// Value is always the fixed string `gamesConfiguration#localizedString`. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1080 | core.String? kind; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1081 | |
| 1082 | /// The locale string. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1083 | core.String? locale; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1084 | |
| 1085 | /// The string value. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1086 | core.String? value; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1087 | |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1088 | LocalizedString(); |
| 1089 | |
| 1090 | LocalizedString.fromJson(core.Map _json) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1091 | if (_json.containsKey('kind')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 1092 | kind = _json['kind'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1093 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1094 | if (_json.containsKey('locale')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 1095 | locale = _json['locale'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1096 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1097 | if (_json.containsKey('value')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 1098 | value = _json['value'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1099 | } |
| 1100 | } |
| 1101 | |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1102 | 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 Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 1106 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1107 | } |
| 1108 | |
Jonas Finnemann Jensen | 94d5b4d | 2020-05-07 12:00:14 +0200 | [diff] [blame] | 1109 | /// A localized string bundle resource. |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1110 | class LocalizedStringBundle { |
Kevin Moore | a7bb177 | 2021-01-28 16:13:03 -0800 | [diff] [blame] | 1111 | /// Uniquely identifies the type of this resource. |
| 1112 | /// |
| 1113 | /// Value is always the fixed string |
| 1114 | /// `gamesConfiguration#localizedStringBundle`. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1115 | core.String? kind; |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1116 | |
| 1117 | /// The locale strings. |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1118 | core.List<LocalizedString>? translations; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1119 | |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1120 | LocalizedStringBundle(); |
| 1121 | |
| 1122 | LocalizedStringBundle.fromJson(core.Map _json) { |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1123 | if (_json.containsKey('kind')) { |
Kevin Moore | f03b2ee | 2021-01-25 10:57:57 -0800 | [diff] [blame] | 1124 | kind = _json['kind'] as core.String; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1125 | } |
Kevin Moore | d025170 | 2021-01-15 06:41:08 -0800 | [diff] [blame] | 1126 | if (_json.containsKey('translations')) { |
| 1127 | translations = (_json['translations'] as core.List) |
Kevin Moore | c4dbd8e | 2021-01-26 14:40:35 -0800 | [diff] [blame] | 1128 | .map<LocalizedString>((value) => LocalizedString.fromJson( |
| 1129 | value as core.Map<core.String, core.dynamic>)) |
Martin Kustermann | 5eb85c1 | 2017-09-11 12:35:54 +0200 | [diff] [blame] | 1130 | .toList(); |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1131 | } |
| 1132 | } |
| 1133 | |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1134 | core.Map<core.String, core.Object?> toJson() => { |
| 1135 | if (kind != null) 'kind': kind!, |
Kevin Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 1136 | if (translations != null) |
Kevin Moore | 58e2233 | 2021-02-25 10:11:41 -0800 | [diff] [blame] | 1137 | 'translations': translations!.map((value) => value.toJson()).toList(), |
Kevin Moore | c321b0a | 2021-02-08 12:27:09 -0800 | [diff] [blame] | 1138 | }; |
Gustav Wibling | 1152ab6 | 2015-02-05 13:00:55 +0100 | [diff] [blame] | 1139 | } |