Skip to content

Commit

Permalink
feat: [billing] added resource_reference for name in GetProjectBillin…
Browse files Browse the repository at this point in the history
…gInfoRequest message (#4356)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 541033608

Source-Link: https://togithub.com/googleapis/googleapis/commit/f78641709fd23336b303307ac4d55b5582b00fae

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/c5986a104f1d765ce6b90160e05e6976693b38ef
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpbGxpbmcvLk93bEJvdC55YW1sIiwiaCI6ImM1OTg2YTEwNGYxZDc2NWNlNmI5MDE2MGUwNWU2OTc2NjkzYjM4ZWYifQ==
  • Loading branch information
gcf-owl-bot[bot] authored Jun 20, 2023
1 parent c0a3d8a commit a77e51f
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 51 deletions.
31 changes: 15 additions & 16 deletions packages/google-cloud-billing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[//]: # "To regenerate it, use `python -m synthtool`."
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# [Cloud Billing: Node.js Client](https://github.com/googleapis/google-cloud-node)
# [Cloud Billing: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-billing)

[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/billing.svg)](https://www.npmjs.org/package/@google-cloud/billing)
Expand Down Expand Up @@ -84,24 +84,23 @@ listBillingAccounts();

## Samples

Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.
Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-billing/samples) directory. Each sample's `README.md` has instructions for running its sample.

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Cloud_billing.create_billing_account | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.create_billing_account.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.create_billing_account.js,samples/README.md) |
| Cloud_billing.get_billing_account | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_billing_account.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_billing_account.js,samples/README.md) |
| Cloud_billing.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_iam_policy.js,samples/README.md) |
| Cloud_billing.get_project_billing_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_project_billing_info.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_project_billing_info.js,samples/README.md) |
| Cloud_billing.list_billing_accounts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_billing_accounts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_billing_accounts.js,samples/README.md) |
| Cloud_billing.list_project_billing_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_project_billing_info.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_project_billing_info.js,samples/README.md) |
| Cloud_billing.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.set_iam_policy.js,samples/README.md) |
| Cloud_billing.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.test_iam_permissions.js,samples/README.md) |
| Cloud_billing.update_billing_account | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_billing_account.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_billing_account.js,samples/README.md) |
| Cloud_billing.update_project_billing_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_project_billing_info.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_project_billing_info.js,samples/README.md) |
| Cloud_catalog.list_services | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_services.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_services.js,samples/README.md) |
| Cloud_catalog.list_skus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_skus.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_skus.js,samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/quickstart.js,samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/test/quickstart.js,samples/README.md) |
| Cloud_billing.create_billing_account | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.create_billing_account.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.create_billing_account.js,packages/google-cloud-billing/samples/README.md) |
| Cloud_billing.get_billing_account | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_billing_account.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_billing_account.js,packages/google-cloud-billing/samples/README.md) |
| Cloud_billing.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_iam_policy.js,packages/google-cloud-billing/samples/README.md) |
| Cloud_billing.get_project_billing_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_project_billing_info.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_project_billing_info.js,packages/google-cloud-billing/samples/README.md) |
| Cloud_billing.list_billing_accounts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_billing_accounts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_billing_accounts.js,packages/google-cloud-billing/samples/README.md) |
| Cloud_billing.list_project_billing_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_project_billing_info.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_project_billing_info.js,packages/google-cloud-billing/samples/README.md) |
| Cloud_billing.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.set_iam_policy.js,packages/google-cloud-billing/samples/README.md) |
| Cloud_billing.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.test_iam_permissions.js,packages/google-cloud-billing/samples/README.md) |
| Cloud_billing.update_billing_account | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_billing_account.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_billing_account.js,packages/google-cloud-billing/samples/README.md) |
| Cloud_billing.update_project_billing_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_project_billing_info.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_project_billing_info.js,packages/google-cloud-billing/samples/README.md) |
| Cloud_catalog.list_services | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_services.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_services.js,packages/google-cloud-billing/samples/README.md) |
| Cloud_catalog.list_skus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_skus.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_skus.js,packages/google-cloud-billing/samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/quickstart.js,packages/google-cloud-billing/samples/README.md) |



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,26 +239,32 @@ message BillingAccount {
// project has at most one associated billing account at a time (but a billing
// account can be assigned to multiple projects).
message ProjectBillingInfo {
// The resource name for the `ProjectBillingInfo`; has the form
option (google.api.resource) = {
type: "cloudbilling.googleapis.com/ProjectBillingInfo"
pattern: "projects/{project}/billingInfo"
};

// Output only. The resource name for the `ProjectBillingInfo`; has the form
// `projects/{project_id}/billingInfo`. For example, the resource name for the
// billing information for project `tokyo-rain-123` would be
// `projects/tokyo-rain-123/billingInfo`. This field is read-only.
string name = 1;
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// The ID of the project that this `ProjectBillingInfo` represents, such as
// `tokyo-rain-123`. This is a convenience field so that you don't need to
// parse the `name` field to obtain a project ID. This field is read-only.
string project_id = 2;
// Output only. The ID of the project that this `ProjectBillingInfo`
// represents, such as `tokyo-rain-123`. This is a convenience field so that
// you don't need to parse the `name` field to obtain a project ID. This field
// is read-only.
string project_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// The resource name of the billing account associated with the project, if
// any. For example, `billingAccounts/012345-567890-ABCDEF`.
string billing_account_name = 3;

// True if the project is associated with an open billing account, to which
// usage on the project is charged. False if the project is associated with a
// closed billing account, or no billing account at all, and therefore cannot
// use paid services. This field is read-only.
bool billing_enabled = 4;
// Output only. True if the project is associated with an open billing
// account, to which usage on the project is charged. False if the project is
// associated with a closed billing account, or no billing account at all, and
// therefore cannot use paid services. This field is read-only.
bool billing_enabled = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Request message for `GetBillingAccount`.
Expand Down Expand Up @@ -370,7 +376,12 @@ message ListProjectBillingInfoResponse {
message GetProjectBillingInfoRequest {
// Required. The resource name of the project for which billing information is
// retrieved. For example, `projects/tokyo-rain-123`.
string name = 1 [(google.api.field_behavior) = REQUIRED];
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "cloudbilling.googleapis.com/ProjectBillingInfo"
}
];
}

// Request message for `UpdateProjectBillingInfo`.
Expand Down
22 changes: 18 additions & 4 deletions packages/google-cloud-billing/protos/protos.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions packages/google-cloud-billing/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* [Cloud_catalog.list_services](#cloud_catalog.list_services)
* [Cloud_catalog.list_skus](#cloud_catalog.list_skus)
* [Quickstart](#quickstart)
* [Quickstart](#quickstart)

## Before you begin

Expand Down Expand Up @@ -258,23 +257,6 @@ __Usage:__
`node packages/google-cloud-billing/samples/quickstart.js`


-----




### Quickstart

View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing/samples/test/quickstart.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing/samples/test/quickstart.js,samples/README.md)

__Usage:__


`node packages/google-cloud-billing/samples/test/quickstart.js`





Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"clientLibrary": {
"name": "nodejs-billing",
"version": "3.3.1",
"version": "3.3.2",
"language": "TYPESCRIPT",
"apis": [
{
Expand Down
Loading

0 comments on commit a77e51f

Please sign in to comment.