Visitar URL original
chore: Integrate new gapic-generator-java and rules_gapic (#730) · googleapis/google-cloud-java@1dcfada · GitHub
Skip to content

Commit 1dcfada

Browse files
chore: Integrate new gapic-generator-java and rules_gapic (#730)
- [ ] 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
1 parent 0197a9a commit 1dcfada

2 files changed

Lines changed: 17 additions & 23 deletions

File tree

‎java-iot/google-cloud-iot/src/main/java/com/google/cloud/iot/v1/DeviceManagerClient.java‎

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ public final ListDeviceRegistriesPagedResponse listDeviceRegistries(
702702
* while (true) {
703703
* ListDeviceRegistriesResponse response =
704704
* deviceManagerClient.listDeviceRegistriesCallable().call(request);
705-
* for (DeviceRegistry element : response.getResponsesList()) {
705+
* for (DeviceRegistry element : response.getDeviceRegistriesList()) {
706706
* // doThingsWith(element);
707707
* }
708708
* String nextPageToken = response.getNextPageToken();
@@ -1261,7 +1261,7 @@ public final ListDevicesPagedResponse listDevices(ListDevicesRequest request) {
12611261
* .build();
12621262
* while (true) {
12631263
* ListDevicesResponse response = deviceManagerClient.listDevicesCallable().call(request);
1264-
* for (Device element : response.getResponsesList()) {
1264+
* for (Device element : response.getDevicesList()) {
12651265
* // doThingsWith(element);
12661266
* }
12671267
* String nextPageToken = response.getNextPageToken();
@@ -1634,7 +1634,7 @@ public final ListDeviceStatesResponse listDeviceStates(ListDeviceStatesRequest r
16341634
* // This snippet has been automatically generated for illustrative purposes only.
16351635
* // It may require modifications to work in your environment.
16361636
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
1637-
* ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
1637+
* ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
16381638
* Policy policy = Policy.newBuilder().build();
16391639
* Policy response = deviceManagerClient.setIamPolicy(resource, policy);
16401640
* }
@@ -1698,8 +1698,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
16981698
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
16991699
* SetIamPolicyRequest request =
17001700
* SetIamPolicyRequest.newBuilder()
1701-
* .setResource(
1702-
* DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]").toString())
1701+
* .setResource(RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]").toString())
17031702
* .setPolicy(Policy.newBuilder().build())
17041703
* .setUpdateMask(FieldMask.newBuilder().build())
17051704
* .build();
@@ -1726,8 +1725,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
17261725
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
17271726
* SetIamPolicyRequest request =
17281727
* SetIamPolicyRequest.newBuilder()
1729-
* .setResource(
1730-
* DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]").toString())
1728+
* .setResource(RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]").toString())
17311729
* .setPolicy(Policy.newBuilder().build())
17321730
* .setUpdateMask(FieldMask.newBuilder().build())
17331731
* .build();
@@ -1752,7 +1750,7 @@ public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
17521750
* // This snippet has been automatically generated for illustrative purposes only.
17531751
* // It may require modifications to work in your environment.
17541752
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
1755-
* ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
1753+
* ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
17561754
* Policy response = deviceManagerClient.getIamPolicy(resource);
17571755
* }
17581756
* }</pre>
@@ -1808,8 +1806,7 @@ public final Policy getIamPolicy(String resource) {
18081806
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
18091807
* GetIamPolicyRequest request =
18101808
* GetIamPolicyRequest.newBuilder()
1811-
* .setResource(
1812-
* DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]").toString())
1809+
* .setResource(RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]").toString())
18131810
* .setOptions(GetPolicyOptions.newBuilder().build())
18141811
* .build();
18151812
* Policy response = deviceManagerClient.getIamPolicy(request);
@@ -1836,8 +1833,7 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
18361833
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
18371834
* GetIamPolicyRequest request =
18381835
* GetIamPolicyRequest.newBuilder()
1839-
* .setResource(
1840-
* DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]").toString())
1836+
* .setResource(RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]").toString())
18411837
* .setOptions(GetPolicyOptions.newBuilder().build())
18421838
* .build();
18431839
* ApiFuture<Policy> future = deviceManagerClient.getIamPolicyCallable().futureCall(request);
@@ -1861,7 +1857,7 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
18611857
* // This snippet has been automatically generated for illustrative purposes only.
18621858
* // It may require modifications to work in your environment.
18631859
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
1864-
* ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
1860+
* ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
18651861
* List<String> permissions = new ArrayList<>();
18661862
* TestIamPermissionsResponse response =
18671863
* deviceManagerClient.testIamPermissions(resource, permissions);
@@ -1934,8 +1930,7 @@ public final TestIamPermissionsResponse testIamPermissions(
19341930
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
19351931
* TestIamPermissionsRequest request =
19361932
* TestIamPermissionsRequest.newBuilder()
1937-
* .setResource(
1938-
* DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]").toString())
1933+
* .setResource(RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]").toString())
19391934
* .addAllPermissions(new ArrayList<String>())
19401935
* .build();
19411936
* TestIamPermissionsResponse response = deviceManagerClient.testIamPermissions(request);
@@ -1962,8 +1957,7 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
19621957
* try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
19631958
* TestIamPermissionsRequest request =
19641959
* TestIamPermissionsRequest.newBuilder()
1965-
* .setResource(
1966-
* DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]").toString())
1960+
* .setResource(RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]").toString())
19671961
* .addAllPermissions(new ArrayList<String>())
19681962
* .build();
19691963
* ApiFuture<TestIamPermissionsResponse> future =

‎java-iot/google-cloud-iot/src/test/java/com/google/cloud/iot/v1/DeviceManagerClientTest.java‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ public void setIamPolicyTest() throws Exception {
11811181
.build();
11821182
mockDeviceManager.addResponse(expectedResponse);
11831183

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

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

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

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

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

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

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

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

13721372
try {
1373-
ResourceName resource = DeviceName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]");
1373+
ResourceName resource = RegistryName.of("[PROJECT]", "[LOCATION]", "[REGISTRY]");
13741374
List<String> permissions = new ArrayList<>();
13751375
client.testIamPermissions(resource, permissions);
13761376
Assert.fail("No exception raised");

0 commit comments

Comments
 (0)