diff --git a/README.md b/README.md index 62e7a01ee..2b85af9b6 100644 --- a/README.md +++ b/README.md @@ -45,13 +45,13 @@ implementation 'com.google.cloud:google-cloud-aiplatform' If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-aiplatform:3.1.0' +implementation 'com.google.cloud:google-cloud-aiplatform:3.2.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-aiplatform" % "3.1.0" +libraryDependencies += "com.google.cloud" % "google-cloud-aiplatform" % "3.2.0" ``` ## Authentication diff --git a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceClient.java b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceClient.java index 19208a11a..0135bb4b3 100644 --- a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceClient.java +++ b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceClient.java @@ -335,6 +335,153 @@ public final ReadFeatureValuesResponse readFeatureValues(ReadFeatureValuesReques return stub.streamingReadFeatureValuesCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes Feature values of one or more entities of an EntityType. + * + *

The Feature values are merged into existing entities if any. The Feature values to be + * written must have timestamp within the online storage retention. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
+   *     FeaturestoreOnlineServingServiceClient.create()) {
+   *   EntityTypeName entityType =
+   *       EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]");
+   *   List payloads = new ArrayList<>();
+   *   WriteFeatureValuesResponse response =
+   *       featurestoreOnlineServingServiceClient.writeFeatureValues(entityType, payloads);
+   * }
+   * }
+ * + * @param entityType Required. The resource name of the EntityType for the entities being written. + * Value format: `projects/{project}/locations/{location}/featurestores/ + * {featurestore}/entityTypes/{entityType}`. For example, for a machine learning model + * predicting user clicks on a website, an EntityType ID could be `user`. + * @param payloads Required. The entities to be written. Up to 100,000 feature values can be + * written across all `payloads`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WriteFeatureValuesResponse writeFeatureValues( + EntityTypeName entityType, List payloads) { + WriteFeatureValuesRequest request = + WriteFeatureValuesRequest.newBuilder() + .setEntityType(entityType == null ? null : entityType.toString()) + .addAllPayloads(payloads) + .build(); + return writeFeatureValues(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes Feature values of one or more entities of an EntityType. + * + *

The Feature values are merged into existing entities if any. The Feature values to be + * written must have timestamp within the online storage retention. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
+   *     FeaturestoreOnlineServingServiceClient.create()) {
+   *   String entityType =
+   *       EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
+   *           .toString();
+   *   List payloads = new ArrayList<>();
+   *   WriteFeatureValuesResponse response =
+   *       featurestoreOnlineServingServiceClient.writeFeatureValues(entityType, payloads);
+   * }
+   * }
+ * + * @param entityType Required. The resource name of the EntityType for the entities being written. + * Value format: `projects/{project}/locations/{location}/featurestores/ + * {featurestore}/entityTypes/{entityType}`. For example, for a machine learning model + * predicting user clicks on a website, an EntityType ID could be `user`. + * @param payloads Required. The entities to be written. Up to 100,000 feature values can be + * written across all `payloads`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final WriteFeatureValuesResponse writeFeatureValues( + String entityType, List payloads) { + WriteFeatureValuesRequest request = + WriteFeatureValuesRequest.newBuilder() + .setEntityType(entityType) + .addAllPayloads(payloads) + .build(); + return writeFeatureValues(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes Feature values of one or more entities of an EntityType. + * + *

The Feature values are merged into existing entities if any. The Feature values to be + * written must have timestamp within the online storage retention. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
+   *     FeaturestoreOnlineServingServiceClient.create()) {
+   *   WriteFeatureValuesRequest request =
+   *       WriteFeatureValuesRequest.newBuilder()
+   *           .setEntityType(
+   *               EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
+   *                   .toString())
+   *           .addAllPayloads(new ArrayList())
+   *           .build();
+   *   WriteFeatureValuesResponse response =
+   *       featurestoreOnlineServingServiceClient.writeFeatureValues(request);
+   * }
+   * }
+ * + * @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 WriteFeatureValuesResponse writeFeatureValues(WriteFeatureValuesRequest request) { + return writeFeatureValuesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Writes Feature values of one or more entities of an EntityType. + * + *

The Feature values are merged into existing entities if any. The Feature values to be + * written must have timestamp within the online storage retention. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated for illustrative purposes only.
+   * // It may require modifications to work in your environment.
+   * try (FeaturestoreOnlineServingServiceClient featurestoreOnlineServingServiceClient =
+   *     FeaturestoreOnlineServingServiceClient.create()) {
+   *   WriteFeatureValuesRequest request =
+   *       WriteFeatureValuesRequest.newBuilder()
+   *           .setEntityType(
+   *               EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]")
+   *                   .toString())
+   *           .addAllPayloads(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       featurestoreOnlineServingServiceClient.writeFeatureValuesCallable().futureCall(request);
+   *   // Do something.
+   *   WriteFeatureValuesResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + writeFeatureValuesCallable() { + return stub.writeFeatureValuesCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. diff --git a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceSettings.java b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceSettings.java index 553ef04ee..f249827bc 100644 --- a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceSettings.java +++ b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceSettings.java @@ -99,6 +99,13 @@ public class FeaturestoreOnlineServingServiceSettings .streamingReadFeatureValuesSettings(); } + /** Returns the object with the settings used for calls to writeFeatureValues. */ + public UnaryCallSettings + writeFeatureValuesSettings() { + return ((FeaturestoreOnlineServingServiceStubSettings) getStubSettings()) + .writeFeatureValuesSettings(); + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -241,6 +248,12 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().streamingReadFeatureValuesSettings(); } + /** Returns the builder for the settings used for calls to writeFeatureValues. */ + public UnaryCallSettings.Builder + writeFeatureValuesSettings() { + return getStubSettingsBuilder().writeFeatureValuesSettings(); + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> diff --git a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/gapic_metadata.json b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/gapic_metadata.json index a50c2f33b..929f61958 100644 --- a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/gapic_metadata.json +++ b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/gapic_metadata.json @@ -171,6 +171,9 @@ }, "TestIamPermissions": { "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "WriteFeatureValues": { + "methods": ["writeFeatureValues", "writeFeatureValues", "writeFeatureValues", "writeFeatureValuesCallable"] } } } diff --git a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/FeaturestoreOnlineServingServiceStub.java b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/FeaturestoreOnlineServingServiceStub.java index b23bedfb9..86c84612f 100644 --- a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/FeaturestoreOnlineServingServiceStub.java +++ b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/FeaturestoreOnlineServingServiceStub.java @@ -25,6 +25,8 @@ import com.google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest; import com.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse; import com.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest; +import com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest; +import com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -57,6 +59,11 @@ public abstract class FeaturestoreOnlineServingServiceStub implements Background "Not implemented: streamingReadFeatureValuesCallable()"); } + public UnaryCallable + writeFeatureValuesCallable() { + throw new UnsupportedOperationException("Not implemented: writeFeatureValuesCallable()"); + } + public UnaryCallable listLocationsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); diff --git a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/FeaturestoreOnlineServingServiceStubSettings.java b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/FeaturestoreOnlineServingServiceStubSettings.java index 3e43a1164..425e37ecc 100644 --- a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/FeaturestoreOnlineServingServiceStubSettings.java +++ b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/FeaturestoreOnlineServingServiceStubSettings.java @@ -44,6 +44,8 @@ import com.google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest; import com.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse; import com.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest; +import com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest; +import com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -111,6 +113,8 @@ public class FeaturestoreOnlineServingServiceStubSettings private final ServerStreamingCallSettings< StreamingReadFeatureValuesRequest, ReadFeatureValuesResponse> streamingReadFeatureValuesSettings; + private final UnaryCallSettings + writeFeatureValuesSettings; private final PagedCallSettings< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -185,6 +189,12 @@ public ApiFuture getFuturePagedResponse( return streamingReadFeatureValuesSettings; } + /** Returns the object with the settings used for calls to writeFeatureValues. */ + public UnaryCallSettings + writeFeatureValuesSettings() { + return writeFeatureValuesSettings; + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -292,6 +302,7 @@ protected FeaturestoreOnlineServingServiceStubSettings(Builder settingsBuilder) readFeatureValuesSettings = settingsBuilder.readFeatureValuesSettings().build(); streamingReadFeatureValuesSettings = settingsBuilder.streamingReadFeatureValuesSettings().build(); + writeFeatureValuesSettings = settingsBuilder.writeFeatureValuesSettings().build(); listLocationsSettings = settingsBuilder.listLocationsSettings().build(); getLocationSettings = settingsBuilder.getLocationSettings().build(); setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); @@ -308,6 +319,8 @@ public static class Builder private final ServerStreamingCallSettings.Builder< StreamingReadFeatureValuesRequest, ReadFeatureValuesResponse> streamingReadFeatureValuesSettings; + private final UnaryCallSettings.Builder + writeFeatureValuesSettings; private final PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -355,6 +368,7 @@ protected Builder(ClientContext clientContext) { readFeatureValuesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); streamingReadFeatureValuesSettings = ServerStreamingCallSettings.newBuilder(); + writeFeatureValuesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -364,6 +378,7 @@ protected Builder(ClientContext clientContext) { unaryMethodSettingsBuilders = ImmutableList.>of( readFeatureValuesSettings, + writeFeatureValuesSettings, listLocationsSettings, getLocationSettings, setIamPolicySettings, @@ -377,6 +392,7 @@ protected Builder(FeaturestoreOnlineServingServiceStubSettings settings) { readFeatureValuesSettings = settings.readFeatureValuesSettings.toBuilder(); streamingReadFeatureValuesSettings = settings.streamingReadFeatureValuesSettings.toBuilder(); + writeFeatureValuesSettings = settings.writeFeatureValuesSettings.toBuilder(); listLocationsSettings = settings.listLocationsSettings.toBuilder(); getLocationSettings = settings.getLocationSettings.toBuilder(); setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); @@ -386,6 +402,7 @@ protected Builder(FeaturestoreOnlineServingServiceStubSettings settings) { unaryMethodSettingsBuilders = ImmutableList.>of( readFeatureValuesSettings, + writeFeatureValuesSettings, listLocationsSettings, getLocationSettings, setIamPolicySettings, @@ -417,6 +434,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_13_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_13_params")); + builder + .writeFeatureValuesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .listLocationsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) @@ -473,6 +495,12 @@ public Builder applyToAllUnaryMethods( return streamingReadFeatureValuesSettings; } + /** Returns the builder for the settings used for calls to writeFeatureValues. */ + public UnaryCallSettings.Builder + writeFeatureValuesSettings() { + return writeFeatureValuesSettings; + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> diff --git a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GrpcFeaturestoreOnlineServingServiceStub.java b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GrpcFeaturestoreOnlineServingServiceStub.java index a54e18972..5224b7f49 100644 --- a/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GrpcFeaturestoreOnlineServingServiceStub.java +++ b/google-cloud-aiplatform/src/main/java/com/google/cloud/aiplatform/v1beta1/stub/GrpcFeaturestoreOnlineServingServiceStub.java @@ -29,6 +29,8 @@ import com.google.cloud.aiplatform.v1beta1.ReadFeatureValuesRequest; import com.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse; import com.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest; +import com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest; +import com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse; import com.google.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -81,6 +83,18 @@ public class GrpcFeaturestoreOnlineServingServiceStub extends FeaturestoreOnline ProtoUtils.marshaller(ReadFeatureValuesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor + writeFeatureValuesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService/WriteFeatureValues") + .setRequestMarshaller( + ProtoUtils.marshaller(WriteFeatureValuesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(WriteFeatureValuesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor listLocationsMethodDescriptor = MethodDescriptor.newBuilder() @@ -132,6 +146,8 @@ public class GrpcFeaturestoreOnlineServingServiceStub extends FeaturestoreOnline private final ServerStreamingCallable< StreamingReadFeatureValuesRequest, ReadFeatureValuesResponse> streamingReadFeatureValuesCallable; + private final UnaryCallable + writeFeatureValuesCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; @@ -211,6 +227,17 @@ protected GrpcFeaturestoreOnlineServingServiceStub( return params.build(); }) .build(); + GrpcCallSettings + writeFeatureValuesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(writeFeatureValuesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("entity_type", String.valueOf(request.getEntityType())); + return params.build(); + }) + .build(); GrpcCallSettings listLocationsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listLocationsMethodDescriptor) @@ -273,6 +300,11 @@ protected GrpcFeaturestoreOnlineServingServiceStub( streamingReadFeatureValuesTransportSettings, settings.streamingReadFeatureValuesSettings(), clientContext); + this.writeFeatureValuesCallable = + callableFactory.createUnaryCallable( + writeFeatureValuesTransportSettings, + settings.writeFeatureValuesSettings(), + clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); @@ -314,6 +346,12 @@ public GrpcOperationsStub getOperationsStub() { return streamingReadFeatureValuesCallable; } + @Override + public UnaryCallable + writeFeatureValuesCallable() { + return writeFeatureValuesCallable; + } + @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; diff --git a/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceClientTest.java b/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceClientTest.java index e03ad0931..5294e2fac 100644 --- a/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceClientTest.java +++ b/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceClientTest.java @@ -242,6 +242,84 @@ public void streamingReadFeatureValuesExceptionTest() throws Exception { } } + @Test + public void writeFeatureValuesTest() throws Exception { + WriteFeatureValuesResponse expectedResponse = WriteFeatureValuesResponse.newBuilder().build(); + mockFeaturestoreOnlineServingService.addResponse(expectedResponse); + + EntityTypeName entityType = + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]"); + List payloads = new ArrayList<>(); + + WriteFeatureValuesResponse actualResponse = client.writeFeatureValues(entityType, payloads); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFeaturestoreOnlineServingService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + WriteFeatureValuesRequest actualRequest = ((WriteFeatureValuesRequest) actualRequests.get(0)); + + Assert.assertEquals(entityType.toString(), actualRequest.getEntityType()); + Assert.assertEquals(payloads, actualRequest.getPayloadsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void writeFeatureValuesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFeaturestoreOnlineServingService.addException(exception); + + try { + EntityTypeName entityType = + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[FEATURESTORE]", "[ENTITY_TYPE]"); + List payloads = new ArrayList<>(); + client.writeFeatureValues(entityType, payloads); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void writeFeatureValuesTest2() throws Exception { + WriteFeatureValuesResponse expectedResponse = WriteFeatureValuesResponse.newBuilder().build(); + mockFeaturestoreOnlineServingService.addResponse(expectedResponse); + + String entityType = "entityType-1482998339"; + List payloads = new ArrayList<>(); + + WriteFeatureValuesResponse actualResponse = client.writeFeatureValues(entityType, payloads); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFeaturestoreOnlineServingService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + WriteFeatureValuesRequest actualRequest = ((WriteFeatureValuesRequest) actualRequests.get(0)); + + Assert.assertEquals(entityType, actualRequest.getEntityType()); + Assert.assertEquals(payloads, actualRequest.getPayloadsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void writeFeatureValuesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFeaturestoreOnlineServingService.addException(exception); + + try { + String entityType = "entityType-1482998339"; + List payloads = new ArrayList<>(); + client.writeFeatureValues(entityType, payloads); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listLocationsTest() throws Exception { Location responsesElement = Location.newBuilder().build(); diff --git a/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/MockFeaturestoreOnlineServingServiceImpl.java b/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/MockFeaturestoreOnlineServingServiceImpl.java index 0f579326b..150dea11f 100644 --- a/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/MockFeaturestoreOnlineServingServiceImpl.java +++ b/google-cloud-aiplatform/src/test/java/com/google/cloud/aiplatform/v1beta1/MockFeaturestoreOnlineServingServiceImpl.java @@ -102,4 +102,26 @@ public void streamingReadFeatureValues( Exception.class.getName()))); } } + + @Override + public void writeFeatureValues( + WriteFeatureValuesRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof WriteFeatureValuesResponse) { + requests.add(request); + responseObserver.onNext(((WriteFeatureValuesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method WriteFeatureValues, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + WriteFeatureValuesResponse.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/grpc-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceGrpc.java b/grpc-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceGrpc.java index cdc61ecef..9c6001aa0 100644 --- a/grpc-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceGrpc.java +++ b/grpc-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServingServiceGrpc.java @@ -141,6 +141,58 @@ private FeaturestoreOnlineServingServiceGrpc() {} return getStreamingReadFeatureValuesMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse> + getWriteFeatureValuesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "WriteFeatureValues", + requestType = com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest.class, + responseType = com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse> + getWriteFeatureValuesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse> + getWriteFeatureValuesMethod; + if ((getWriteFeatureValuesMethod = + FeaturestoreOnlineServingServiceGrpc.getWriteFeatureValuesMethod) + == null) { + synchronized (FeaturestoreOnlineServingServiceGrpc.class) { + if ((getWriteFeatureValuesMethod = + FeaturestoreOnlineServingServiceGrpc.getWriteFeatureValuesMethod) + == null) { + FeaturestoreOnlineServingServiceGrpc.getWriteFeatureValuesMethod = + getWriteFeatureValuesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "WriteFeatureValues")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new FeaturestoreOnlineServingServiceMethodDescriptorSupplier( + "WriteFeatureValues")) + .build(); + } + } + } + return getWriteFeatureValuesMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static FeaturestoreOnlineServingServiceStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -227,6 +279,24 @@ public void streamingReadFeatureValues( getStreamingReadFeatureValuesMethod(), responseObserver); } + /** + * + * + *
+     * Writes Feature values of one or more entities of an EntityType.
+     * The Feature values are merged into existing entities if any. The Feature
+     * values to be written must have timestamp within the online storage
+     * retention.
+     * 
+ */ + public void writeFeatureValues( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getWriteFeatureValuesMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -244,6 +314,13 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.aiplatform.v1beta1.StreamingReadFeatureValuesRequest, com.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse>( this, METHODID_STREAMING_READ_FEATURE_VALUES))) + .addMethod( + getWriteFeatureValuesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse>( + this, METHODID_WRITE_FEATURE_VALUES))) .build(); } } @@ -305,6 +382,26 @@ public void streamingReadFeatureValues( request, responseObserver); } + + /** + * + * + *
+     * Writes Feature values of one or more entities of an EntityType.
+     * The Feature values are merged into existing entities if any. The Feature
+     * values to be written must have timestamp within the online storage
+     * retention.
+     * 
+ */ + public void writeFeatureValues( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getWriteFeatureValuesMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -357,6 +454,22 @@ public com.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse readFeature return io.grpc.stub.ClientCalls.blockingServerStreamingCall( getChannel(), getStreamingReadFeatureValuesMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Writes Feature values of one or more entities of an EntityType.
+     * The Feature values are merged into existing entities if any. The Feature
+     * values to be written must have timestamp within the online storage
+     * retention.
+     * 
+ */ + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse writeFeatureValues( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getWriteFeatureValuesMethod(), getCallOptions(), request); + } } /** @@ -394,10 +507,28 @@ protected FeaturestoreOnlineServingServiceFutureStub build( return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getReadFeatureValuesMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Writes Feature values of one or more entities of an EntityType.
+     * The Feature values are merged into existing entities if any. The Feature
+     * values to be written must have timestamp within the online storage
+     * retention.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse> + writeFeatureValues(com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getWriteFeatureValuesMethod(), getCallOptions()), request); + } } private static final int METHODID_READ_FEATURE_VALUES = 0; private static final int METHODID_STREAMING_READ_FEATURE_VALUES = 1; + private static final int METHODID_WRITE_FEATURE_VALUES = 2; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -430,6 +561,13 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv com.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse>) responseObserver); break; + case METHODID_WRITE_FEATURE_VALUES: + serviceImpl.writeFeatureValues( + (com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse>) + responseObserver); + break; default: throw new AssertionError(); } @@ -497,6 +635,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { new FeaturestoreOnlineServingServiceFileDescriptorSupplier()) .addMethod(getReadFeatureValuesMethod()) .addMethod(getStreamingReadFeatureValuesMethod()) + .addMethod(getWriteFeatureValuesMethod()) .build(); } } diff --git a/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServiceProto.java b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServiceProto.java index 4814424e1..40887e081 100644 --- a/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServiceProto.java +++ b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/FeaturestoreOnlineServiceProto.java @@ -27,6 +27,22 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_FeatureValuesEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_FeatureValuesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_aiplatform_v1beta1_ReadFeatureValuesRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -84,75 +100,93 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "/resource.proto\0326google/cloud/aiplatform" + "/v1beta1/feature_selector.proto\032+google/" + "cloud/aiplatform/v1beta1/types.proto\032\037go" - + "ogle/protobuf/timestamp.proto\"\306\001\n\030ReadFe" - + "atureValuesRequest\022A\n\013entity_type\030\001 \001(\tB" - + ",\340A\002\372A&\n$aiplatform.googleapis.com/Entit" - + "yType\022\026\n\tentity_id\030\002 \001(\tB\003\340A\002\022O\n\020feature" - + "_selector\030\003 \001(\01320.google.cloud.aiplatfor" - + "m.v1beta1.FeatureSelectorB\003\340A\002\"\263\005\n\031ReadF" - + "eatureValuesResponse\022Q\n\006header\030\001 \001(\0132A.g" - + "oogle.cloud.aiplatform.v1beta1.ReadFeatu" - + "reValuesResponse.Header\022Z\n\013entity_view\030\002" - + " \001(\0132E.google.cloud.aiplatform.v1beta1.R" - + "eadFeatureValuesResponse.EntityView\032\037\n\021F" - + "eatureDescriptor\022\n\n\002id\030\001 \001(\t\032\263\001\n\006Header\022" - + ">\n\013entity_type\030\001 \001(\tB)\372A&\n$aiplatform.go" - + "ogleapis.com/EntityType\022i\n\023feature_descr" - + "iptors\030\002 \003(\0132L.google.cloud.aiplatform.v" - + "1beta1.ReadFeatureValuesResponse.Feature" - + "Descriptor\032\217\002\n\nEntityView\022\021\n\tentity_id\030\001" - + " \001(\t\022X\n\004data\030\002 \003(\0132J.google.cloud.aiplat" - + "form.v1beta1.ReadFeatureValuesResponse.E" - + "ntityView.Data\032\223\001\n\004Data\022>\n\005value\030\001 \001(\0132-" - + ".google.cloud.aiplatform.v1beta1.Feature" - + "ValueH\000\022C\n\006values\030\002 \001(\01321.google.cloud.a" - + "iplatform.v1beta1.FeatureValueListH\000B\006\n\004" - + "data\"\320\001\n!StreamingReadFeatureValuesReque" - + "st\022A\n\013entity_type\030\001 \001(\tB,\340A\002\372A&\n$aiplatf" - + "orm.googleapis.com/EntityType\022\027\n\nentity_" - + "ids\030\002 \003(\tB\003\340A\002\022O\n\020feature_selector\030\003 \001(\013" - + "20.google.cloud.aiplatform.v1beta1.Featu" - + "reSelectorB\003\340A\002\"\276\004\n\014FeatureValue\022\024\n\nbool" - + "_value\030\001 \001(\010H\000\022\026\n\014double_value\030\002 \001(\001H\000\022\025" - + "\n\013int64_value\030\005 \001(\003H\000\022\026\n\014string_value\030\006 " - + "\001(\tH\000\022F\n\020bool_array_value\030\007 \001(\0132*.google" - + ".cloud.aiplatform.v1beta1.BoolArrayH\000\022J\n" - + "\022double_array_value\030\010 \001(\0132,.google.cloud" - + ".aiplatform.v1beta1.DoubleArrayH\000\022H\n\021int" - + "64_array_value\030\013 \001(\0132+.google.cloud.aipl" - + "atform.v1beta1.Int64ArrayH\000\022J\n\022string_ar" - + "ray_value\030\014 \001(\0132,.google.cloud.aiplatfor" - + "m.v1beta1.StringArrayH\000\022\025\n\013bytes_value\030\r" - + " \001(\014H\000\022H\n\010metadata\030\016 \001(\01326.google.cloud." - + "aiplatform.v1beta1.FeatureValue.Metadata" - + "\032=\n\010Metadata\0221\n\rgenerate_time\030\001 \001(\0132\032.go" - + "ogle.protobuf.TimestampB\007\n\005value\"Q\n\020Feat" - + "ureValueList\022=\n\006values\030\001 \003(\0132-.google.cl" - + "oud.aiplatform.v1beta1.FeatureValue2\230\005\n " - + "FeaturestoreOnlineServingService\022\202\002\n\021Rea" - + "dFeatureValues\0229.google.cloud.aiplatform" - + ".v1beta1.ReadFeatureValuesRequest\032:.goog" - + "le.cloud.aiplatform.v1beta1.ReadFeatureV" - + "aluesResponse\"v\202\323\344\223\002b\"]/v1beta1/{entity_" - + "type=projects/*/locations/*/featurestore" - + "s/*/entityTypes/*}:readFeatureValues:\001*\332" - + "A\013entity_type\022\237\002\n\032StreamingReadFeatureVa" - + "lues\022B.google.cloud.aiplatform.v1beta1.S" - + "treamingReadFeatureValuesRequest\032:.googl" - + "e.cloud.aiplatform.v1beta1.ReadFeatureVa" - + "luesResponse\"\177\202\323\344\223\002k\"f/v1beta1/{entity_t" - + "ype=projects/*/locations/*/featurestores" - + "/*/entityTypes/*}:streamingReadFeatureVa" - + "lues:\001*\332A\013entity_type0\001\032M\312A\031aiplatform.g" - + "oogleapis.com\322A.https://www.googleapis.c" - + "om/auth/cloud-platformB\373\001\n#com.google.cl" - + "oud.aiplatform.v1beta1B\036FeaturestoreOnli" - + "neServiceProtoP\001ZIgoogle.golang.org/genp" - + "roto/googleapis/cloud/aiplatform/v1beta1" - + ";aiplatform\252\002\037Google.Cloud.AIPlatform.V1" - + "Beta1\312\002\037Google\\Cloud\\AIPlatform\\V1beta1\352" - + "\002\"Google::Cloud::AIPlatform::V1beta1b\006pr" - + "oto3" + + "ogle/protobuf/timestamp.proto\"\261\001\n\031WriteF" + + "eatureValuesRequest\022A\n\013entity_type\030\001 \001(\t" + + "B,\340A\002\372A&\n$aiplatform.googleapis.com/Enti" + + "tyType\022Q\n\010payloads\030\002 \003(\0132:.google.cloud." + + "aiplatform.v1beta1.WriteFeatureValuesPay" + + "loadB\003\340A\002\"\204\002\n\031WriteFeatureValuesPayload\022" + + "\026\n\tentity_id\030\001 \001(\tB\003\340A\002\022j\n\016feature_value" + + "s\030\002 \003(\0132M.google.cloud.aiplatform.v1beta" + + "1.WriteFeatureValuesPayload.FeatureValue" + + "sEntryB\003\340A\002\032c\n\022FeatureValuesEntry\022\013\n\003key" + + "\030\001 \001(\t\022<\n\005value\030\002 \001(\0132-.google.cloud.aip" + + "latform.v1beta1.FeatureValue:\0028\001\"\034\n\032Writ" + + "eFeatureValuesResponse\"\306\001\n\030ReadFeatureVa" + + "luesRequest\022A\n\013entity_type\030\001 \001(\tB,\340A\002\372A&" + + "\n$aiplatform.googleapis.com/EntityType\022\026" + + "\n\tentity_id\030\002 \001(\tB\003\340A\002\022O\n\020feature_select" + + "or\030\003 \001(\01320.google.cloud.aiplatform.v1bet" + + "a1.FeatureSelectorB\003\340A\002\"\263\005\n\031ReadFeatureV" + + "aluesResponse\022Q\n\006header\030\001 \001(\0132A.google.c" + + "loud.aiplatform.v1beta1.ReadFeatureValue" + + "sResponse.Header\022Z\n\013entity_view\030\002 \001(\0132E." + + "google.cloud.aiplatform.v1beta1.ReadFeat" + + "ureValuesResponse.EntityView\032\037\n\021FeatureD" + + "escriptor\022\n\n\002id\030\001 \001(\t\032\263\001\n\006Header\022>\n\013enti" + + "ty_type\030\001 \001(\tB)\372A&\n$aiplatform.googleapi" + + "s.com/EntityType\022i\n\023feature_descriptors\030" + + "\002 \003(\0132L.google.cloud.aiplatform.v1beta1." + + "ReadFeatureValuesResponse.FeatureDescrip" + + "tor\032\217\002\n\nEntityView\022\021\n\tentity_id\030\001 \001(\t\022X\n" + + "\004data\030\002 \003(\0132J.google.cloud.aiplatform.v1" + + "beta1.ReadFeatureValuesResponse.EntityVi" + + "ew.Data\032\223\001\n\004Data\022>\n\005value\030\001 \001(\0132-.google" + + ".cloud.aiplatform.v1beta1.FeatureValueH\000" + + "\022C\n\006values\030\002 \001(\01321.google.cloud.aiplatfo" + + "rm.v1beta1.FeatureValueListH\000B\006\n\004data\"\320\001" + + "\n!StreamingReadFeatureValuesRequest\022A\n\013e" + + "ntity_type\030\001 \001(\tB,\340A\002\372A&\n$aiplatform.goo" + + "gleapis.com/EntityType\022\027\n\nentity_ids\030\002 \003" + + "(\tB\003\340A\002\022O\n\020feature_selector\030\003 \001(\01320.goog" + + "le.cloud.aiplatform.v1beta1.FeatureSelec" + + "torB\003\340A\002\"\276\004\n\014FeatureValue\022\024\n\nbool_value\030" + + "\001 \001(\010H\000\022\026\n\014double_value\030\002 \001(\001H\000\022\025\n\013int64" + + "_value\030\005 \001(\003H\000\022\026\n\014string_value\030\006 \001(\tH\000\022F" + + "\n\020bool_array_value\030\007 \001(\0132*.google.cloud." + + "aiplatform.v1beta1.BoolArrayH\000\022J\n\022double" + + "_array_value\030\010 \001(\0132,.google.cloud.aiplat" + + "form.v1beta1.DoubleArrayH\000\022H\n\021int64_arra" + + "y_value\030\013 \001(\0132+.google.cloud.aiplatform." + + "v1beta1.Int64ArrayH\000\022J\n\022string_array_val" + + "ue\030\014 \001(\0132,.google.cloud.aiplatform.v1bet" + + "a1.StringArrayH\000\022\025\n\013bytes_value\030\r \001(\014H\000\022" + + "H\n\010metadata\030\016 \001(\01326.google.cloud.aiplatf" + + "orm.v1beta1.FeatureValue.Metadata\032=\n\010Met" + + "adata\0221\n\rgenerate_time\030\001 \001(\0132\032.google.pr" + + "otobuf.TimestampB\007\n\005value\"Q\n\020FeatureValu" + + "eList\022=\n\006values\030\001 \003(\0132-.google.cloud.aip" + + "latform.v1beta1.FeatureValue2\253\007\n Feature" + + "storeOnlineServingService\022\202\002\n\021ReadFeatur" + + "eValues\0229.google.cloud.aiplatform.v1beta" + + "1.ReadFeatureValuesRequest\032:.google.clou" + + "d.aiplatform.v1beta1.ReadFeatureValuesRe" + + "sponse\"v\202\323\344\223\002b\"]/v1beta1/{entity_type=pr" + + "ojects/*/locations/*/featurestores/*/ent" + + "ityTypes/*}:readFeatureValues:\001*\332A\013entit" + + "y_type\022\237\002\n\032StreamingReadFeatureValues\022B." + + "google.cloud.aiplatform.v1beta1.Streamin" + + "gReadFeatureValuesRequest\032:.google.cloud" + + ".aiplatform.v1beta1.ReadFeatureValuesRes" + + "ponse\"\177\202\323\344\223\002k\"f/v1beta1/{entity_type=pro" + + "jects/*/locations/*/featurestores/*/enti" + + "tyTypes/*}:streamingReadFeatureValues:\001*" + + "\332A\013entity_type0\001\022\220\002\n\022WriteFeatureValues\022" + + ":.google.cloud.aiplatform.v1beta1.WriteF" + + "eatureValuesRequest\032;.google.cloud.aipla" + + "tform.v1beta1.WriteFeatureValuesResponse" + + "\"\200\001\202\323\344\223\002c\"^/v1beta1/{entity_type=project" + + "s/*/locations/*/featurestores/*/entityTy" + + "pes/*}:writeFeatureValues:\001*\332A\024entity_ty" + + "pe,payloads\032M\312A\031aiplatform.googleapis.co" + + "m\322A.https://www.googleapis.com/auth/clou" + + "d-platformB\373\001\n#com.google.cloud.aiplatfo" + + "rm.v1beta1B\036FeaturestoreOnlineServicePro" + + "toP\001ZIgoogle.golang.org/genproto/googlea" + + "pis/cloud/aiplatform/v1beta1;aiplatform\252" + + "\002\037Google.Cloud.AIPlatform.V1Beta1\312\002\037Goog" + + "le\\Cloud\\AIPlatform\\V1beta1\352\002\"Google::Cl" + + "oud::AIPlatform::V1beta1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -166,8 +200,40 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.cloud.aiplatform.v1beta1.TypesProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }); - internal_static_google_cloud_aiplatform_v1beta1_ReadFeatureValuesRequest_descriptor = + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesRequest_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesRequest_descriptor, + new java.lang.String[] { + "EntityType", "Payloads", + }); + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_descriptor, + new java.lang.String[] { + "EntityId", "FeatureValues", + }); + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_FeatureValuesEntry_descriptor = + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_FeatureValuesEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_FeatureValuesEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_aiplatform_v1beta1_ReadFeatureValuesRequest_descriptor = + getDescriptor().getMessageTypes().get(3); internal_static_google_cloud_aiplatform_v1beta1_ReadFeatureValuesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1beta1_ReadFeatureValuesRequest_descriptor, @@ -175,7 +241,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EntityType", "EntityId", "FeatureSelector", }); internal_static_google_cloud_aiplatform_v1beta1_ReadFeatureValuesResponse_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageTypes().get(4); internal_static_google_cloud_aiplatform_v1beta1_ReadFeatureValuesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1beta1_ReadFeatureValuesResponse_descriptor, @@ -223,7 +289,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Value", "Values", "Data", }); internal_static_google_cloud_aiplatform_v1beta1_StreamingReadFeatureValuesRequest_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(5); internal_static_google_cloud_aiplatform_v1beta1_StreamingReadFeatureValuesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1beta1_StreamingReadFeatureValuesRequest_descriptor, @@ -231,7 +297,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EntityType", "EntityIds", "FeatureSelector", }); internal_static_google_cloud_aiplatform_v1beta1_FeatureValue_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(6); internal_static_google_cloud_aiplatform_v1beta1_FeatureValue_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1beta1_FeatureValue_descriptor, @@ -259,7 +325,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "GenerateTime", }); internal_static_google_cloud_aiplatform_v1beta1_FeatureValueList_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(7); internal_static_google_cloud_aiplatform_v1beta1_FeatureValueList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_aiplatform_v1beta1_FeatureValueList_descriptor, diff --git a/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesPayload.java b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesPayload.java new file mode 100644 index 000000000..76b08611e --- /dev/null +++ b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesPayload.java @@ -0,0 +1,1061 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/aiplatform/v1beta1/featurestore_online_service.proto + +package com.google.cloud.aiplatform.v1beta1; + +/** + * + * + *
+ * Contains Feature values to be written for a specific entity.
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload} + */ +public final class WriteFeatureValuesPayload extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload) + WriteFeatureValuesPayloadOrBuilder { + private static final long serialVersionUID = 0L; + // Use WriteFeatureValuesPayload.newBuilder() to construct. + private WriteFeatureValuesPayload(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteFeatureValuesPayload() { + entityId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WriteFeatureValuesPayload(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WriteFeatureValuesPayload( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + entityId_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + featureValues_ = + com.google.protobuf.MapField.newMapField( + FeatureValuesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.aiplatform.v1beta1.FeatureValue> + featureValues__ = + input.readMessage( + FeatureValuesDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + featureValues_ + .getMutableMap() + .put(featureValues__.getKey(), featureValues__.getValue()); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetFeatureValues(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.class, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.Builder.class); + } + + public static final int ENTITY_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object entityId_; + /** + * + * + *
+   * Required. The ID of the entity.
+   * 
+ * + * string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The entityId. + */ + @java.lang.Override + public java.lang.String getEntityId() { + java.lang.Object ref = entityId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entityId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID of the entity.
+   * 
+ * + * string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for entityId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntityIdBytes() { + java.lang.Object ref = entityId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FEATURE_VALUES_FIELD_NUMBER = 2; + + private static final class FeatureValuesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.aiplatform.v1beta1.FeatureValue> + defaultEntry = + com.google.protobuf.MapEntry + . + newDefaultInstance( + com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_FeatureValuesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.aiplatform.v1beta1.FeatureValue.getDefaultInstance()); + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.aiplatform.v1beta1.FeatureValue> + featureValues_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.aiplatform.v1beta1.FeatureValue> + internalGetFeatureValues() { + if (featureValues_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FeatureValuesDefaultEntryHolder.defaultEntry); + } + return featureValues_; + } + + public int getFeatureValuesCount() { + return internalGetFeatureValues().getMap().size(); + } + /** + * + * + *
+   * Required. Feature values to be written, mapping from Feature ID to value. Up to
+   * 100,000 `feature_values` entries may be written across all payloads.  The
+   * feature generation time, aligned by days, must be no older than five
+   * years (1825 days) and no later than one year (366 days) in the future.
+   * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsFeatureValues(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetFeatureValues().getMap().containsKey(key); + } + /** Use {@link #getFeatureValuesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getFeatureValues() { + return getFeatureValuesMap(); + } + /** + * + * + *
+   * Required. Feature values to be written, mapping from Feature ID to value. Up to
+   * 100,000 `feature_values` entries may be written across all payloads.  The
+   * feature generation time, aligned by days, must be no older than five
+   * years (1825 days) and no later than one year (366 days) in the future.
+   * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map + getFeatureValuesMap() { + return internalGetFeatureValues().getMap(); + } + /** + * + * + *
+   * Required. Feature values to be written, mapping from Feature ID to value. Up to
+   * 100,000 `feature_values` entries may be written across all payloads.  The
+   * feature generation time, aligned by days, must be no older than five
+   * years (1825 days) and no later than one year (366 days) in the future.
+   * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.FeatureValue getFeatureValuesOrDefault( + java.lang.String key, com.google.cloud.aiplatform.v1beta1.FeatureValue defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetFeatureValues().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Required. Feature values to be written, mapping from Feature ID to value. Up to
+   * 100,000 `feature_values` entries may be written across all payloads.  The
+   * feature generation time, aligned by days, must be no older than five
+   * years (1825 days) and no later than one year (366 days) in the future.
+   * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.FeatureValue getFeatureValuesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetFeatureValues().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entityId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, entityId_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetFeatureValues(), FeatureValuesDefaultEntryHolder.defaultEntry, 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entityId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, entityId_); + } + for (java.util.Map.Entry + entry : internalGetFeatureValues().getMap().entrySet()) { + com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.aiplatform.v1beta1.FeatureValue> + featureValues__ = + FeatureValuesDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, featureValues__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload other = + (com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload) obj; + + if (!getEntityId().equals(other.getEntityId())) return false; + if (!internalGetFeatureValues().equals(other.internalGetFeatureValues())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENTITY_ID_FIELD_NUMBER; + hash = (53 * hash) + getEntityId().hashCode(); + if (!internalGetFeatureValues().getMap().isEmpty()) { + hash = (37 * hash) + FEATURE_VALUES_FIELD_NUMBER; + hash = (53 * hash) + internalGetFeatureValues().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Contains Feature values to be written for a specific entity.
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload) + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayloadOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 2: + return internalGetFeatureValues(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 2: + return internalGetMutableFeatureValues(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.class, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + entityId_ = ""; + + internalGetMutableFeatureValues().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesPayload_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload + getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload build() { + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload buildPartial() { + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload result = + new com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload(this); + int from_bitField0_ = bitField0_; + result.entityId_ = entityId_; + result.featureValues_ = internalGetFeatureValues(); + result.featureValues_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload) { + return mergeFrom((com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload other) { + if (other + == com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.getDefaultInstance()) + return this; + if (!other.getEntityId().isEmpty()) { + entityId_ = other.entityId_; + onChanged(); + } + internalGetMutableFeatureValues().mergeFrom(other.internalGetFeatureValues()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object entityId_ = ""; + /** + * + * + *
+     * Required. The ID of the entity.
+     * 
+ * + * string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The entityId. + */ + public java.lang.String getEntityId() { + java.lang.Object ref = entityId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entityId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID of the entity.
+     * 
+ * + * string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for entityId. + */ + public com.google.protobuf.ByteString getEntityIdBytes() { + java.lang.Object ref = entityId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID of the entity.
+     * 
+ * + * string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The entityId to set. + * @return This builder for chaining. + */ + public Builder setEntityId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entityId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the entity.
+     * 
+ * + * string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearEntityId() { + + entityId_ = getDefaultInstance().getEntityId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID of the entity.
+     * 
+ * + * string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for entityId to set. + * @return This builder for chaining. + */ + public Builder setEntityIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entityId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.aiplatform.v1beta1.FeatureValue> + featureValues_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.aiplatform.v1beta1.FeatureValue> + internalGetFeatureValues() { + if (featureValues_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FeatureValuesDefaultEntryHolder.defaultEntry); + } + return featureValues_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.aiplatform.v1beta1.FeatureValue> + internalGetMutableFeatureValues() { + onChanged(); + ; + if (featureValues_ == null) { + featureValues_ = + com.google.protobuf.MapField.newMapField(FeatureValuesDefaultEntryHolder.defaultEntry); + } + if (!featureValues_.isMutable()) { + featureValues_ = featureValues_.copy(); + } + return featureValues_; + } + + public int getFeatureValuesCount() { + return internalGetFeatureValues().getMap().size(); + } + /** + * + * + *
+     * Required. Feature values to be written, mapping from Feature ID to value. Up to
+     * 100,000 `feature_values` entries may be written across all payloads.  The
+     * feature generation time, aligned by days, must be no older than five
+     * years (1825 days) and no later than one year (366 days) in the future.
+     * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public boolean containsFeatureValues(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetFeatureValues().getMap().containsKey(key); + } + /** Use {@link #getFeatureValuesMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map + getFeatureValues() { + return getFeatureValuesMap(); + } + /** + * + * + *
+     * Required. Feature values to be written, mapping from Feature ID to value. Up to
+     * 100,000 `feature_values` entries may be written across all payloads.  The
+     * feature generation time, aligned by days, must be no older than five
+     * years (1825 days) and no later than one year (366 days) in the future.
+     * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.Map + getFeatureValuesMap() { + return internalGetFeatureValues().getMap(); + } + /** + * + * + *
+     * Required. Feature values to be written, mapping from Feature ID to value. Up to
+     * 100,000 `feature_values` entries may be written across all payloads.  The
+     * feature generation time, aligned by days, must be no older than five
+     * years (1825 days) and no later than one year (366 days) in the future.
+     * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.FeatureValue getFeatureValuesOrDefault( + java.lang.String key, com.google.cloud.aiplatform.v1beta1.FeatureValue defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetFeatureValues().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Required. Feature values to be written, mapping from Feature ID to value. Up to
+     * 100,000 `feature_values` entries may be written across all payloads.  The
+     * feature generation time, aligned by days, must be no older than five
+     * years (1825 days) and no later than one year (366 days) in the future.
+     * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.FeatureValue getFeatureValuesOrThrow( + java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = + internalGetFeatureValues().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearFeatureValues() { + internalGetMutableFeatureValues().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Required. Feature values to be written, mapping from Feature ID to value. Up to
+     * 100,000 `feature_values` entries may be written across all payloads.  The
+     * feature generation time, aligned by days, must be no older than five
+     * years (1825 days) and no later than one year (366 days) in the future.
+     * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removeFeatureValues(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableFeatureValues().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map + getMutableFeatureValues() { + return internalGetMutableFeatureValues().getMutableMap(); + } + /** + * + * + *
+     * Required. Feature values to be written, mapping from Feature ID to value. Up to
+     * 100,000 `feature_values` entries may be written across all payloads.  The
+     * feature generation time, aligned by days, must be no older than five
+     * years (1825 days) and no later than one year (366 days) in the future.
+     * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putFeatureValues( + java.lang.String key, com.google.cloud.aiplatform.v1beta1.FeatureValue value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + + internalGetMutableFeatureValues().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * Required. Feature values to be written, mapping from Feature ID to value. Up to
+     * 100,000 `feature_values` entries may be written across all payloads.  The
+     * feature generation time, aligned by days, must be no older than five
+     * years (1825 days) and no later than one year (366 days) in the future.
+     * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder putAllFeatureValues( + java.util.Map values) { + internalGetMutableFeatureValues().getMutableMap().putAll(values); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload) + private static final com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload(); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteFeatureValuesPayload parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteFeatureValuesPayload(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesPayloadOrBuilder.java b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesPayloadOrBuilder.java new file mode 100644 index 000000000..690d52ace --- /dev/null +++ b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesPayloadOrBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/aiplatform/v1beta1/featurestore_online_service.proto + +package com.google.cloud.aiplatform.v1beta1; + +public interface WriteFeatureValuesPayloadOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The ID of the entity.
+   * 
+ * + * string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The entityId. + */ + java.lang.String getEntityId(); + /** + * + * + *
+   * Required. The ID of the entity.
+   * 
+ * + * string entity_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for entityId. + */ + com.google.protobuf.ByteString getEntityIdBytes(); + + /** + * + * + *
+   * Required. Feature values to be written, mapping from Feature ID to value. Up to
+   * 100,000 `feature_values` entries may be written across all payloads.  The
+   * feature generation time, aligned by days, must be no older than five
+   * years (1825 days) and no later than one year (366 days) in the future.
+   * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getFeatureValuesCount(); + /** + * + * + *
+   * Required. Feature values to be written, mapping from Feature ID to value. Up to
+   * 100,000 `feature_values` entries may be written across all payloads.  The
+   * feature generation time, aligned by days, must be no older than five
+   * years (1825 days) and no later than one year (366 days) in the future.
+   * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + boolean containsFeatureValues(java.lang.String key); + /** Use {@link #getFeatureValuesMap()} instead. */ + @java.lang.Deprecated + java.util.Map + getFeatureValues(); + /** + * + * + *
+   * Required. Feature values to be written, mapping from Feature ID to value. Up to
+   * 100,000 `feature_values` entries may be written across all payloads.  The
+   * feature generation time, aligned by days, must be no older than five
+   * years (1825 days) and no later than one year (366 days) in the future.
+   * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.Map + getFeatureValuesMap(); + /** + * + * + *
+   * Required. Feature values to be written, mapping from Feature ID to value. Up to
+   * 100,000 `feature_values` entries may be written across all payloads.  The
+   * feature generation time, aligned by days, must be no older than five
+   * years (1825 days) and no later than one year (366 days) in the future.
+   * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + + /* nullable */ + com.google.cloud.aiplatform.v1beta1.FeatureValue getFeatureValuesOrDefault( + java.lang.String key, + /* nullable */ + com.google.cloud.aiplatform.v1beta1.FeatureValue defaultValue); + /** + * + * + *
+   * Required. Feature values to be written, mapping from Feature ID to value. Up to
+   * 100,000 `feature_values` entries may be written across all payloads.  The
+   * feature generation time, aligned by days, must be no older than five
+   * years (1825 days) and no later than one year (366 days) in the future.
+   * 
+ * + * + * map<string, .google.cloud.aiplatform.v1beta1.FeatureValue> feature_values = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.aiplatform.v1beta1.FeatureValue getFeatureValuesOrThrow(java.lang.String key); +} diff --git a/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesRequest.java b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesRequest.java new file mode 100644 index 000000000..6d4dd1417 --- /dev/null +++ b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesRequest.java @@ -0,0 +1,1270 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/aiplatform/v1beta1/featurestore_online_service.proto + +package com.google.cloud.aiplatform.v1beta1; + +/** + * + * + *
+ * Request message for [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest} + */ +public final class WriteFeatureValuesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest) + WriteFeatureValuesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use WriteFeatureValuesRequest.newBuilder() to construct. + private WriteFeatureValuesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteFeatureValuesRequest() { + entityType_ = ""; + payloads_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WriteFeatureValuesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WriteFeatureValuesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + entityType_ = s; + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + payloads_ = + new java.util.ArrayList< + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload>(); + mutable_bitField0_ |= 0x00000001; + } + payloads_.add( + input.readMessage( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + payloads_ = java.util.Collections.unmodifiableList(payloads_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest.class, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest.Builder.class); + } + + public static final int ENTITY_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object entityType_; + /** + * + * + *
+   * Required. The resource name of the EntityType for the entities being written.
+   * Value format: `projects/{project}/locations/{location}/featurestores/
+   * {featurestore}/entityTypes/{entityType}`. For example,
+   * for a machine learning model predicting user clicks on a website, an
+   * EntityType ID could be `user`.
+   * 
+ * + * + * string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The entityType. + */ + @java.lang.Override + public java.lang.String getEntityType() { + java.lang.Object ref = entityType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entityType_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the EntityType for the entities being written.
+   * Value format: `projects/{project}/locations/{location}/featurestores/
+   * {featurestore}/entityTypes/{entityType}`. For example,
+   * for a machine learning model predicting user clicks on a website, an
+   * EntityType ID could be `user`.
+   * 
+ * + * + * string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for entityType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEntityTypeBytes() { + java.lang.Object ref = entityType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAYLOADS_FIELD_NUMBER = 2; + private java.util.List payloads_; + /** + * + * + *
+   * Required. The entities to be written. Up to 100,000 feature values can be written
+   * across all `payloads`.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getPayloadsList() { + return payloads_; + } + /** + * + * + *
+   * Required. The entities to be written. Up to 100,000 feature values can be written
+   * across all `payloads`.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayloadOrBuilder> + getPayloadsOrBuilderList() { + return payloads_; + } + /** + * + * + *
+   * Required. The entities to be written. Up to 100,000 feature values can be written
+   * across all `payloads`.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getPayloadsCount() { + return payloads_.size(); + } + /** + * + * + *
+   * Required. The entities to be written. Up to 100,000 feature values can be written
+   * across all `payloads`.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload getPayloads(int index) { + return payloads_.get(index); + } + /** + * + * + *
+   * Required. The entities to be written. Up to 100,000 feature values can be written
+   * across all `payloads`.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayloadOrBuilder + getPayloadsOrBuilder(int index) { + return payloads_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entityType_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, entityType_); + } + for (int i = 0; i < payloads_.size(); i++) { + output.writeMessage(2, payloads_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(entityType_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, entityType_); + } + for (int i = 0; i < payloads_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, payloads_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest other = + (com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest) obj; + + if (!getEntityType().equals(other.getEntityType())) return false; + if (!getPayloadsList().equals(other.getPayloadsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENTITY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getEntityType().hashCode(); + if (getPayloadsCount() > 0) { + hash = (37 * hash) + PAYLOADS_FIELD_NUMBER; + hash = (53 * hash) + getPayloadsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest) + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest.class, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getPayloadsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + entityType_ = ""; + + if (payloadsBuilder_ == null) { + payloads_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + payloadsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest + getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest build() { + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest buildPartial() { + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest result = + new com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest(this); + int from_bitField0_ = bitField0_; + result.entityType_ = entityType_; + if (payloadsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + payloads_ = java.util.Collections.unmodifiableList(payloads_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.payloads_ = payloads_; + } else { + result.payloads_ = payloadsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest) { + return mergeFrom((com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest other) { + if (other + == com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest.getDefaultInstance()) + return this; + if (!other.getEntityType().isEmpty()) { + entityType_ = other.entityType_; + onChanged(); + } + if (payloadsBuilder_ == null) { + if (!other.payloads_.isEmpty()) { + if (payloads_.isEmpty()) { + payloads_ = other.payloads_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensurePayloadsIsMutable(); + payloads_.addAll(other.payloads_); + } + onChanged(); + } + } else { + if (!other.payloads_.isEmpty()) { + if (payloadsBuilder_.isEmpty()) { + payloadsBuilder_.dispose(); + payloadsBuilder_ = null; + payloads_ = other.payloads_; + bitField0_ = (bitField0_ & ~0x00000001); + payloadsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPayloadsFieldBuilder() + : null; + } else { + payloadsBuilder_.addAllMessages(other.payloads_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object entityType_ = ""; + /** + * + * + *
+     * Required. The resource name of the EntityType for the entities being written.
+     * Value format: `projects/{project}/locations/{location}/featurestores/
+     * {featurestore}/entityTypes/{entityType}`. For example,
+     * for a machine learning model predicting user clicks on a website, an
+     * EntityType ID could be `user`.
+     * 
+ * + * + * string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The entityType. + */ + public java.lang.String getEntityType() { + java.lang.Object ref = entityType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + entityType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the EntityType for the entities being written.
+     * Value format: `projects/{project}/locations/{location}/featurestores/
+     * {featurestore}/entityTypes/{entityType}`. For example,
+     * for a machine learning model predicting user clicks on a website, an
+     * EntityType ID could be `user`.
+     * 
+ * + * + * string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for entityType. + */ + public com.google.protobuf.ByteString getEntityTypeBytes() { + java.lang.Object ref = entityType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + entityType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the EntityType for the entities being written.
+     * Value format: `projects/{project}/locations/{location}/featurestores/
+     * {featurestore}/entityTypes/{entityType}`. For example,
+     * for a machine learning model predicting user clicks on a website, an
+     * EntityType ID could be `user`.
+     * 
+ * + * + * string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The entityType to set. + * @return This builder for chaining. + */ + public Builder setEntityType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entityType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the EntityType for the entities being written.
+     * Value format: `projects/{project}/locations/{location}/featurestores/
+     * {featurestore}/entityTypes/{entityType}`. For example,
+     * for a machine learning model predicting user clicks on a website, an
+     * EntityType ID could be `user`.
+     * 
+ * + * + * string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearEntityType() { + + entityType_ = getDefaultInstance().getEntityType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the EntityType for the entities being written.
+     * Value format: `projects/{project}/locations/{location}/featurestores/
+     * {featurestore}/entityTypes/{entityType}`. For example,
+     * for a machine learning model predicting user clicks on a website, an
+     * EntityType ID could be `user`.
+     * 
+ * + * + * string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for entityType to set. + * @return This builder for chaining. + */ + public Builder setEntityTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entityType_ = value; + onChanged(); + return this; + } + + private java.util.List + payloads_ = java.util.Collections.emptyList(); + + private void ensurePayloadsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + payloads_ = + new java.util.ArrayList( + payloads_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.Builder, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayloadOrBuilder> + payloadsBuilder_; + + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPayloadsList() { + if (payloadsBuilder_ == null) { + return java.util.Collections.unmodifiableList(payloads_); + } else { + return payloadsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getPayloadsCount() { + if (payloadsBuilder_ == null) { + return payloads_.size(); + } else { + return payloadsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload getPayloads(int index) { + if (payloadsBuilder_ == null) { + return payloads_.get(index); + } else { + return payloadsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPayloads( + int index, com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload value) { + if (payloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePayloadsIsMutable(); + payloads_.set(index, value); + onChanged(); + } else { + payloadsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPayloads( + int index, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.Builder builderForValue) { + if (payloadsBuilder_ == null) { + ensurePayloadsIsMutable(); + payloads_.set(index, builderForValue.build()); + onChanged(); + } else { + payloadsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPayloads( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload value) { + if (payloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePayloadsIsMutable(); + payloads_.add(value); + onChanged(); + } else { + payloadsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPayloads( + int index, com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload value) { + if (payloadsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePayloadsIsMutable(); + payloads_.add(index, value); + onChanged(); + } else { + payloadsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPayloads( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.Builder builderForValue) { + if (payloadsBuilder_ == null) { + ensurePayloadsIsMutable(); + payloads_.add(builderForValue.build()); + onChanged(); + } else { + payloadsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPayloads( + int index, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.Builder builderForValue) { + if (payloadsBuilder_ == null) { + ensurePayloadsIsMutable(); + payloads_.add(index, builderForValue.build()); + onChanged(); + } else { + payloadsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllPayloads( + java.lang.Iterable + values) { + if (payloadsBuilder_ == null) { + ensurePayloadsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, payloads_); + onChanged(); + } else { + payloadsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPayloads() { + if (payloadsBuilder_ == null) { + payloads_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + payloadsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removePayloads(int index) { + if (payloadsBuilder_ == null) { + ensurePayloadsIsMutable(); + payloads_.remove(index); + onChanged(); + } else { + payloadsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.Builder getPayloadsBuilder( + int index) { + return getPayloadsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayloadOrBuilder + getPayloadsOrBuilder(int index) { + if (payloadsBuilder_ == null) { + return payloads_.get(index); + } else { + return payloadsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List< + ? extends com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayloadOrBuilder> + getPayloadsOrBuilderList() { + if (payloadsBuilder_ != null) { + return payloadsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(payloads_); + } + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.Builder + addPayloadsBuilder() { + return getPayloadsFieldBuilder() + .addBuilder( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.getDefaultInstance()); + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.Builder addPayloadsBuilder( + int index) { + return getPayloadsFieldBuilder() + .addBuilder( + index, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.getDefaultInstance()); + } + /** + * + * + *
+     * Required. The entities to be written. Up to 100,000 feature values can be written
+     * across all `payloads`.
+     * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPayloadsBuilderList() { + return getPayloadsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.Builder, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayloadOrBuilder> + getPayloadsFieldBuilder() { + if (payloadsBuilder_ == null) { + payloadsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload.Builder, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayloadOrBuilder>( + payloads_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + payloads_ = null; + } + return payloadsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest) + private static final com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest(); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteFeatureValuesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteFeatureValuesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesRequestOrBuilder.java b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesRequestOrBuilder.java new file mode 100644 index 000000000..a7230a010 --- /dev/null +++ b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesRequestOrBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/aiplatform/v1beta1/featurestore_online_service.proto + +package com.google.cloud.aiplatform.v1beta1; + +public interface WriteFeatureValuesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1beta1.WriteFeatureValuesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the EntityType for the entities being written.
+   * Value format: `projects/{project}/locations/{location}/featurestores/
+   * {featurestore}/entityTypes/{entityType}`. For example,
+   * for a machine learning model predicting user clicks on a website, an
+   * EntityType ID could be `user`.
+   * 
+ * + * + * string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The entityType. + */ + java.lang.String getEntityType(); + /** + * + * + *
+   * Required. The resource name of the EntityType for the entities being written.
+   * Value format: `projects/{project}/locations/{location}/featurestores/
+   * {featurestore}/entityTypes/{entityType}`. For example,
+   * for a machine learning model predicting user clicks on a website, an
+   * EntityType ID could be `user`.
+   * 
+ * + * + * string entity_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for entityType. + */ + com.google.protobuf.ByteString getEntityTypeBytes(); + + /** + * + * + *
+   * Required. The entities to be written. Up to 100,000 feature values can be written
+   * across all `payloads`.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getPayloadsList(); + /** + * + * + *
+   * Required. The entities to be written. Up to 100,000 feature values can be written
+   * across all `payloads`.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload getPayloads(int index); + /** + * + * + *
+   * Required. The entities to be written. Up to 100,000 feature values can be written
+   * across all `payloads`.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getPayloadsCount(); + /** + * + * + *
+   * Required. The entities to be written. Up to 100,000 feature values can be written
+   * across all `payloads`.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getPayloadsOrBuilderList(); + /** + * + * + *
+   * Required. The entities to be written. Up to 100,000 feature values can be written
+   * across all `payloads`.
+   * 
+ * + * + * repeated .google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayload payloads = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesPayloadOrBuilder getPayloadsOrBuilder( + int index); +} diff --git a/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesResponse.java b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesResponse.java new file mode 100644 index 000000000..f4fd2d6b4 --- /dev/null +++ b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesResponse.java @@ -0,0 +1,465 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/aiplatform/v1beta1/featurestore_online_service.proto + +package com.google.cloud.aiplatform.v1beta1; + +/** + * + * + *
+ * Response message for [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues].
+ * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse} + */ +public final class WriteFeatureValuesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse) + WriteFeatureValuesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use WriteFeatureValuesResponse.newBuilder() to construct. + private WriteFeatureValuesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WriteFeatureValuesResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WriteFeatureValuesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WriteFeatureValuesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse.class, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse)) { + return super.equals(obj); + } + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse other = + (com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues].
+   * 
+ * + * Protobuf type {@code google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse) + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse.class, + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse.Builder.class); + } + + // Construct using com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServiceProto + .internal_static_google_cloud_aiplatform_v1beta1_WriteFeatureValuesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse + getDefaultInstanceForType() { + return com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse build() { + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse buildPartial() { + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse result = + new com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse) { + return mergeFrom((com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse other) { + if (other + == com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse) + private static final com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse(); + } + + public static com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WriteFeatureValuesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WriteFeatureValuesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesResponseOrBuilder.java b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesResponseOrBuilder.java new file mode 100644 index 000000000..8e40f0e53 --- /dev/null +++ b/proto-google-cloud-aiplatform-v1beta1/src/main/java/com/google/cloud/aiplatform/v1beta1/WriteFeatureValuesResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/aiplatform/v1beta1/featurestore_online_service.proto + +package com.google.cloud.aiplatform.v1beta1; + +public interface WriteFeatureValuesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto b/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto index 02417d11f..5f7cbd144 100644 --- a/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto +++ b/proto-google-cloud-aiplatform-v1beta1/src/main/proto/google/cloud/aiplatform/v1beta1/featurestore_online_service.proto @@ -58,6 +58,55 @@ service FeaturestoreOnlineServingService { }; option (google.api.method_signature) = "entity_type"; } + + // Writes Feature values of one or more entities of an EntityType. + // + // The Feature values are merged into existing entities if any. The Feature + // values to be written must have timestamp within the online storage + // retention. + rpc WriteFeatureValues(WriteFeatureValuesRequest) returns (WriteFeatureValuesResponse) { + option (google.api.http) = { + post: "/v1beta1/{entity_type=projects/*/locations/*/featurestores/*/entityTypes/*}:writeFeatureValues" + body: "*" + }; + option (google.api.method_signature) = "entity_type,payloads"; + } +} + +// Request message for [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues]. +message WriteFeatureValuesRequest { + // Required. The resource name of the EntityType for the entities being written. + // Value format: `projects/{project}/locations/{location}/featurestores/ + // {featurestore}/entityTypes/{entityType}`. For example, + // for a machine learning model predicting user clicks on a website, an + // EntityType ID could be `user`. + string entity_type = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/EntityType" + } + ]; + + // Required. The entities to be written. Up to 100,000 feature values can be written + // across all `payloads`. + repeated WriteFeatureValuesPayload payloads = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Contains Feature values to be written for a specific entity. +message WriteFeatureValuesPayload { + // Required. The ID of the entity. + string entity_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Feature values to be written, mapping from Feature ID to value. Up to + // 100,000 `feature_values` entries may be written across all payloads. The + // feature generation time, aligned by days, must be no older than five + // years (1825 days) and no later than one year (366 days) in the future. + map feature_values = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues]. +message WriteFeatureValuesResponse { + } // Request message for [FeaturestoreOnlineServingService.ReadFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.ReadFeatureValues].