Skip to content

Commit

Permalink
chore: Integrate new gapic-generator-java and rules_gapic (#730)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 454027580

Source-Link: googleapis/googleapis@1b22277

Source-Link: https://github.com/googleapis/googleapis-gen/commit/e04cea20d0d12eb5c3bdb360a9e72b654edcb638
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTA0Y2VhMjBkMGQxMmViNWMzYmRiMzYwYTllNzJiNjU0ZWRjYjYzOCJ9
  • Loading branch information
gcf-owl-bot[bot] authored Jun 13, 2022
1 parent 0197a9a commit 1dcfada
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ public final ListDeviceRegistriesPagedResponse listDeviceRegistries(
* while (true) {
* ListDeviceRegistriesResponse response =
* deviceManagerClient.listDeviceRegistriesCallable().call(request);
* for (DeviceRegistry element : response.getResponsesList()) {
* for (DeviceRegistry element : response.getDeviceRegistriesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1261,7 +1261,7 @@ public final ListDevicesPagedResponse listDevices(ListDevicesRequest request) {
* .build();
* while (true) {
* ListDevicesResponse response = deviceManagerClient.listDevicesCallable().call(request);
* for (Device element : response.getResponsesList()) {
* for (Device element : response.getDevicesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1634,7 +1634,7 @@ public final ListDeviceStatesResponse listDeviceStates(ListDeviceStatesRequest r
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
* ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
* ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
* Policy policy = Policy.newBuilder().build();
* Policy response = deviceManagerClient.setIamPolicy(resource, policy);
* }
Expand Down Expand Up @@ -1698,8 +1698,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(
* DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]").toString())
* .setResource(RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
Expand All @@ -1726,8 +1725,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(
* DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]").toString())
* .setResource(RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
Expand All @@ -1752,7 +1750,7 @@ public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
* ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
* ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
* Policy response = deviceManagerClient.getIamPolicy(resource);
* }
* }</pre>
Expand Down Expand Up @@ -1808,8 +1806,7 @@ public final Policy getIamPolicy(String resource) {
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
* .setResource(
* DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]").toString())
* .setResource(RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]").toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* Policy response = deviceManagerClient.getIamPolicy(request);
Expand All @@ -1836,8 +1833,7 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
* .setResource(
* DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]").toString())
* .setResource(RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]").toString())
* .setOptions(GetPolicyOptions.newBuilder().build())
* .build();
* ApiFuture<Policy> future = deviceManagerClient.getIamPolicyCallable().futureCall(request);
Expand All @@ -1861,7 +1857,7 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
* ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
* ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
* List<String> permissions = new ArrayList<>();
* TestIamPermissionsResponse response =
* deviceManagerClient.testIamPermissions(resource, permissions);
Expand Down Expand Up @@ -1934,8 +1930,7 @@ public final TestIamPermissionsResponse testIamPermissions(
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
* .setResource(
* DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]").toString())
* .setResource(RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]").toString())
* .addAllPermissions(new ArrayList<String>())
* .build();
* TestIamPermissionsResponse response = deviceManagerClient.testIamPermissions(request);
Expand All @@ -1962,8 +1957,7 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
* .setResource(
* DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]").toString())
* .setResource(RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]").toString())
* .addAllPermissions(new ArrayList<String>())
* .build();
* ApiFuture<TestIamPermissionsResponse> future =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ public void setIamPolicyTest() throws Exception {
.build();
mockDeviceManager.addResponse(expectedResponse);

ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
Policy policy = Policy.newBuilder().build();

Policy actualResponse = client.setIamPolicy(resource, policy);
Expand All @@ -1205,7 +1205,7 @@ public void setIamPolicyExceptionTest() throws Exception {
mockDeviceManager.addException(exception);

try {
ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
Policy policy = Policy.newBuilder().build();
client.setIamPolicy(resource, policy);
Assert.fail("No exception raised");
Expand Down Expand Up @@ -1269,7 +1269,7 @@ public void getIamPolicyTest() throws Exception {
.build();
mockDeviceManager.addResponse(expectedResponse);

ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");

Policy actualResponse = client.getIamPolicy(resource);
Assert.assertEquals(expectedResponse, actualResponse);
Expand All @@ -1291,7 +1291,7 @@ public void getIamPolicyExceptionTest() throws Exception {
mockDeviceManager.addException(exception);

try {
ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
client.getIamPolicy(resource);
Assert.fail("No exception raised");
} catch (InvalidArgumentException e) {
Expand Down Expand Up @@ -1346,7 +1346,7 @@ public void testIamPermissionsTest() throws Exception {
TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList<String>()).build();
mockDeviceManager.addResponse(expectedResponse);

ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
List<String> permissions = new ArrayList<>();

TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions);
Expand All @@ -1370,7 +1370,7 @@ public void testIamPermissionsExceptionTest() throws Exception {
mockDeviceManager.addException(exception);

try {
ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
List<String> permissions = new ArrayList<>();
client.testIamPermissions(resource, permissions);
Assert.fail("No exception raised");
Expand Down

0 comments on commit 1dcfada

Please sign in to comment.