/** * * * <pre> * Input video location. Currently, only * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are * supported, which must be specified in the following format: * `gs://bucket-id/object-id` (other URI formats return * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see * [Request URIs](/storage/docs/reference-uris). * A video URI may include wildcards in `object-id`, and thus identify * multiple videos. Supported wildcards: '*' to match 0 or more characters; * '?' to match 1 character. If unset, the input video should be embedded * in the request as `input_content`. If set, `input_content` should be unset. * </pre> * * <code>string input_uri = 1;</code> */ public Builder clearInputUri() { inputUri_ = getDefaultInstance().getInputUri(); onChanged(); return this; } /**
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + INPUT_URI_FIELD_NUMBER; hash = (53 * hash) + getInputUri().hashCode(); hash = (37 * hash) + INPUT_CONTENT_FIELD_NUMBER; hash = (53 * hash) + getInputContent().hashCode(); if (getFeaturesCount() > 0) { hash = (37 * hash) + FEATURES_FIELD_NUMBER; hash = (53 * hash) + features_.hashCode(); } if (hasVideoContext()) { hash = (37 * hash) + VIDEO_CONTEXT_FIELD_NUMBER; hash = (53 * hash) + getVideoContext().hashCode(); } hash = (37 * hash) + OUTPUT_URI_FIELD_NUMBER; hash = (53 * hash) + getOutputUri().hashCode(); hash = (37 * hash) + LOCATION_ID_FIELD_NUMBER; hash = (53 * hash) + getLocationId().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * * * <pre> * The video data bytes. Encoding: base64. If unset, the input video(s) * should be specified via `input_uri`. If set, `input_uri` should be unset. * </pre> * * <code>string input_content = 6;</code> */ public Builder clearInputContent() { inputContent_ = getDefaultInstance().getInputContent(); onChanged(); return this; } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest)) { return super.equals(obj); } com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest other = (com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest) obj; boolean result = true; result = result && getInputUri().equals(other.getInputUri()); result = result && getInputContent().equals(other.getInputContent()); result = result && features_.equals(other.features_); result = result && (hasVideoContext() == other.hasVideoContext()); if (hasVideoContext()) { result = result && getVideoContext().equals(other.getVideoContext()); } result = result && getOutputUri().equals(other.getOutputUri()); result = result && getLocationId().equals(other.getLocationId()); result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * Optional cloud region where annotation should take place. Supported cloud * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region * is specified, a region will be determined based on video file location. * </pre> * * <code>string location_id = 5;</code> */ public Builder clearLocationId() { locationId_ = getDefaultInstance().getLocationId(); onChanged(); return this; } /**
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (!getInputUriBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputUri_); } if (getFeaturesList().size() > 0) { output.writeUInt32NoTag(18); output.writeUInt32NoTag(featuresMemoizedSerializedSize); } for (int i = 0; i < features_.size(); i++) { output.writeEnumNoTag(features_.get(i)); } if (videoContext_ != null) { output.writeMessage(3, getVideoContext()); } if (!getOutputUriBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, outputUri_); } if (!getLocationIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 5, locationId_); } if (!getInputContentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, inputContent_); } unknownFields.writeTo(output); }
@Test @SuppressWarnings("all") public void annotateVideoTest() throws Exception { AnnotateVideoResponse expectedResponse = AnnotateVideoResponse.newBuilder().build(); Operation resultOperation = Operation.newBuilder() .setName("annotateVideoTest") .setDone(true) .setResponse(Any.pack(expectedResponse)) .build(); mockVideoIntelligenceService.addResponse(resultOperation); String inputUri = "gs://demomaker/cat.mp4"; Feature featuresElement = Feature.LABEL_DETECTION; List<Feature> features = Arrays.asList(featuresElement); AnnotateVideoResponse actualResponse = client.annotateVideoAsync(inputUri, features).get(); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockVideoIntelligenceService.getRequests(); Assert.assertEquals(1, actualRequests.size()); AnnotateVideoRequest actualRequest = (AnnotateVideoRequest) actualRequests.get(0); Assert.assertEquals(inputUri, actualRequest.getInputUri()); Assert.assertEquals(features, actualRequest.getFeaturesList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
/** * * * <pre> * Optional location where the output (in JSON format) should be stored. * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) * URIs are supported, which must be specified in the following format: * `gs://bucket-id/object-id` (other URI formats return * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see * [Request URIs](/storage/docs/reference-uris). * </pre> * * <code>string output_uri = 4;</code> */ public Builder clearOutputUri() { outputUri_ = getDefaultInstance().getOutputUri(); onChanged(); return this; } /**
@java.lang.Override public com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest getDefaultInstanceForType() { return com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.getDefaultInstance(); }
@java.lang.Override public com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest buildPartial() { com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest result = new com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.inputUri_ = inputUri_; result.inputContent_ = inputContent_; if (((bitField0_ & 0x00000004) == 0x00000004)) { features_ = java.util.Collections.unmodifiableList(features_); bitField0_ = (bitField0_ & ~0x00000004); } result.features_ = features_; if (videoContextBuilder_ == null) { result.videoContext_ = videoContext_; } else { result.videoContext_ = videoContextBuilder_.build(); } result.outputUri_ = outputUri_; result.locationId_ = locationId_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public Builder mergeFrom( com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest other) { if (other == com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest.getDefaultInstance()) return this; if (!other.getInputUri().isEmpty()) { inputUri_ = other.inputUri_; onChanged(); if (!other.getInputContent().isEmpty()) { inputContent_ = other.inputContent_; onChanged(); if (other.hasVideoContext()) { mergeVideoContext(other.getVideoContext()); if (!other.getOutputUri().isEmpty()) { outputUri_ = other.outputUri_; onChanged(); if (!other.getLocationId().isEmpty()) { locationId_ = other.locationId_; onChanged();
if (!getInputUriBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, inputUri_); if (!getFeaturesList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getVideoContext()); if (!getOutputUriBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, outputUri_); if (!getLocationIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, locationId_); if (!getInputContentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, inputContent_);
io.grpc.protobuf.ProtoUtils.marshaller( com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
io.grpc.protobuf.ProtoUtils.marshaller( com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
AnnotateVideoRequest.newBuilder().setInputUri(inputUri).addAllFeatures(features).build(); return annotateVideoAsync(request);