OLD | NEW |
(Empty) | |
| 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 |
| 3 library googleapis.adexperiencereport.v1; |
| 4 |
| 5 import 'dart:core' as core; |
| 6 import 'dart:async' as async; |
| 7 import 'dart:convert' as convert; |
| 8 |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 10 import 'package:http/http.dart' as http; |
| 11 |
| 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show |
| 13 ApiRequestError, DetailedApiRequestError; |
| 14 |
| 15 const core.String USER_AGENT = 'dart-api-client adexperiencereport/v1'; |
| 16 |
| 17 /** |
| 18 * View Ad Experience Report data, and get a list of sites that have a |
| 19 * significant number of annoying ads. |
| 20 */ |
| 21 class AdexperiencereportApi { |
| 22 /** Test scope for access to the Zoo service */ |
| 23 static const XapiZooScope = "https://www.googleapis.com/auth/xapi.zoo"; |
| 24 |
| 25 |
| 26 final commons.ApiRequester _requester; |
| 27 |
| 28 SitesResourceApi get sites => new SitesResourceApi(_requester); |
| 29 ViolatingSitesResourceApi get violatingSites => new ViolatingSitesResourceApi(
_requester); |
| 30 |
| 31 AdexperiencereportApi(http.Client client, {core.String rootUrl: "https://adexp
eriencereport.googleapis.com/", core.String servicePath: ""}) : |
| 32 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); |
| 33 } |
| 34 |
| 35 |
| 36 class SitesResourceApi { |
| 37 final commons.ApiRequester _requester; |
| 38 |
| 39 SitesResourceApi(commons.ApiRequester client) : |
| 40 _requester = client; |
| 41 |
| 42 /** |
| 43 * Gets a summary of the ads rating of a site. |
| 44 * |
| 45 * Request parameters: |
| 46 * |
| 47 * [name] - The required site name. It should be a site property registered in |
| 48 * Search |
| 49 * Console. The server will return an error of BAD_REQUEST if this field is |
| 50 * not filled in. |
| 51 * Value must have pattern "^sites/[^/]+$". |
| 52 * |
| 53 * Completes with a [SiteSummaryResponse]. |
| 54 * |
| 55 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 56 * error. |
| 57 * |
| 58 * If the used [http.Client] completes with an error when making a REST call, |
| 59 * this method will complete with the same error. |
| 60 */ |
| 61 async.Future<SiteSummaryResponse> get(core.String name) { |
| 62 var _url = null; |
| 63 var _queryParams = new core.Map(); |
| 64 var _uploadMedia = null; |
| 65 var _uploadOptions = null; |
| 66 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 67 var _body = null; |
| 68 |
| 69 if (name == null) { |
| 70 throw new core.ArgumentError("Parameter name is required."); |
| 71 } |
| 72 |
| 73 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name'); |
| 74 |
| 75 var _response = _requester.request(_url, |
| 76 "GET", |
| 77 body: _body, |
| 78 queryParams: _queryParams, |
| 79 uploadOptions: _uploadOptions, |
| 80 uploadMedia: _uploadMedia, |
| 81 downloadOptions: _downloadOptions); |
| 82 return _response.then((data) => new SiteSummaryResponse.fromJson(data)); |
| 83 } |
| 84 |
| 85 } |
| 86 |
| 87 |
| 88 class ViolatingSitesResourceApi { |
| 89 final commons.ApiRequester _requester; |
| 90 |
| 91 ViolatingSitesResourceApi(commons.ApiRequester client) : |
| 92 _requester = client; |
| 93 |
| 94 /** |
| 95 * Lists sites with Ad Experience Report statuses of "Failing" or "Warning". |
| 96 * |
| 97 * Request parameters: |
| 98 * |
| 99 * Completes with a [ViolatingSitesResponse]. |
| 100 * |
| 101 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 102 * error. |
| 103 * |
| 104 * If the used [http.Client] completes with an error when making a REST call, |
| 105 * this method will complete with the same error. |
| 106 */ |
| 107 async.Future<ViolatingSitesResponse> list() { |
| 108 var _url = null; |
| 109 var _queryParams = new core.Map(); |
| 110 var _uploadMedia = null; |
| 111 var _uploadOptions = null; |
| 112 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 113 var _body = null; |
| 114 |
| 115 |
| 116 _url = 'v1/violatingSites'; |
| 117 |
| 118 var _response = _requester.request(_url, |
| 119 "GET", |
| 120 body: _body, |
| 121 queryParams: _queryParams, |
| 122 uploadOptions: _uploadOptions, |
| 123 uploadMedia: _uploadMedia, |
| 124 downloadOptions: _downloadOptions); |
| 125 return _response.then((data) => new ViolatingSitesResponse.fromJson(data)); |
| 126 } |
| 127 |
| 128 } |
| 129 |
| 130 |
| 131 |
| 132 /** Summary of the ads rating of a site for a specific platform. */ |
| 133 class PlatformSummary { |
| 134 /** |
| 135 * The status of the site reviewed for the Better Ads Standards. |
| 136 * Possible string values are: |
| 137 * - "UNKNOWN" : Not reviewed. |
| 138 * - "PASSING" : Passing. |
| 139 * - "WARNING" : Warning. |
| 140 * - "FAILING" : Failing. |
| 141 */ |
| 142 core.String betterAdsStatus; |
| 143 /** |
| 144 * The status of the site reviewed for egregious ads. |
| 145 * Possible string values are: |
| 146 * - "UNKNOWN" : Not reviewed. |
| 147 * - "PASSING" : Passing. |
| 148 * - "FAILING" : Failing. |
| 149 */ |
| 150 core.String egregiousStatus; |
| 151 /** The date on which ad filtering begins. */ |
| 152 core.String enforcementTime; |
| 153 /** |
| 154 * The ad filtering status of the site. |
| 155 * Possible string values are: |
| 156 * - "UNKNOWN" : N/A. |
| 157 * - "ON" : Ad filtering is on. |
| 158 * - "OFF" : Ad filtering is off. |
| 159 * - "PAUSED" : Ad filtering is paused. |
| 160 * - "PENDING" : Ad filtering is pending. |
| 161 */ |
| 162 core.String filterStatus; |
| 163 /** The last time that the site changed status. */ |
| 164 core.String lastChangeTime; |
| 165 /** The assigned regions for the site and platform. */ |
| 166 core.List<core.String> region; |
| 167 /** A link that leads to a full ad experience report. */ |
| 168 core.String reportUrl; |
| 169 /** Whether the site is currently under review. */ |
| 170 core.bool underReview; |
| 171 |
| 172 PlatformSummary(); |
| 173 |
| 174 PlatformSummary.fromJson(core.Map _json) { |
| 175 if (_json.containsKey("betterAdsStatus")) { |
| 176 betterAdsStatus = _json["betterAdsStatus"]; |
| 177 } |
| 178 if (_json.containsKey("egregiousStatus")) { |
| 179 egregiousStatus = _json["egregiousStatus"]; |
| 180 } |
| 181 if (_json.containsKey("enforcementTime")) { |
| 182 enforcementTime = _json["enforcementTime"]; |
| 183 } |
| 184 if (_json.containsKey("filterStatus")) { |
| 185 filterStatus = _json["filterStatus"]; |
| 186 } |
| 187 if (_json.containsKey("lastChangeTime")) { |
| 188 lastChangeTime = _json["lastChangeTime"]; |
| 189 } |
| 190 if (_json.containsKey("region")) { |
| 191 region = _json["region"]; |
| 192 } |
| 193 if (_json.containsKey("reportUrl")) { |
| 194 reportUrl = _json["reportUrl"]; |
| 195 } |
| 196 if (_json.containsKey("underReview")) { |
| 197 underReview = _json["underReview"]; |
| 198 } |
| 199 } |
| 200 |
| 201 core.Map<core.String, core.Object> toJson() { |
| 202 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 203 if (betterAdsStatus != null) { |
| 204 _json["betterAdsStatus"] = betterAdsStatus; |
| 205 } |
| 206 if (egregiousStatus != null) { |
| 207 _json["egregiousStatus"] = egregiousStatus; |
| 208 } |
| 209 if (enforcementTime != null) { |
| 210 _json["enforcementTime"] = enforcementTime; |
| 211 } |
| 212 if (filterStatus != null) { |
| 213 _json["filterStatus"] = filterStatus; |
| 214 } |
| 215 if (lastChangeTime != null) { |
| 216 _json["lastChangeTime"] = lastChangeTime; |
| 217 } |
| 218 if (region != null) { |
| 219 _json["region"] = region; |
| 220 } |
| 221 if (reportUrl != null) { |
| 222 _json["reportUrl"] = reportUrl; |
| 223 } |
| 224 if (underReview != null) { |
| 225 _json["underReview"] = underReview; |
| 226 } |
| 227 return _json; |
| 228 } |
| 229 } |
| 230 |
| 231 /** Response message for GetSiteSummary. */ |
| 232 class SiteSummaryResponse { |
| 233 /** Summary for the desktop review of the site. */ |
| 234 PlatformSummary desktopSummary; |
| 235 /** Summary for the mobile review of the site. */ |
| 236 PlatformSummary mobileSummary; |
| 237 /** The name of the site reviewed. */ |
| 238 core.String reviewedSite; |
| 239 |
| 240 SiteSummaryResponse(); |
| 241 |
| 242 SiteSummaryResponse.fromJson(core.Map _json) { |
| 243 if (_json.containsKey("desktopSummary")) { |
| 244 desktopSummary = new PlatformSummary.fromJson(_json["desktopSummary"]); |
| 245 } |
| 246 if (_json.containsKey("mobileSummary")) { |
| 247 mobileSummary = new PlatformSummary.fromJson(_json["mobileSummary"]); |
| 248 } |
| 249 if (_json.containsKey("reviewedSite")) { |
| 250 reviewedSite = _json["reviewedSite"]; |
| 251 } |
| 252 } |
| 253 |
| 254 core.Map<core.String, core.Object> toJson() { |
| 255 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 256 if (desktopSummary != null) { |
| 257 _json["desktopSummary"] = (desktopSummary).toJson(); |
| 258 } |
| 259 if (mobileSummary != null) { |
| 260 _json["mobileSummary"] = (mobileSummary).toJson(); |
| 261 } |
| 262 if (reviewedSite != null) { |
| 263 _json["reviewedSite"] = reviewedSite; |
| 264 } |
| 265 return _json; |
| 266 } |
| 267 } |
| 268 |
| 269 /** Response message for ListViolatingSites. */ |
| 270 class ViolatingSitesResponse { |
| 271 /** A list of summaries of violating sites. */ |
| 272 core.List<SiteSummaryResponse> violatingSites; |
| 273 |
| 274 ViolatingSitesResponse(); |
| 275 |
| 276 ViolatingSitesResponse.fromJson(core.Map _json) { |
| 277 if (_json.containsKey("violatingSites")) { |
| 278 violatingSites = _json["violatingSites"].map((value) => new SiteSummaryRes
ponse.fromJson(value)).toList(); |
| 279 } |
| 280 } |
| 281 |
| 282 core.Map<core.String, core.Object> toJson() { |
| 283 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); |
| 284 if (violatingSites != null) { |
| 285 _json["violatingSites"] = violatingSites.map((value) => (value).toJson()).
toList(); |
| 286 } |
| 287 return _json; |
| 288 } |
| 289 } |
OLD | NEW |