Skip to content

Commit

Permalink
fix: use correct paginated field name (#1001)
Browse files Browse the repository at this point in the history
  • Loading branch information
alicejli authored Jun 9, 2022
1 parent 61e2e96 commit 7f186b5
Show file tree
Hide file tree
Showing 49 changed files with 73 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,11 @@ private static Sample composePagedCallableSample(
MethodInvocationExpr getResponseListMethodInvocationExpr =
MethodInvocationExpr.builder()
.setExprReferenceExpr(responseVarExpr)
.setMethodName("getResponsesList")
.setMethodName(
"get"
+ JavaStyle.toUpperCamelCase(
String.format("%s", repeatedPagedResultsField.name()))
+ "List")
.build();
ForStatement responseForStatements =
ForStatement.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ public class IdentityClient implements BackgroundResource {
* .build();
* while (true) {
* ListUsersResponse response = identityClient.listUsersCallable().call(request);
* for (User element : response.getResponsesList()) {
* for (User element : response.getUsersList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ public class MessagingClient implements BackgroundResource {
* .build();
* while (true) {
* ListRoomsResponse response = messagingClient.listRoomsCallable().call(request);
* for (Room element : response.getResponsesList()) {
* for (Room element : response.getRoomsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1079,7 +1079,7 @@ public class MessagingClient implements BackgroundResource {
* .build();
* while (true) {
* ListBlurbsResponse response = messagingClient.listBlurbsCallable().call(request);
* for (Blurb element : response.getResponsesList()) {
* for (Blurb element : response.getBlurbsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class AsyncListUsersPaged {
.build();
while (true) {
ListUsersResponse response = identityClient.listUsersCallable().call(request);
for (User element : response.getResponsesList()) {
for (User element : response.getUsersList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class AsyncListBlurbsPaged {
.build();
while (true) {
ListBlurbsResponse response = messagingClient.listBlurbsCallable().call(request);
for (Blurb element : response.getResponsesList()) {
for (Blurb element : response.getBlurbsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class AsyncListRoomsPaged {
.build();
while (true) {
ListRoomsResponse response = messagingClient.listRoomsCallable().call(request);
for (Room element : response.getResponsesList()) {
for (Room element : response.getRoomsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void asyncListAssetsPaged() throws Exception {
.build();
while (true) {
ListAssetsResponse response = assetServiceClient.listAssetsCallable().call(request);
for (Asset element : response.getResponsesList()) {
for (Asset element : response.getAssetsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void asyncSearchAllIamPoliciesPaged() throws Exception {
while (true) {
SearchAllIamPoliciesResponse response =
assetServiceClient.searchAllIamPoliciesCallable().call(request);
for (IamPolicySearchResult element : response.getResponsesList()) {
for (IamPolicySearchResult element : response.getResultsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void asyncSearchAllResourcesPaged() throws Exception {
while (true) {
SearchAllResourcesResponse response =
assetServiceClient.searchAllResourcesCallable().call(request);
for (ResourceSearchResult element : response.getResponsesList()) {
for (ResourceSearchResult element : response.getResultsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public final UnaryCallable<ListAssetsRequest, ListAssetsPagedResponse> listAsset
* .build();
* while (true) {
* ListAssetsResponse response = assetServiceClient.listAssetsCallable().call(request);
* for (Asset element : response.getResponsesList()) {
* for (Asset element : response.getAssetsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1150,7 +1150,7 @@ public final SearchAllResourcesPagedResponse searchAllResources(
* while (true) {
* SearchAllResourcesResponse response =
* assetServiceClient.searchAllResourcesCallable().call(request);
* for (ResourceSearchResult element : response.getResponsesList()) {
* for (ResourceSearchResult element : response.getResultsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1341,7 +1341,7 @@ public final SearchAllIamPoliciesPagedResponse searchAllIamPolicies(
* while (true) {
* SearchAllIamPoliciesResponse response =
* assetServiceClient.searchAllIamPoliciesCallable().call(request);
* for (IamPolicySearchResult element : response.getResponsesList()) {
* for (IamPolicySearchResult element : response.getResultsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static void asyncAggregatedListPaged() throws Exception {
.build();
while (true) {
AddressAggregatedList response = addressesClient.aggregatedListCallable().call(request);
for (Map.Entry<String, AddressesScopedList> element : response.getResponsesList()) {
for (Map.Entry<String, AddressesScopedList> element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void asyncListPaged() throws Exception {
.build();
while (true) {
AddressList response = addressesClient.listCallable().call(request);
for (Address element : response.getResponsesList()) {
for (Address element : response.getItemsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public final AggregatedListPagedResponse aggregatedList(AggregatedListAddressesR
* .build();
* while (true) {
* AddressAggregatedList response = addressesClient.aggregatedListCallable().call(request);
* for (Map.Entry<String, AddressesScopedList> element : response.getResponsesList()) {
* for (Map.Entry<String, AddressesScopedList> element : response.getItemsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -649,7 +649,7 @@ public final UnaryCallable<ListAddressesRequest, ListPagedResponse> listPagedCal
* .build();
* while (true) {
* AddressList response = addressesClient.listCallable().call(request);
* for (Address element : response.getResponsesList()) {
* for (Address element : response.getItemsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void asyncListCryptoKeysPaged() throws Exception {
while (true) {
ListCryptoKeysResponse response =
keyManagementServiceClient.listCryptoKeysCallable().call(request);
for (CryptoKey element : response.getResponsesList()) {
for (CryptoKey element : response.getCryptoKeysList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void asyncListCryptoKeyVersionsPaged() throws Exception {
while (true) {
ListCryptoKeyVersionsResponse response =
keyManagementServiceClient.listCryptoKeyVersionsCallable().call(request);
for (CryptoKeyVersion element : response.getResponsesList()) {
for (CryptoKeyVersion element : response.getCryptoKeyVersionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void asyncListImportJobsPaged() throws Exception {
while (true) {
ListImportJobsResponse response =
keyManagementServiceClient.listImportJobsCallable().call(request);
for (ImportJob element : response.getResponsesList()) {
for (ImportJob element : response.getImportJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void asyncListKeyRingsPaged() throws Exception {
while (true) {
ListKeyRingsResponse response =
keyManagementServiceClient.listKeyRingsCallable().call(request);
for (KeyRing element : response.getResponsesList()) {
for (KeyRing element : response.getKeyRingsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void asyncListLocationsPaged() throws Exception {
while (true) {
ListLocationsResponse response =
keyManagementServiceClient.listLocationsCallable().call(request);
for (Location element : response.getResponsesList()) {
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public final ListKeyRingsPagedResponse listKeyRings(ListKeyRingsRequest request)
* while (true) {
* ListKeyRingsResponse response =
* keyManagementServiceClient.listKeyRingsCallable().call(request);
* for (KeyRing element : response.getResponsesList()) {
* for (KeyRing element : response.getKeyRingsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -481,7 +481,7 @@ public final ListCryptoKeysPagedResponse listCryptoKeys(ListCryptoKeysRequest re
* while (true) {
* ListCryptoKeysResponse response =
* keyManagementServiceClient.listCryptoKeysCallable().call(request);
* for (CryptoKey element : response.getResponsesList()) {
* for (CryptoKey element : response.getCryptoKeysList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -656,7 +656,7 @@ public final ListCryptoKeyVersionsPagedResponse listCryptoKeyVersions(
* while (true) {
* ListCryptoKeyVersionsResponse response =
* keyManagementServiceClient.listCryptoKeyVersionsCallable().call(request);
* for (CryptoKeyVersion element : response.getResponsesList()) {
* for (CryptoKeyVersion element : response.getCryptoKeyVersionsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -818,7 +818,7 @@ public final ListImportJobsPagedResponse listImportJobs(ListImportJobsRequest re
* while (true) {
* ListImportJobsResponse response =
* keyManagementServiceClient.listImportJobsCallable().call(request);
* for (ImportJob element : response.getResponsesList()) {
* for (ImportJob element : response.getImportJobsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -3476,7 +3476,7 @@ public final ListLocationsPagedResponse listLocations(ListLocationsRequest reque
* while (true) {
* ListLocationsResponse response =
* keyManagementServiceClient.listLocationsCallable().call(request);
* for (Location element : response.getResponsesList()) {
* for (Location element : response.getLocationsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void asyncListBooksPaged() throws Exception {
.build();
while (true) {
ListBooksResponse response = libraryServiceClient.listBooksCallable().call(request);
for (Book element : response.getResponsesList()) {
for (Book element : response.getBooksList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static void asyncListShelvesPaged() throws Exception {
.build();
while (true) {
ListShelvesResponse response = libraryServiceClient.listShelvesCallable().call(request);
for (Shelf element : response.getResponsesList()) {
for (Shelf element : response.getShelvesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public final ListShelvesPagedResponse listShelves(ListShelvesRequest request) {
* .build();
* while (true) {
* ListShelvesResponse response = libraryServiceClient.listShelvesCallable().call(request);
* for (Shelf element : response.getResponsesList()) {
* for (Shelf element : response.getShelvesList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1047,7 +1047,7 @@ public final UnaryCallable<ListBooksRequest, ListBooksPagedResponse> listBooksPa
* .build();
* while (true) {
* ListBooksResponse response = libraryServiceClient.listBooksCallable().call(request);
* for (Book element : response.getResponsesList()) {
* for (Book element : response.getBooksList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void asyncListBucketsPaged() throws Exception {
.build();
while (true) {
ListBucketsResponse response = configClient.listBucketsCallable().call(request);
for (LogBucket element : response.getResponsesList()) {
for (LogBucket element : response.getBucketsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void asyncListExclusionsPaged() throws Exception {
.build();
while (true) {
ListExclusionsResponse response = configClient.listExclusionsCallable().call(request);
for (LogExclusion element : response.getResponsesList()) {
for (LogExclusion element : response.getExclusionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void asyncListSinksPaged() throws Exception {
.build();
while (true) {
ListSinksResponse response = configClient.listSinksCallable().call(request);
for (LogSink element : response.getResponsesList()) {
for (LogSink element : response.getSinksList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void asyncListViewsPaged() throws Exception {
.build();
while (true) {
ListViewsResponse response = configClient.listViewsCallable().call(request);
for (LogView element : response.getResponsesList()) {
for (LogView element : response.getViewsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static void asyncListLogEntriesPaged() throws Exception {
.build();
while (true) {
ListLogEntriesResponse response = loggingClient.listLogEntriesCallable().call(request);
for (LogEntry element : response.getResponsesList()) {
for (LogEntry element : response.getEntriesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void asyncListLogsPaged() throws Exception {
.build();
while (true) {
ListLogsResponse response = loggingClient.listLogsCallable().call(request);
for (String element : response.getResponsesList()) {
for (String element : response.getLogNamesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void asyncListMonitoredResourceDescriptorsPaged() throws Exception
while (true) {
ListMonitoredResourceDescriptorsResponse response =
loggingClient.listMonitoredResourceDescriptorsCallable().call(request);
for (MonitoredResourceDescriptor element : response.getResponsesList()) {
for (MonitoredResourceDescriptor element : response.getResourceDescriptorsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void asyncListLogMetricsPaged() throws Exception {
.build();
while (true) {
ListLogMetricsResponse response = metricsClient.listLogMetricsCallable().call(request);
for (LogMetric element : response.getResponsesList()) {
for (LogMetric element : response.getMetricsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ public final ListBucketsPagedResponse listBuckets(ListBucketsRequest request) {
* .build();
* while (true) {
* ListBucketsResponse response = configClient.listBucketsCallable().call(request);
* for (LogBucket element : response.getResponsesList()) {
* for (LogBucket element : response.getBucketsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -849,7 +849,7 @@ public final UnaryCallable<ListViewsRequest, ListViewsPagedResponse> listViewsPa
* .build();
* while (true) {
* ListViewsResponse response = configClient.listViewsCallable().call(request);
* for (LogView element : response.getResponsesList()) {
* for (LogView element : response.getViewsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -1298,7 +1298,7 @@ public final UnaryCallable<ListSinksRequest, ListSinksPagedResponse> listSinksPa
* .build();
* while (true) {
* ListSinksResponse response = configClient.listSinksCallable().call(request);
* for (LogSink element : response.getResponsesList()) {
* for (LogSink element : response.getSinksList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down Expand Up @@ -2239,7 +2239,7 @@ public final ListExclusionsPagedResponse listExclusions(ListExclusionsRequest re
* .build();
* while (true) {
* ListExclusionsResponse response = configClient.listExclusionsCallable().call(request);
* for (LogExclusion element : response.getResponsesList()) {
* for (LogExclusion element : response.getExclusionsList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
Expand Down
Loading

0 comments on commit 7f186b5

Please sign in to comment.