Skip to content
Permalink
Browse files
feat: add real time feed api into v1 version (#35)
  • Loading branch information
yoshi-automation authored and chingor13 committed Dec 13, 2019
1 parent 8ec47c9 commit 4bbdede752a1955fb242ed19b05d6a51bdeb7a66
Showing with 15,218 additions and 355 deletions.
  1. +361 −9 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceClient.java
  2. +53 −2 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceSettings.java
  3. +2 −9 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/package-info.java
  4. +28 −0 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStub.java
  5. +129 −4 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java
  6. +149 −0 google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java
  7. +202 −0 google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java
  8. +72 −0 google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetServiceImpl.java
  9. +592 −0 grpc-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetServiceGrpc.java
  10. +385 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/Asset.java
  11. +83 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetOrBuilder.java
  12. +29 −37 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetProto.java
  13. +196 −53 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetServiceProto.java
  14. +91 −13 ...o-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BatchGetAssetsHistoryRequest.java
  15. +22 −0 ...cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BatchGetAssetsHistoryRequestOrBuilder.java
  16. +6 −0 ...-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BatchGetAssetsHistoryResponse.java
  17. +47 −1 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestination.java
  18. +10 −0 ...o-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestinationOrBuilder.java
  19. +9 −1 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ContentType.java
  20. +1,155 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/CreateFeedRequest.java
  21. +132 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/CreateFeedRequestOrBuilder.java
  22. +651 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/DeleteFeedRequest.java
  23. +60 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/DeleteFeedRequestOrBuilder.java
  24. +99 −13 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ExportAssetsRequest.java
  25. +26 −0 ...o-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ExportAssetsRequestOrBuilder.java
  26. +22 −1 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ExportAssetsResponse.java
  27. +8 −0 ...-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ExportAssetsResponseOrBuilder.java
  28. +1,860 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/Feed.java
  29. +182 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/FeedName.java
  30. +285 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/FeedOrBuilder.java
  31. +828 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/FeedOutputConfig.java
  32. +62 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/FeedOutputConfigOrBuilder.java
  33. +47 −3 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/GcsDestination.java
  34. +8 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/GcsDestinationOrBuilder.java
  35. +666 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/GetFeedRequest.java
  36. +60 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/GetFeedRequestOrBuilder.java
  37. +646 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ListFeedsRequest.java
  38. +54 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ListFeedsRequestOrBuilder.java
  39. +920 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ListFeedsResponse.java
  40. +76 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ListFeedsResponseOrBuilder.java
  41. +31 −3 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/OutputConfig.java
  42. +8 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/OutputConfigOrBuilder.java
  43. +1 −1 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ProjectName.java
  44. +639 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/PubsubDestination.java
  45. +52 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/PubsubDestinationOrBuilder.java
  46. +94 −1 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/Resource.java
  47. +24 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ResourceOrBuilder.java
  48. +31 −1 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/TemporalAsset.java
  49. +10 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/TemporalAssetOrBuilder.java
  50. +22 −1 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/TimeWindow.java
  51. +8 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/TimeWindowOrBuilder.java
  52. +1,070 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/UpdateFeedRequest.java
  53. +116 −0 proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/UpdateFeedRequestOrBuilder.java
  54. +186 −0 proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/asset_service.proto
  55. +9 −1 proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/assets.proto
  56. +54 −1 proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/Asset.java
  57. +16 −0 proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetOrBuilder.java
  58. +10 −18 proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetProto.java
  59. +9 −17 proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceProto.java
  60. +91 −13 ...loud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryRequest.java
  61. +22 −0 ...t-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryRequestOrBuilder.java
  62. +6 −0 ...oud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryResponse.java
  63. +9 −1 proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ContentType.java
  64. +99 −13 ...-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ExportAssetsRequest.java
  65. +26 −0 ...loud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ExportAssetsRequestOrBuilder.java
  66. +22 −1 ...google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ExportAssetsResponse.java
  67. +8 −0 ...oud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ExportAssetsResponseOrBuilder.java
  68. +31 −3 proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/GcsDestination.java
  69. +4 −0 ...gle-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/GcsDestinationOrBuilder.java
  70. +23 −3 proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/OutputConfig.java
  71. +4 −0 ...oogle-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/OutputConfigOrBuilder.java
  72. +1 −1 proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ProjectName.java
  73. +94 −1 proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/Resource.java
  74. +24 −0 proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ResourceOrBuilder.java
  75. +31 −1 proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TemporalAsset.java
  76. +10 −0 ...ogle-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TemporalAssetOrBuilder.java
  77. +22 −1 proto-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TimeWindow.java
  78. +8 −0 ...-google-cloud-asset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TimeWindowOrBuilder.java
  79. +108 −13 proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/Asset.java
  80. +28 −0 ...o-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/AssetOrBuilder.java
  81. +10 −18 proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/AssetProto.java
  82. +12 −20 ...oogle-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceProto.java
  83. +91 −13 ...-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/BatchGetAssetsHistoryRequest.java
  84. +22 −0 ...p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/BatchGetAssetsHistoryRequestOrBuilder.java
  85. +6 −0 ...asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/BatchGetAssetsHistoryResponse.java
  86. +47 −1 ...gle-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/BigQueryDestination.java
  87. +10 −0 ...-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/BigQueryDestinationOrBuilder.java
  88. +9 −1 proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ContentType.java
  89. +46 −1 ...oogle-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/CreateFeedRequest.java
  90. +12 −0 ...ud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/CreateFeedRequestOrBuilder.java
  91. +22 −1 ...oogle-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/DeleteFeedRequest.java
  92. +4 −0 ...ud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/DeleteFeedRequestOrBuilder.java
  93. +99 −13 ...gle-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ExportAssetsRequest.java
  94. +26 −0 ...-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ExportAssetsRequestOrBuilder.java
  95. +22 −1 ...le-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ExportAssetsResponse.java
  96. +8 −0 ...asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ExportAssetsResponseOrBuilder.java
  97. +136 −23 proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/Feed.java
  98. +1 −1 proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/FeedName.java
  99. +32 −0 proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/FeedOrBuilder.java
  100. +23 −3 ...google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/FeedOutputConfig.java
  101. +4 −0 ...oud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/FeedOutputConfigOrBuilder.java
  102. +47 −3 ...o-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/GcsDestination.java
  103. +8 −0 ...cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/GcsDestinationOrBuilder.java
  104. +22 −1 ...o-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/GetFeedRequest.java
  105. +4 −0 ...cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/GetFeedRequestOrBuilder.java
  106. +22 −1 ...google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ListFeedsRequest.java
  107. +4 −0 ...oud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ListFeedsRequestOrBuilder.java
  108. +6 −0 ...oogle-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ListFeedsResponse.java
  109. +31 −3 proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/OutputConfig.java
  110. +8 −0 ...e-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/OutputConfigOrBuilder.java
  111. +22 −1 ...oogle-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/PubsubDestination.java
  112. +4 −0 ...ud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/PubsubDestinationOrBuilder.java
  113. +102 −1 proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/Resource.java
  114. +28 −0 ...oogle-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ResourceOrBuilder.java
  115. +31 −1 proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/TemporalAsset.java
  116. +10 −0 ...-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/TemporalAssetOrBuilder.java
  117. +22 −1 proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/TimeWindow.java
  118. +8 −0 ...gle-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/TimeWindowOrBuilder.java
  119. +22 −1 ...oogle-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/UpdateFeedRequest.java
  120. +8 −0 ...ud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/UpdateFeedRequestOrBuilder.java
  121. +793 −5 synth.metadata
@@ -24,6 +24,7 @@
import com.google.cloud.asset.v1.stub.AssetServiceStubSettings;
import com.google.longrunning.Operation;
import com.google.longrunning.OperationsClient;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
@@ -38,15 +39,8 @@
* <pre>
* <code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* ContentType contentType = ContentType.CONTENT_TYPE_UNSPECIFIED;
* TimeWindow readTimeWindow = TimeWindow.newBuilder().build();
* BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder()
* .setParent(parent.toString())
* .setContentType(contentType)
* .setReadTimeWindow(readTimeWindow)
* .build();
* BatchGetAssetsHistoryResponse response = assetServiceClient.batchGetAssetsHistory(request);
* String parent = "";
* Feed response = assetServiceClient.createFeed(parent);
* }
* </code>
* </pre>
@@ -317,6 +311,364 @@ public final BatchGetAssetsHistoryResponse batchGetAssetsHistory(
return stub.batchGetAssetsHistoryCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a feed in a parent project/folder/organization to listen to its asset updates.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* String parent = "";
* Feed response = assetServiceClient.createFeed(parent);
* }
* </code></pre>
*
* @param parent Required. The name of the project/folder/organization where this feed should be
* created in. It can only be an organization number (such as "organizations/123"), a folder
* number (such as "folders/123"), a project ID (such as "projects/my-project-id")", or a
* project number (such as "projects/12345").
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Feed createFeed(String parent) {

CreateFeedRequest request = CreateFeedRequest.newBuilder().setParent(parent).build();
return createFeed(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a feed in a parent project/folder/organization to listen to its asset updates.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* String parent = "";
* String feedId = "";
* Feed feed = Feed.newBuilder().build();
* CreateFeedRequest request = CreateFeedRequest.newBuilder()
* .setParent(parent)
* .setFeedId(feedId)
* .setFeed(feed)
* .build();
* Feed response = assetServiceClient.createFeed(request);
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Feed createFeed(CreateFeedRequest request) {
return createFeedCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Creates a feed in a parent project/folder/organization to listen to its asset updates.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* String parent = "";
* String feedId = "";
* Feed feed = Feed.newBuilder().build();
* CreateFeedRequest request = CreateFeedRequest.newBuilder()
* .setParent(parent)
* .setFeedId(feedId)
* .setFeed(feed)
* .build();
* ApiFuture&lt;Feed&gt; future = assetServiceClient.createFeedCallable().futureCall(request);
* // Do something
* Feed response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<CreateFeedRequest, Feed> createFeedCallable() {
return stub.createFeedCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets details about an asset feed.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* String formattedName = FeedName.format("[PROJECT]", "[FEED]");
* Feed response = assetServiceClient.getFeed(formattedName);
* }
* </code></pre>
*
* @param name Required. The name of the Feed and it must be in the format of:
* projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id
* organizations/organization_number/feeds/feed_id
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Feed getFeed(String name) {

GetFeedRequest request = GetFeedRequest.newBuilder().setName(name).build();
return getFeed(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets details about an asset feed.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* String formattedName = FeedName.format("[PROJECT]", "[FEED]");
* GetFeedRequest request = GetFeedRequest.newBuilder()
* .setName(formattedName)
* .build();
* Feed response = assetServiceClient.getFeed(request);
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Feed getFeed(GetFeedRequest request) {
return getFeedCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets details about an asset feed.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* String formattedName = FeedName.format("[PROJECT]", "[FEED]");
* GetFeedRequest request = GetFeedRequest.newBuilder()
* .setName(formattedName)
* .build();
* ApiFuture&lt;Feed&gt; future = assetServiceClient.getFeedCallable().futureCall(request);
* // Do something
* Feed response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<GetFeedRequest, Feed> getFeedCallable() {
return stub.getFeedCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists all asset feeds in a parent project/folder/organization.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* String parent = "";
* ListFeedsResponse response = assetServiceClient.listFeeds(parent);
* }
* </code></pre>
*
* @param parent Required. The parent project/folder/organization whose feeds are to be listed. It
* can only be using project/folder/organization number (such as "folders/12345")", or a
* project ID (such as "projects/my-project-id").
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListFeedsResponse listFeeds(String parent) {

ListFeedsRequest request = ListFeedsRequest.newBuilder().setParent(parent).build();
return listFeeds(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists all asset feeds in a parent project/folder/organization.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* String parent = "";
* ListFeedsRequest request = ListFeedsRequest.newBuilder()
* .setParent(parent)
* .build();
* ListFeedsResponse response = assetServiceClient.listFeeds(request);
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListFeedsResponse listFeeds(ListFeedsRequest request) {
return listFeedsCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Lists all asset feeds in a parent project/folder/organization.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* String parent = "";
* ListFeedsRequest request = ListFeedsRequest.newBuilder()
* .setParent(parent)
* .build();
* ApiFuture&lt;ListFeedsResponse&gt; future = assetServiceClient.listFeedsCallable().futureCall(request);
* // Do something
* ListFeedsResponse response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<ListFeedsRequest, ListFeedsResponse> listFeedsCallable() {
return stub.listFeedsCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates an asset feed configuration.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* Feed feed = Feed.newBuilder().build();
* Feed response = assetServiceClient.updateFeed(feed);
* }
* </code></pre>
*
* @param feed Required. The new values of feed details. It must match an existing feed and the
* field `name` must be in the format of: projects/project_number/feeds/feed_id or
* folders/folder_number/feeds/feed_id or organizations/organization_number/feeds/feed_id.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Feed updateFeed(Feed feed) {

UpdateFeedRequest request = UpdateFeedRequest.newBuilder().setFeed(feed).build();
return updateFeed(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates an asset feed configuration.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* Feed feed = Feed.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* UpdateFeedRequest request = UpdateFeedRequest.newBuilder()
* .setFeed(feed)
* .setUpdateMask(updateMask)
* .build();
* Feed response = assetServiceClient.updateFeed(request);
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Feed updateFeed(UpdateFeedRequest request) {
return updateFeedCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Updates an asset feed configuration.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* Feed feed = Feed.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* UpdateFeedRequest request = UpdateFeedRequest.newBuilder()
* .setFeed(feed)
* .setUpdateMask(updateMask)
* .build();
* ApiFuture&lt;Feed&gt; future = assetServiceClient.updateFeedCallable().futureCall(request);
* // Do something
* Feed response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<UpdateFeedRequest, Feed> updateFeedCallable() {
return stub.updateFeedCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes an asset feed.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* String formattedName = FeedName.format("[PROJECT]", "[FEED]");
* assetServiceClient.deleteFeed(formattedName);
* }
* </code></pre>
*
* @param name Required. The name of the feed and it must be in the format of:
* projects/project_number/feeds/feed_id folders/folder_number/feeds/feed_id
* organizations/organization_number/feeds/feed_id
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteFeed(String name) {

DeleteFeedRequest request = DeleteFeedRequest.newBuilder().setName(name).build();
deleteFeed(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes an asset feed.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* String formattedName = FeedName.format("[PROJECT]", "[FEED]");
* DeleteFeedRequest request = DeleteFeedRequest.newBuilder()
* .setName(formattedName)
* .build();
* assetServiceClient.deleteFeed(request);
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void deleteFeed(DeleteFeedRequest request) {
deleteFeedCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Deletes an asset feed.
*
* <p>Sample code:
*
* <pre><code>
* try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
* String formattedName = FeedName.format("[PROJECT]", "[FEED]");
* DeleteFeedRequest request = DeleteFeedRequest.newBuilder()
* .setName(formattedName)
* .build();
* ApiFuture&lt;Void&gt; future = assetServiceClient.deleteFeedCallable().futureCall(request);
* // Do something
* future.get();
* }
* </code></pre>
*/
public final UnaryCallable<DeleteFeedRequest, Empty> deleteFeedCallable() {
return stub.deleteFeedCallable();
}

@Override
public final void close() {
stub.close();

0 comments on commit 4bbdede

Please sign in to comment.