| 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.cloudbilling.v1; | 3 library googleapis.cloudbilling.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' show |
| 13 ApiRequestError, DetailedApiRequestError; | 13 ApiRequestError, DetailedApiRequestError; |
| 14 | 14 |
| 15 const core.String USER_AGENT = 'dart-api-client cloudbilling/v1'; | 15 const core.String USER_AGENT = 'dart-api-client cloudbilling/v1'; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * Retrieves Google Developers Console billing accounts and associates them with | 18 * Allows developers to manage billing for their Google Cloud Platform projects |
| 19 * projects. | 19 * programmatically. |
| 20 */ | 20 */ |
| 21 class CloudbillingApi { | 21 class CloudbillingApi { |
| 22 /** View and manage your data across Google Cloud Platform services */ | 22 /** View and manage your data across Google Cloud Platform services */ |
| 23 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; | 23 static const CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platf
orm"; |
| 24 | 24 |
| 25 | 25 |
| 26 final commons.ApiRequester _requester; | 26 final commons.ApiRequester _requester; |
| 27 | 27 |
| 28 BillingAccountsResourceApi get billingAccounts => new BillingAccountsResourceA
pi(_requester); | 28 BillingAccountsResourceApi get billingAccounts => new BillingAccountsResourceA
pi(_requester); |
| 29 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); | 29 ProjectsResourceApi get projects => new ProjectsResourceApi(_requester); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * Gets information about a billing account. The current authenticated user | 45 * Gets information about a billing account. The current authenticated user |
| 46 * must be an [owner of the billing | 46 * must be an [owner of the billing |
| 47 * account](https://support.google.com/cloud/answer/4430947). | 47 * account](https://support.google.com/cloud/answer/4430947). |
| 48 * | 48 * |
| 49 * Request parameters: | 49 * Request parameters: |
| 50 * | 50 * |
| 51 * [name] - The resource name of the billing account to retrieve. For example, | 51 * [name] - The resource name of the billing account to retrieve. For example, |
| 52 * `billingAccounts/012345-567890-ABCDEF`. | 52 * `billingAccounts/012345-567890-ABCDEF`. |
| 53 * Value must have pattern "^billingAccounts/[^/]*$". | 53 * Value must have pattern "^billingAccounts/[^/]+$". |
| 54 * | 54 * |
| 55 * Completes with a [BillingAccount]. | 55 * Completes with a [BillingAccount]. |
| 56 * | 56 * |
| 57 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 57 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 58 * error. | 58 * error. |
| 59 * | 59 * |
| 60 * If the used [http.Client] completes with an error when making a REST call, | 60 * If the used [http.Client] completes with an error when making a REST call, |
| 61 * this method will complete with the same error. | 61 * this method will complete with the same error. |
| 62 */ | 62 */ |
| 63 async.Future<BillingAccount> get(core.String name) { | 63 async.Future<BillingAccount> get(core.String name) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 84 return _response.then((data) => new BillingAccount.fromJson(data)); | 84 return _response.then((data) => new BillingAccount.fromJson(data)); |
| 85 } | 85 } |
| 86 | 86 |
| 87 /** | 87 /** |
| 88 * Lists the billing accounts that the current authenticated user | 88 * Lists the billing accounts that the current authenticated user |
| 89 * [owns](https://support.google.com/cloud/answer/4430947). | 89 * [owns](https://support.google.com/cloud/answer/4430947). |
| 90 * | 90 * |
| 91 * Request parameters: | 91 * Request parameters: |
| 92 * | 92 * |
| 93 * [pageSize] - Requested page size. The maximum page size is 100; this is | 93 * [pageSize] - Requested page size. The maximum page size is 100; this is |
| 94 * also the default. | 94 * also the |
| 95 * default. |
| 95 * | 96 * |
| 96 * [pageToken] - A token identifying a page of results to return. This should | 97 * [pageToken] - A token identifying a page of results to return. This should |
| 97 * be a `next_page_token` value returned from a previous `ListBillingAccounts` | 98 * be a |
| 99 * `next_page_token` value returned from a previous `ListBillingAccounts` |
| 98 * call. If unspecified, the first page of results is returned. | 100 * call. If unspecified, the first page of results is returned. |
| 99 * | 101 * |
| 100 * Completes with a [ListBillingAccountsResponse]. | 102 * Completes with a [ListBillingAccountsResponse]. |
| 101 * | 103 * |
| 102 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 104 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 103 * error. | 105 * error. |
| 104 * | 106 * |
| 105 * If the used [http.Client] completes with an error when making a REST call, | 107 * If the used [http.Client] completes with an error when making a REST call, |
| 106 * this method will complete with the same error. | 108 * this method will complete with the same error. |
| 107 */ | 109 */ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 _requester = client; | 144 _requester = client; |
| 143 | 145 |
| 144 /** | 146 /** |
| 145 * Lists the projects associated with a billing account. The current | 147 * Lists the projects associated with a billing account. The current |
| 146 * authenticated user must be an [owner of the billing | 148 * authenticated user must be an [owner of the billing |
| 147 * account](https://support.google.com/cloud/answer/4430947). | 149 * account](https://support.google.com/cloud/answer/4430947). |
| 148 * | 150 * |
| 149 * Request parameters: | 151 * Request parameters: |
| 150 * | 152 * |
| 151 * [name] - The resource name of the billing account associated with the | 153 * [name] - The resource name of the billing account associated with the |
| 152 * projects that you want to list. For example, | 154 * projects that |
| 153 * `billingAccounts/012345-567890-ABCDEF`. | 155 * you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. |
| 154 * Value must have pattern "^billingAccounts/[^/]*$". | 156 * Value must have pattern "^billingAccounts/[^/]+$". |
| 155 * | 157 * |
| 156 * [pageSize] - Requested page size. The maximum page size is 100; this is | 158 * [pageSize] - Requested page size. The maximum page size is 100; this is |
| 157 * also the default. | 159 * also the |
| 160 * default. |
| 158 * | 161 * |
| 159 * [pageToken] - A token identifying a page of results to be returned. This | 162 * [pageToken] - A token identifying a page of results to be returned. This |
| 160 * should be a `next_page_token` value returned from a previous | 163 * should be a |
| 161 * `ListProjectBillingInfo` call. If unspecified, the first page of results is | 164 * `next_page_token` value returned from a previous `ListProjectBillingInfo` |
| 162 * returned. | 165 * call. If unspecified, the first page of results is returned. |
| 163 * | 166 * |
| 164 * Completes with a [ListProjectBillingInfoResponse]. | 167 * Completes with a [ListProjectBillingInfoResponse]. |
| 165 * | 168 * |
| 166 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 169 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 167 * error. | 170 * error. |
| 168 * | 171 * |
| 169 * If the used [http.Client] completes with an error when making a REST call, | 172 * If the used [http.Client] completes with an error when making a REST call, |
| 170 * this method will complete with the same error. | 173 * this method will complete with the same error. |
| 171 */ | 174 */ |
| 172 async.Future<ListProjectBillingInfoResponse> list(core.String name, {core.int
pageSize, core.String pageToken}) { | 175 async.Future<ListProjectBillingInfoResponse> list(core.String name, {core.int
pageSize, core.String pageToken}) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 /** | 214 /** |
| 212 * Gets the billing information for a project. The current authenticated user | 215 * Gets the billing information for a project. The current authenticated user |
| 213 * must have [permission to view the | 216 * must have [permission to view the |
| 214 * project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo | 217 * project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo |
| 215 * ). | 218 * ). |
| 216 * | 219 * |
| 217 * Request parameters: | 220 * Request parameters: |
| 218 * | 221 * |
| 219 * [name] - The resource name of the project for which billing information is | 222 * [name] - The resource name of the project for which billing information is |
| 220 * retrieved. For example, `projects/tokyo-rain-123`. | 223 * retrieved. For example, `projects/tokyo-rain-123`. |
| 221 * Value must have pattern "^projects/[^/]*$". | 224 * Value must have pattern "^projects/[^/]+$". |
| 222 * | 225 * |
| 223 * Completes with a [ProjectBillingInfo]. | 226 * Completes with a [ProjectBillingInfo]. |
| 224 * | 227 * |
| 225 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 228 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 226 * error. | 229 * error. |
| 227 * | 230 * |
| 228 * If the used [http.Client] completes with an error when making a REST call, | 231 * If the used [http.Client] completes with an error when making a REST call, |
| 229 * this method will complete with the same error. | 232 * this method will complete with the same error. |
| 230 */ | 233 */ |
| 231 async.Future<ProjectBillingInfo> getBillingInfo(core.String name) { | 234 async.Future<ProjectBillingInfo> getBillingInfo(core.String name) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 252 return _response.then((data) => new ProjectBillingInfo.fromJson(data)); | 255 return _response.then((data) => new ProjectBillingInfo.fromJson(data)); |
| 253 } | 256 } |
| 254 | 257 |
| 255 /** | 258 /** |
| 256 * Sets or updates the billing account associated with a project. You specify | 259 * Sets or updates the billing account associated with a project. You specify |
| 257 * the new billing account by setting the `billing_account_name` in the | 260 * the new billing account by setting the `billing_account_name` in the |
| 258 * `ProjectBillingInfo` resource to the resource name of a billing account. | 261 * `ProjectBillingInfo` resource to the resource name of a billing account. |
| 259 * Associating a project with an open billing account enables billing on the | 262 * Associating a project with an open billing account enables billing on the |
| 260 * project and allows charges for resource usage. If the project already had a | 263 * project and allows charges for resource usage. If the project already had a |
| 261 * billing account, this method changes the billing account used for resource | 264 * billing account, this method changes the billing account used for resource |
| 262 * usage charges. *Note:* Incurred charges that have not yet been reported in | 265 * usage charges. |
| 263 * the transaction history of the Google Developers Console may be billed to | 266 * |
| 264 * the new billing account, even if the charge occurred before the new billing | 267 * *Note:* Incurred charges that have not yet been reported in the transaction |
| 265 * account was assigned to the project. The current authenticated user must | 268 * history of the Google Cloud Console may be billed to the new billing |
| 266 * have ownership privileges for both the | 269 * account, even if the charge occurred before the new billing account was |
| 270 * assigned to the project. |
| 271 * |
| 272 * The current authenticated user must have ownership privileges for both the |
| 267 * [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo | 273 * [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo |
| 268 * ) and the [billing | 274 * ) and the [billing |
| 269 * account](https://support.google.com/cloud/answer/4430947). You can disable | 275 * account](https://support.google.com/cloud/answer/4430947). |
| 270 * billing on the project by setting the `billing_account_name` field to | 276 * |
| 271 * empty. This action disassociates the current billing account from the | 277 * You can disable billing on the project by setting the |
| 272 * project. Any billable activity of your in-use services will stop, and your | 278 * `billing_account_name` field to empty. This action disassociates the |
| 273 * application could stop functioning as expected. Any unbilled charges to | 279 * current billing account from the project. Any billable activity of your |
| 274 * date will be billed to the previously associated account. The current | 280 * in-use services will stop, and your application could stop functioning as |
| 275 * authenticated user must be either an owner of the project or an owner of | 281 * expected. Any unbilled charges to date will be billed to the previously |
| 276 * the billing account for the project. Note that associating a project with a | 282 * associated account. The current authenticated user must be either an owner |
| 277 * *closed* billing account will have much the same effect as disabling | 283 * of the project or an owner of the billing account for the project. |
| 278 * billing on the project: any paid resources used by the project will be shut | 284 * |
| 279 * down. Thus, unless you wish to disable billing, you should always call this | 285 * Note that associating a project with a *closed* billing account will have |
| 280 * method with the name of an *open* billing account. | 286 * much the same effect as disabling billing on the project: any paid |
| 287 * resources used by the project will be shut down. Thus, unless you wish to |
| 288 * disable billing, you should always call this method with the name of an |
| 289 * *open* billing account. |
| 281 * | 290 * |
| 282 * [request] - The metadata request object. | 291 * [request] - The metadata request object. |
| 283 * | 292 * |
| 284 * Request parameters: | 293 * Request parameters: |
| 285 * | 294 * |
| 286 * [name] - The resource name of the project associated with the billing | 295 * [name] - The resource name of the project associated with the billing |
| 287 * information that you want to update. For example, | 296 * information |
| 288 * `projects/tokyo-rain-123`. | 297 * that you want to update. For example, `projects/tokyo-rain-123`. |
| 289 * Value must have pattern "^projects/[^/]*$". | 298 * Value must have pattern "^projects/[^/]+$". |
| 290 * | 299 * |
| 291 * Completes with a [ProjectBillingInfo]. | 300 * Completes with a [ProjectBillingInfo]. |
| 292 * | 301 * |
| 293 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 302 * Completes with a [commons.ApiRequestError] if the API endpoint returned an |
| 294 * error. | 303 * error. |
| 295 * | 304 * |
| 296 * If the used [http.Client] completes with an error when making a REST call, | 305 * If the used [http.Client] completes with an error when making a REST call, |
| 297 * this method will complete with the same error. | 306 * this method will complete with the same error. |
| 298 */ | 307 */ |
| 299 async.Future<ProjectBillingInfo> updateBillingInfo(ProjectBillingInfo request,
core.String name) { | 308 async.Future<ProjectBillingInfo> updateBillingInfo(ProjectBillingInfo request,
core.String name) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 321 uploadMedia: _uploadMedia, | 330 uploadMedia: _uploadMedia, |
| 322 downloadOptions: _downloadOptions); | 331 downloadOptions: _downloadOptions); |
| 323 return _response.then((data) => new ProjectBillingInfo.fromJson(data)); | 332 return _response.then((data) => new ProjectBillingInfo.fromJson(data)); |
| 324 } | 333 } |
| 325 | 334 |
| 326 } | 335 } |
| 327 | 336 |
| 328 | 337 |
| 329 | 338 |
| 330 /** | 339 /** |
| 331 * A billing account in [Google Developers | 340 * A billing account in [Google Cloud |
| 332 * Console](https://console.developers.google.com/). You can assign a billing | 341 * Console](https://console.cloud.google.com/). You can assign a billing account |
| 333 * account to one or more projects. | 342 * to one or more projects. |
| 334 */ | 343 */ |
| 335 class BillingAccount { | 344 class BillingAccount { |
| 336 /** | 345 /** |
| 337 * The display name given to the billing account, such as `My Billing | 346 * The display name given to the billing account, such as `My Billing |
| 338 * Account`. This name is displayed in the Google Developers Console. | 347 * Account`. This name is displayed in the Google Cloud Console. |
| 339 */ | 348 */ |
| 340 core.String displayName; | 349 core.String displayName; |
| 341 /** | 350 /** |
| 342 * The resource name of the billing account. The resource name has the form | 351 * The resource name of the billing account. The resource name has the form |
| 343 * `billingAccounts/{billing_account_id}`. For example, | 352 * `billingAccounts/{billing_account_id}`. For example, |
| 344 * `billingAccounts/012345-567890-ABCDEF` would be the resource name for | 353 * `billingAccounts/012345-567890-ABCDEF` would be the resource name for |
| 345 * billing account `012345-567890-ABCDEF`. | 354 * billing account `012345-567890-ABCDEF`. |
| 346 */ | 355 */ |
| 347 core.String name; | 356 core.String name; |
| 348 /** | 357 /** |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 _json["nextPageToken"] = nextPageToken; | 455 _json["nextPageToken"] = nextPageToken; |
| 447 } | 456 } |
| 448 if (projectBillingInfo != null) { | 457 if (projectBillingInfo != null) { |
| 449 _json["projectBillingInfo"] = projectBillingInfo.map((value) => (value).to
Json()).toList(); | 458 _json["projectBillingInfo"] = projectBillingInfo.map((value) => (value).to
Json()).toList(); |
| 450 } | 459 } |
| 451 return _json; | 460 return _json; |
| 452 } | 461 } |
| 453 } | 462 } |
| 454 | 463 |
| 455 /** | 464 /** |
| 456 * Encapsulation of billing information for a Developers Console project. A | 465 * Encapsulation of billing information for a Cloud Console project. A project |
| 457 * project has at most one associated billing account at a time (but a billing | 466 * has at most one associated billing account at a time (but a billing account |
| 458 * account can be assigned to multiple projects). | 467 * can be assigned to multiple projects). |
| 459 */ | 468 */ |
| 460 class ProjectBillingInfo { | 469 class ProjectBillingInfo { |
| 461 /** | 470 /** |
| 462 * The resource name of the billing account associated with the project, if | 471 * The resource name of the billing account associated with the project, if |
| 463 * any. For example, `billingAccounts/012345-567890-ABCDEF`. | 472 * any. For example, `billingAccounts/012345-567890-ABCDEF`. |
| 464 */ | 473 */ |
| 465 core.String billingAccountName; | 474 core.String billingAccountName; |
| 466 /** | 475 /** |
| 467 * True if the project is associated with an open billing account, to which | 476 * True if the project is associated with an open billing account, to which |
| 468 * usage on the project is charged. False if the project is associated with a | 477 * usage on the project is charged. False if the project is associated with a |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 } | 520 } |
| 512 if (name != null) { | 521 if (name != null) { |
| 513 _json["name"] = name; | 522 _json["name"] = name; |
| 514 } | 523 } |
| 515 if (projectId != null) { | 524 if (projectId != null) { |
| 516 _json["projectId"] = projectId; | 525 _json["projectId"] = projectId; |
| 517 } | 526 } |
| 518 return _json; | 527 return _json; |
| 519 } | 528 } |
| 520 } | 529 } |
| OLD | NEW |