Skip to content

Commit

Permalink
fix: [cloudbilling] fixed resource_reference for name in GetProjectBi…
Browse files Browse the repository at this point in the history
…llingInfo (#9778)

* docs: update comments

PiperOrigin-RevId: 559241398

Source-Link: googleapis/googleapis@6fe53ad

Source-Link: https://github.com/googleapis/googleapis-gen/commit/11b03ab6f9cf00cbcd1671af7f5d71348f256a74
Copy-Tag: eyJwIjoiamF2YS1iaWxsaW5nLy5Pd2xCb3QueWFtbCIsImgiOiIxMWIwM2FiNmY5Y2YwMGNiY2QxNjcxYWY3ZjVkNzEzNDhmMjU2YTc0In0=

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: fixed resource_reference for name in GetProjectBillingInfo

PiperOrigin-RevId: 563189185

Source-Link: googleapis/googleapis@4967815

Source-Link: https://github.com/googleapis/googleapis-gen/commit/9f06f3e0bc0e16662a264e3ddc2ef39bf7ad93ec
Copy-Tag: eyJwIjoiamF2YS1iaWxsaW5nLy5Pd2xCb3QueWFtbCIsImgiOiI5ZjA2ZjNlMGJjMGUxNjY2MmEyNjRlM2RkYzJlZjM5YmY3YWQ5M2VjIn0=

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Sep 8, 2023
1 parent 13e9ee1 commit acfa7dc
Show file tree
Hide file tree
Showing 15 changed files with 182 additions and 179 deletions.
4 changes: 2 additions & 2 deletions java-billing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.19.0</version>
<version>26.22.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-billing.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-billing/2.21.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-billing/2.23.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ public final ListProjectBillingInfoPagedResponse listProjectBillingInfo(
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
* ProjectBillingInfoName name = ProjectBillingInfoName.of("[PROJECT]");
* ProjectName name = ProjectName.of("[PROJECT]");
* ProjectBillingInfo response = cloudBillingClient.getProjectBillingInfo(name);
* }
* }</pre>
Expand All @@ -897,7 +897,7 @@ public final ListProjectBillingInfoPagedResponse listProjectBillingInfo(
* retrieved. For example, `projects/tokyo-rain-123`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ProjectBillingInfo getProjectBillingInfo(ProjectBillingInfoName name) {
public final ProjectBillingInfo getProjectBillingInfo(ProjectName name) {
GetProjectBillingInfoRequest request =
GetProjectBillingInfoRequest.newBuilder()
.setName(name == null ? null : name.toString())
Expand All @@ -921,7 +921,7 @@ public final ProjectBillingInfo getProjectBillingInfo(ProjectBillingInfoName nam
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
* String name = ProjectBillingInfoName.of("[PROJECT]").toString();
* String name = ProjectName.of("[PROJECT]").toString();
* ProjectBillingInfo response = cloudBillingClient.getProjectBillingInfo(name);
* }
* }</pre>
Expand Down Expand Up @@ -954,7 +954,7 @@ public final ProjectBillingInfo getProjectBillingInfo(String name) {
* try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
* GetProjectBillingInfoRequest request =
* GetProjectBillingInfoRequest.newBuilder()
* .setName(ProjectBillingInfoName.of("[PROJECT]").toString())
* .setName(ProjectName.of("[PROJECT]").toString())
* .build();
* ProjectBillingInfo response = cloudBillingClient.getProjectBillingInfo(request);
* }
Expand Down Expand Up @@ -985,7 +985,7 @@ public final ProjectBillingInfo getProjectBillingInfo(GetProjectBillingInfoReque
* try (CloudBillingClient cloudBillingClient = CloudBillingClient.create()) {
* GetProjectBillingInfoRequest request =
* GetProjectBillingInfoRequest.newBuilder()
* .setName(ProjectBillingInfoName.of("[PROJECT]").toString())
* .setName(ProjectName.of("[PROJECT]").toString())
* .build();
* ApiFuture<ProjectBillingInfo> future =
* cloudBillingClient.getProjectBillingInfoCallable().futureCall(request);
Expand Down Expand Up @@ -1049,7 +1049,7 @@ public final ProjectBillingInfo getProjectBillingInfo(GetProjectBillingInfoReque
*
* @param name Required. The resource name of the project associated with the billing information
* that you want to update. For example, `projects/tokyo-rain-123`.
* @param projectBillingInfo The new billing information for the project. Read-only fields are
* @param projectBillingInfo The new billing information for the project. Output-only fields are
* ignored; thus, you can leave empty all fields except `billing_account_name`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

@Generated("by gapic-generator-java")
Expand Down Expand Up @@ -476,20 +475,18 @@ public void listProjectBillingInfoExceptionTest2() throws Exception {
}
}

@Ignore(
"Ignore until https://github.com/googleapis/sdk-platform-java/issues/1780 is resolved. Remove this file from preserve regex.")
@Test
public void getProjectBillingInfoTest() throws Exception {
ProjectBillingInfo expectedResponse =
ProjectBillingInfo.newBuilder()
.setName(ProjectBillingInfoName.of("[PROJECT]").toString())
.setName("name3373707")
.setProjectId("projectId-894832108")
.setBillingAccountName("billingAccountName929322205")
.setBillingEnabled(true)
.build();
mockService.addResponse(expectedResponse);

ProjectBillingInfoName name = ProjectBillingInfoName.of("[PROJECT]");
ProjectName name = ProjectName.of("[PROJECT]");

ProjectBillingInfo actualResponse = client.getProjectBillingInfo(name);
Assert.assertEquals(expectedResponse, actualResponse);
Expand Down Expand Up @@ -517,7 +514,7 @@ public void getProjectBillingInfoExceptionTest() throws Exception {
mockService.addException(exception);

try {
ProjectBillingInfoName name = ProjectBillingInfoName.of("[PROJECT]");
ProjectName name = ProjectName.of("[PROJECT]");
client.getProjectBillingInfo(name);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
Expand All @@ -529,7 +526,7 @@ public void getProjectBillingInfoExceptionTest() throws Exception {
public void getProjectBillingInfoTest2() throws Exception {
ProjectBillingInfo expectedResponse =
ProjectBillingInfo.newBuilder()
.setName(ProjectBillingInfoName.of("[PROJECT]").toString())
.setName("name3373707")
.setProjectId("projectId-894832108")
.setBillingAccountName("billingAccountName929322205")
.setBillingEnabled(true)
Expand Down Expand Up @@ -576,7 +573,7 @@ public void getProjectBillingInfoExceptionTest2() throws Exception {
public void updateProjectBillingInfoTest() throws Exception {
ProjectBillingInfo expectedResponse =
ProjectBillingInfo.newBuilder()
.setName(ProjectBillingInfoName.of("[PROJECT]").toString())
.setName("name3373707")
.setProjectId("projectId-894832108")
.setBillingAccountName("billingAccountName929322205")
.setBillingEnabled(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,14 @@ public void listProjectBillingInfoExceptionTest2() throws Exception {
public void getProjectBillingInfoTest() throws Exception {
ProjectBillingInfo expectedResponse =
ProjectBillingInfo.newBuilder()
.setName(ProjectBillingInfoName.of("[PROJECT]").toString())
.setName("name3373707")
.setProjectId("projectId-894832108")
.setBillingAccountName("billingAccountName929322205")
.setBillingEnabled(true)
.build();
mockCloudBilling.addResponse(expectedResponse);

ProjectBillingInfoName name = ProjectBillingInfoName.of("[PROJECT]");
ProjectName name = ProjectName.of("[PROJECT]");

ProjectBillingInfo actualResponse = client.getProjectBillingInfo(name);
Assert.assertEquals(expectedResponse, actualResponse);
Expand All @@ -473,7 +473,7 @@ public void getProjectBillingInfoExceptionTest() throws Exception {
mockCloudBilling.addException(exception);

try {
ProjectBillingInfoName name = ProjectBillingInfoName.of("[PROJECT]");
ProjectName name = ProjectName.of("[PROJECT]");
client.getProjectBillingInfo(name);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
Expand All @@ -485,7 +485,7 @@ public void getProjectBillingInfoExceptionTest() throws Exception {
public void getProjectBillingInfoTest2() throws Exception {
ProjectBillingInfo expectedResponse =
ProjectBillingInfo.newBuilder()
.setName(ProjectBillingInfoName.of("[PROJECT]").toString())
.setName("name3373707")
.setProjectId("projectId-894832108")
.setBillingAccountName("billingAccountName929322205")
.setBillingEnabled(true)
Expand Down Expand Up @@ -527,7 +527,7 @@ public void getProjectBillingInfoExceptionTest2() throws Exception {
public void updateProjectBillingInfoTest() throws Exception {
ProjectBillingInfo expectedResponse =
ProjectBillingInfo.newBuilder()
.setName(ProjectBillingInfoName.of("[PROJECT]").toString())
.setName("name3373707")
.setProjectId("projectId-894832108")
.setBillingAccountName("billingAccountName929322205")
.setBillingEnabled(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,65 +118,65 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "_token\030\003 \001(\t\"\204\001\n\036ListProjectBillingInfoR"
+ "esponse\022I\n\024project_billing_info\030\001 \003(\0132+."
+ "google.cloud.billing.v1.ProjectBillingIn"
+ "fo\022\027\n\017next_page_token\030\002 \001(\t\"e\n\034GetProjec"
+ "tBillingInfoRequest\022E\n\004name\030\001 \001(\tB7\342A\001\002\372"
+ "A0\n.cloudbilling.googleapis.com/ProjectB"
+ "illingInfo\"\200\001\n\037UpdateProjectBillingInfoR"
+ "equest\022\022\n\004name\030\001 \001(\tB\004\342A\001\002\022I\n\024project_bi"
+ "lling_info\030\002 \001(\0132+.google.cloud.billing."
+ "v1.ProjectBillingInfo2\262\017\n\014CloudBilling\022\234"
+ "\001\n\021GetBillingAccount\0221.google.cloud.bill"
+ "ing.v1.GetBillingAccountRequest\032\'.google"
+ ".cloud.billing.v1.BillingAccount\"+\332A\004nam"
+ "e\202\323\344\223\002\036\022\034/v1/{name=billingAccounts/*}\022\240\001"
+ "\n\023ListBillingAccounts\0223.google.cloud.bil"
+ "ling.v1.ListBillingAccountsRequest\0324.goo"
+ "gle.cloud.billing.v1.ListBillingAccounts"
+ "Response\"\036\332A\000\202\323\344\223\002\025\022\023/v1/billingAccounts"
+ "\022\263\001\n\024UpdateBillingAccount\0224.google.cloud"
+ ".billing.v1.UpdateBillingAccountRequest\032"
+ "\'.google.cloud.billing.v1.BillingAccount"
+ "\"<\332A\014name,account\202\323\344\223\002\'2\034/v1/{name=billi"
+ "ngAccounts/*}:\007account\022\265\001\n\024CreateBilling"
+ "Account\0224.google.cloud.billing.v1.Create"
+ "BillingAccountRequest\032\'.google.cloud.bil"
+ "ling.v1.BillingAccount\">\332A\017billing_accou"
+ "nt\202\323\344\223\002&\"\023/v1/billingAccounts:\017billing_a"
+ "ccount\022\277\001\n\026ListProjectBillingInfo\0226.goog"
+ "le.cloud.billing.v1.ListProjectBillingIn"
+ "foRequest\0327.google.cloud.billing.v1.List"
+ "ProjectBillingInfoResponse\"4\332A\004name\202\323\344\223\002"
+ "\'\022%/v1/{name=billingAccounts/*}/projects"
+ "\022\255\001\n\025GetProjectBillingInfo\0225.google.clou"
+ "d.billing.v1.GetProjectBillingInfoReques"
+ "t\032+.google.cloud.billing.v1.ProjectBilli"
+ "ngInfo\"0\332A\004name\202\323\344\223\002#\022!/v1/{name=project"
+ "s/*}/billingInfo\022\336\001\n\030UpdateProjectBillin"
+ "gInfo\0228.google.cloud.billing.v1.UpdatePr"
+ "ojectBillingInfoRequest\032+.google.cloud.b"
+ "illing.v1.ProjectBillingInfo\"[\332A\031name,pr"
+ "oject_billing_info\202\323\344\223\0029\032!/v1/{name=proj"
+ "ects/*}/billingInfo:\024project_billing_inf"
+ "o\022\213\001\n\014GetIamPolicy\022\".google.iam.v1.GetIa"
+ "mPolicyRequest\032\025.google.iam.v1.Policy\"@\332"
+ "A\010resource\202\323\344\223\002/\022-/v1/{resource=billingA"
+ "ccounts/*}:getIamPolicy\022\225\001\n\014SetIamPolicy"
+ "\022\".google.iam.v1.SetIamPolicyRequest\032\025.g"
+ "oogle.iam.v1.Policy\"J\332A\017resource,policy\202"
+ "\323\344\223\0022\"-/v1/{resource=billingAccounts/*}:"
+ "setIamPolicy:\001*\022\300\001\n\022TestIamPermissions\022("
+ ".google.iam.v1.TestIamPermissionsRequest"
+ "\032).google.iam.v1.TestIamPermissionsRespo"
+ "nse\"U\332A\024resource,permissions\202\323\344\223\0028\"3/v1/"
+ "{resource=billingAccounts/*}:testIamPerm"
+ "issions:\001*\032\265\001\312A\033cloudbilling.googleapis."
+ "com\322A\223\001https://www.googleapis.com/auth/c"
+ "loud-billing,https://www.googleapis.com/"
+ "auth/cloud-billing.readonly,https://www."
+ "googleapis.com/auth/cloud-platformBi\n\033co"
+ "m.google.cloud.billing.v1B\021CloudBillingP"
+ "rotoP\001Z5cloud.google.com/go/billing/apiv"
+ "1/billingpb;billingpbb\006proto3"
+ "fo\022\027\n\017next_page_token\030\002 \001(\t\"b\n\034GetProjec"
+ "tBillingInfoRequest\022B\n\004name\030\001 \001(\tB4\342A\001\002\372"
+ "A-\n+cloudresourcemanager.googleapis.com/"
+ "Project\"\200\001\n\037UpdateProjectBillingInfoRequ"
+ "est\022\022\n\004name\030\001 \001(\tB\004\342A\001\002\022I\n\024project_billi"
+ "ng_info\030\002 \001(\0132+.google.cloud.billing.v1."
+ "ProjectBillingInfo2\262\017\n\014CloudBilling\022\234\001\n\021"
+ "GetBillingAccount\0221.google.cloud.billing"
+ ".v1.GetBillingAccountRequest\032\'.google.cl"
+ "oud.billing.v1.BillingAccount\"+\332A\004name\202\323"
+ "\344\223\002\036\022\034/v1/{name=billingAccounts/*}\022\240\001\n\023L"
+ "istBillingAccounts\0223.google.cloud.billin"
+ "g.v1.ListBillingAccountsRequest\0324.google"
+ ".cloud.billing.v1.ListBillingAccountsRes"
+ "ponse\"\036\332A\000\202\323\344\223\002\025\022\023/v1/billingAccounts\022\263\001"
+ "\n\024UpdateBillingAccount\0224.google.cloud.bi"
+ "lling.v1.UpdateBillingAccountRequest\032\'.g"
+ "oogle.cloud.billing.v1.BillingAccount\"<\332"
+ "A\014name,account\202\323\344\223\002\'2\034/v1/{name=billingA"
+ "ccounts/*}:\007account\022\265\001\n\024CreateBillingAcc"
+ "ount\0224.google.cloud.billing.v1.CreateBil"
+ "lingAccountRequest\032\'.google.cloud.billin"
+ "g.v1.BillingAccount\">\332A\017billing_account\202"
+ "\323\344\223\002&\"\023/v1/billingAccounts:\017billing_acco"
+ "unt\022\277\001\n\026ListProjectBillingInfo\0226.google."
+ "cloud.billing.v1.ListProjectBillingInfoR"
+ "equest\0327.google.cloud.billing.v1.ListPro"
+ "jectBillingInfoResponse\"4\332A\004name\202\323\344\223\002\'\022%"
+ "/v1/{name=billingAccounts/*}/projects\022\255\001"
+ "\n\025GetProjectBillingInfo\0225.google.cloud.b"
+ "illing.v1.GetProjectBillingInfoRequest\032+"
+ ".google.cloud.billing.v1.ProjectBillingI"
+ "nfo\"0\332A\004name\202\323\344\223\002#\022!/v1/{name=projects/*"
+ "}/billingInfo\022\336\001\n\030UpdateProjectBillingIn"
+ "fo\0228.google.cloud.billing.v1.UpdateProje"
+ "ctBillingInfoRequest\032+.google.cloud.bill"
+ "ing.v1.ProjectBillingInfo\"[\332A\031name,proje"
+ "ct_billing_info\202\323\344\223\0029\032!/v1/{name=project"
+ "s/*}/billingInfo:\024project_billing_info\022\213"
+ "\001\n\014GetIamPolicy\022\".google.iam.v1.GetIamPo"
+ "licyRequest\032\025.google.iam.v1.Policy\"@\332A\010r"
+ "esource\202\323\344\223\002/\022-/v1/{resource=billingAcco"
+ "unts/*}:getIamPolicy\022\225\001\n\014SetIamPolicy\022\"."
+ "google.iam.v1.SetIamPolicyRequest\032\025.goog"
+ "le.iam.v1.Policy\"J\332A\017resource,policy\202\323\344\223"
+ "\0022\"-/v1/{resource=billingAccounts/*}:set"
+ "IamPolicy:\001*\022\300\001\n\022TestIamPermissions\022(.go"
+ "ogle.iam.v1.TestIamPermissionsRequest\032)."
+ "google.iam.v1.TestIamPermissionsResponse"
+ "\"U\332A\024resource,permissions\202\323\344\223\0028\"3/v1/{re"
+ "source=billingAccounts/*}:testIamPermiss"
+ "ions:\001*\032\265\001\312A\033cloudbilling.googleapis.com"
+ "\322A\223\001https://www.googleapis.com/auth/clou"
+ "d-billing,https://www.googleapis.com/aut"
+ "h/cloud-billing.readonly,https://www.goo"
+ "gleapis.com/auth/cloud-platformBi\n\033com.g"
+ "oogle.cloud.billing.v1B\021CloudBillingProt"
+ "oP\001Z5cloud.google.com/go/billing/apiv1/b"
+ "illingpb;billingpbb\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
Expand Down
Loading

0 comments on commit acfa7dc

Please sign in to comment.