Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit 5ea164b

Browse files
fix: migrate to grpc_service_config (#238)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/9c18038c-d1ba-45ab-9ded-a79e3b7a4d1b/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 317872667 Source-Link: googleapis/googleapis@e8385a4
1 parent 9f3ff74 commit 5ea164b

File tree

9 files changed

+288
-241
lines changed

9 files changed

+288
-241
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file
1717
<dependency>
1818
<groupId>com.google.cloud</groupId>
1919
<artifactId>libraries-bom</artifactId>
20-
<version>7.0.0</version>
20+
<version>7.0.1</version>
2121
<type>pom</type>
2222
<scope>import</scope>
2323
</dependency>
@@ -38,7 +38,7 @@ If you are using Maven without BOM, add this to your dependencies:
3838
<dependency>
3939
<groupId>com.google.cloud</groupId>
4040
<artifactId>google-cloud-asset</artifactId>
41-
<version>1.3.0</version>
41+
<version>1.4.0</version>
4242
</dependency>
4343

4444
```
@@ -86,6 +86,25 @@ use this Cloud Asset Inventory Client Library.
8686

8787

8888

89+
## Samples
90+
91+
Samples are in the [`samples/`](https://github.com/googleapis/java-asset/tree/master/samples) directory. The samples' `README.md`
92+
has instructions for running the samples.
93+
94+
| Sample | Source Code | Try it |
95+
| --------------------------- | --------------------------------- | ------ |
96+
| Batch Get Assets History Example | [source code](https://github.com/googleapis/java-asset/blob/master/samples/snippets/src/main/java/com/example/asset/BatchGetAssetsHistoryExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/BatchGetAssetsHistoryExample.java) |
97+
| Create Feed Example | [source code](https://github.com/googleapis/java-asset/blob/master/samples/snippets/src/main/java/com/example/asset/CreateFeedExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/CreateFeedExample.java) |
98+
| Delete Feed Example | [source code](https://github.com/googleapis/java-asset/blob/master/samples/snippets/src/main/java/com/example/asset/DeleteFeedExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/DeleteFeedExample.java) |
99+
| Export Assets Bigquery Example | [source code](https://github.com/googleapis/java-asset/blob/master/samples/snippets/src/main/java/com/example/asset/ExportAssetsBigqueryExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/ExportAssetsBigqueryExample.java) |
100+
| Export Assets Example | [source code](https://github.com/googleapis/java-asset/blob/master/samples/snippets/src/main/java/com/example/asset/ExportAssetsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/ExportAssetsExample.java) |
101+
| Get Feed Example | [source code](https://github.com/googleapis/java-asset/blob/master/samples/snippets/src/main/java/com/example/asset/GetFeedExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/GetFeedExample.java) |
102+
| List Feeds Example | [source code](https://github.com/googleapis/java-asset/blob/master/samples/snippets/src/main/java/com/example/asset/ListFeedsExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/ListFeedsExample.java) |
103+
| Search All Iam Policies Example | [source code](https://github.com/googleapis/java-asset/blob/master/samples/snippets/src/main/java/com/example/asset/SearchAllIamPoliciesExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/SearchAllIamPoliciesExample.java) |
104+
| Search All Resources Example | [source code](https://github.com/googleapis/java-asset/blob/master/samples/snippets/src/main/java/com/example/asset/SearchAllResourcesExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/SearchAllResourcesExample.java) |
105+
| Update Feed Example | [source code](https://github.com/googleapis/java-asset/blob/master/samples/snippets/src/main/java/com/example/asset/UpdateFeedExample.java) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/java-asset&page=editor&open_in_editor=samples/snippets/src/main/java/com/example/asset/UpdateFeedExample.java) |
106+
107+
89108

90109
## Troubleshooting
91110

google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceClient.java

Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
* <pre>
4949
* <code>
5050
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
51-
* FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
52-
* assetServiceClient.deleteFeed(name);
51+
* String parent = "";
52+
* Feed response = assetServiceClient.createFeed(parent);
5353
* }
5454
* </code>
5555
* </pre>
@@ -170,98 +170,6 @@ public final OperationsClient getOperationsClient() {
170170
return operationsClient;
171171
}
172172

173-
// AUTO-GENERATED DOCUMENTATION AND METHOD
174-
/**
175-
* Deletes an asset feed.
176-
*
177-
* <p>Sample code:
178-
*
179-
* <pre><code>
180-
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
181-
* FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
182-
* assetServiceClient.deleteFeed(name);
183-
* }
184-
* </code></pre>
185-
*
186-
* @param name Required. The name of the feed and it must be in the format of:
187-
* projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id
188-
* organizations/organization_number/feeds/feed_id
189-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
190-
*/
191-
public final void deleteFeed(FeedName name) {
192-
DeleteFeedRequest request =
193-
DeleteFeedRequest.newBuilder().setName(name == null ? null : name.toString()).build();
194-
deleteFeed(request);
195-
}
196-
197-
// AUTO-GENERATED DOCUMENTATION AND METHOD
198-
/**
199-
* Deletes an asset feed.
200-
*
201-
* <p>Sample code:
202-
*
203-
* <pre><code>
204-
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
205-
* FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
206-
* assetServiceClient.deleteFeed(name.toString());
207-
* }
208-
* </code></pre>
209-
*
210-
* @param name Required. The name of the feed and it must be in the format of:
211-
* projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id
212-
* organizations/organization_number/feeds/feed_id
213-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
214-
*/
215-
public final void deleteFeed(String name) {
216-
DeleteFeedRequest request = DeleteFeedRequest.newBuilder().setName(name).build();
217-
deleteFeed(request);
218-
}
219-
220-
// AUTO-GENERATED DOCUMENTATION AND METHOD
221-
/**
222-
* Deletes an asset feed.
223-
*
224-
* <p>Sample code:
225-
*
226-
* <pre><code>
227-
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
228-
* FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
229-
* DeleteFeedRequest request = DeleteFeedRequest.newBuilder()
230-
* .setName(name.toString())
231-
* .build();
232-
* assetServiceClient.deleteFeed(request);
233-
* }
234-
* </code></pre>
235-
*
236-
* @param request The request object containing all of the parameters for the API call.
237-
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
238-
*/
239-
public final void deleteFeed(DeleteFeedRequest request) {
240-
deleteFeedCallable().call(request);
241-
}
242-
243-
// AUTO-GENERATED DOCUMENTATION AND METHOD
244-
/**
245-
* Deletes an asset feed.
246-
*
247-
* <p>Sample code:
248-
*
249-
* <pre><code>
250-
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
251-
* FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
252-
* DeleteFeedRequest request = DeleteFeedRequest.newBuilder()
253-
* .setName(name.toString())
254-
* .build();
255-
* ApiFuture&lt;Void&gt; future = assetServiceClient.deleteFeedCallable().futureCall(request);
256-
* // Do something
257-
* future.get();
258-
* }
259-
* </code></pre>
260-
*/
261-
public final UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
262-
return stub.deleteFeedCallable();
263-
}
264-
265173
// AUTO-GENERATED DOCUMENTATION AND METHOD
266174
/**
267175
* Exports assets with time and resource types to a given Cloud Storage location/BigQuery table.
@@ -725,6 +633,98 @@ public final UnaryCallable<UpdateFeedRequest, Feed> updateFeedCallable() {
725633
return stub.updateFeedCallable();
726634
}
727635

636+
// AUTO-GENERATED DOCUMENTATION AND METHOD
637+
/**
638+
* Deletes an asset feed.
639+
*
640+
* <p>Sample code:
641+
*
642+
* <pre><code>
643+
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
644+
* FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
645+
* assetServiceClient.deleteFeed(name);
646+
* }
647+
* </code></pre>
648+
*
649+
* @param name Required. The name of the feed and it must be in the format of:
650+
* projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id
651+
* organizations/organization_number/feeds/feed_id
652+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
653+
*/
654+
public final void deleteFeed(FeedName name) {
655+
DeleteFeedRequest request =
656+
DeleteFeedRequest.newBuilder().setName(name == null ? null : name.toString()).build();
657+
deleteFeed(request);
658+
}
659+
660+
// AUTO-GENERATED DOCUMENTATION AND METHOD
661+
/**
662+
* Deletes an asset feed.
663+
*
664+
* <p>Sample code:
665+
*
666+
* <pre><code>
667+
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
668+
* FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
669+
* assetServiceClient.deleteFeed(name.toString());
670+
* }
671+
* </code></pre>
672+
*
673+
* @param name Required. The name of the feed and it must be in the format of:
674+
* projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id
675+
* organizations/organization_number/feeds/feed_id
676+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
677+
*/
678+
public final void deleteFeed(String name) {
679+
DeleteFeedRequest request = DeleteFeedRequest.newBuilder().setName(name).build();
680+
deleteFeed(request);
681+
}
682+
683+
// AUTO-GENERATED DOCUMENTATION AND METHOD
684+
/**
685+
* Deletes an asset feed.
686+
*
687+
* <p>Sample code:
688+
*
689+
* <pre><code>
690+
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
691+
* FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
692+
* DeleteFeedRequest request = DeleteFeedRequest.newBuilder()
693+
* .setName(name.toString())
694+
* .build();
695+
* assetServiceClient.deleteFeed(request);
696+
* }
697+
* </code></pre>
698+
*
699+
* @param request The request object containing all of the parameters for the API call.
700+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
701+
*/
702+
public final void deleteFeed(DeleteFeedRequest request) {
703+
deleteFeedCallable().call(request);
704+
}
705+
706+
// AUTO-GENERATED DOCUMENTATION AND METHOD
707+
/**
708+
* Deletes an asset feed.
709+
*
710+
* <p>Sample code:
711+
*
712+
* <pre><code>
713+
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
714+
* FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
715+
* DeleteFeedRequest request = DeleteFeedRequest.newBuilder()
716+
* .setName(name.toString())
717+
* .build();
718+
* ApiFuture&lt;Void&gt; future = assetServiceClient.deleteFeedCallable().futureCall(request);
719+
* // Do something
720+
* future.get();
721+
* }
722+
* </code></pre>
723+
*/
724+
public final UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
725+
return stub.deleteFeedCallable();
726+
}
727+
728728
// AUTO-GENERATED DOCUMENTATION AND METHOD
729729
/**
730730
* Searches all the resources within the given accessible scope (e.g., a project, a folder or an

google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceSettings.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@
5252
* <p>The builder of this class is recursive, so contained classes are themselves builders. When
5353
* build() is called, the tree of builders is called to create the complete settings object.
5454
*
55-
* <p>For example, to set the total timeout of deleteFeed to 30 seconds:
55+
* <p>For example, to set the total timeout of createFeed to 30 seconds:
5656
*
5757
* <pre>
5858
* <code>
5959
* AssetServiceSettings.Builder assetServiceSettingsBuilder =
6060
* AssetServiceSettings.newBuilder();
6161
* assetServiceSettingsBuilder
62-
* .deleteFeedSettings()
62+
* .createFeedSettings()
6363
* .setRetrySettings(
64-
* assetServiceSettingsBuilder.deleteFeedSettings().getRetrySettings().toBuilder()
64+
* assetServiceSettingsBuilder.createFeedSettings().getRetrySettings().toBuilder()
6565
* .setTotalTimeout(Duration.ofSeconds(30))
6666
* .build());
6767
* AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build();
@@ -71,11 +71,6 @@
7171
@Generated("by gapic-generator")
7272
@BetaApi
7373
public class AssetServiceSettings extends ClientSettings<AssetServiceSettings> {
74-
/** Returns the object with the settings used for calls to deleteFeed. */
75-
public UnaryCallSettings<DeleteFeedRequest, Empty> deleteFeedSettings() {
76-
return ((AssetServiceStubSettings) getStubSettings()).deleteFeedSettings();
77-
}
78-
7974
/** Returns the object with the settings used for calls to exportAssets. */
8075
public UnaryCallSettings<ExportAssetsRequest, Operation> exportAssetsSettings() {
8176
return ((AssetServiceStubSettings) getStubSettings()).exportAssetsSettings();
@@ -115,6 +110,11 @@ public UnaryCallSettings<UpdateFeedRequest, Feed> updateFeedSettings() {
115110
return ((AssetServiceStubSettings) getStubSettings()).updateFeedSettings();
116111
}
117112

113+
/** Returns the object with the settings used for calls to deleteFeed. */
114+
public UnaryCallSettings<DeleteFeedRequest, Empty> deleteFeedSettings() {
115+
return ((AssetServiceStubSettings) getStubSettings()).deleteFeedSettings();
116+
}
117+
118118
/** Returns the object with the settings used for calls to searchAllResources. */
119119
public PagedCallSettings<
120120
SearchAllResourcesRequest, SearchAllResourcesResponse, SearchAllResourcesPagedResponse>
@@ -228,11 +228,6 @@ public Builder applyToAllUnaryMethods(
228228
return this;
229229
}
230230

231-
/** Returns the builder for the settings used for calls to deleteFeed. */
232-
public UnaryCallSettings.Builder<DeleteFeedRequest, Empty> deleteFeedSettings() {
233-
return getStubSettingsBuilder().deleteFeedSettings();
234-
}
235-
236231
/** Returns the builder for the settings used for calls to exportAssets. */
237232
public UnaryCallSettings.Builder<ExportAssetsRequest, Operation> exportAssetsSettings() {
238233
return getStubSettingsBuilder().exportAssetsSettings();
@@ -273,6 +268,11 @@ public UnaryCallSettings.Builder<UpdateFeedRequest, Feed> updateFeedSettings() {
273268
return getStubSettingsBuilder().updateFeedSettings();
274269
}
275270

271+
/** Returns the builder for the settings used for calls to deleteFeed. */
272+
public UnaryCallSettings.Builder<DeleteFeedRequest, Empty> deleteFeedSettings() {
273+
return getStubSettingsBuilder().deleteFeedSettings();
274+
}
275+
276276
/** Returns the builder for the settings used for calls to searchAllResources. */
277277
public PagedCallSettings.Builder<
278278
SearchAllResourcesRequest, SearchAllResourcesResponse, SearchAllResourcesPagedResponse>

google-cloud-asset/src/main/java/com/google/cloud/asset/v1/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
* <pre>
2929
* <code>
3030
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
31-
* FeedName name = FeedName.ofProjectFeedName("[PROJECT]", "[FEED]");
32-
* assetServiceClient.deleteFeed(name);
31+
* String parent = "";
32+
* Feed response = assetServiceClient.createFeed(parent);
3333
* }
3434
* </code>
3535
* </pre>

google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStub.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ public OperationsStub getOperationsStub() {
5757
throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
5858
}
5959

60-
public UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
61-
throw new UnsupportedOperationException("Not implemented: deleteFeedCallable()");
62-
}
63-
6460
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
6561
public OperationCallable<ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest>
6662
exportAssetsOperationCallable() {
@@ -92,6 +88,10 @@ public UnaryCallable<UpdateFeedRequest, Feed> updateFeedCallable() {
9288
throw new UnsupportedOperationException("Not implemented: updateFeedCallable()");
9389
}
9490

91+
public UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
92+
throw new UnsupportedOperationException("Not implemented: deleteFeedCallable()");
93+
}
94+
9595
public UnaryCallable<SearchAllResourcesRequest, SearchAllResourcesPagedResponse>
9696
searchAllResourcesPagedCallable() {
9797
throw new UnsupportedOperationException("Not implemented: searchAllResourcesPagedCallable()");

0 commit comments

Comments
 (0)