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