bitField0_ = (bitField0_ & ~0x00000001); } else { ensureAnnotationResultsIsMutable(); annotationResults_.addAll(other.annotationResults_); onChanged(); annotationResultsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getAnnotationResultsFieldBuilder() : null; } else { this.mergeUnknownFields(other.unknownFields); onChanged(); return this;
private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults, com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults.Builder, com.google.cloud.videointelligence.v1beta1.VideoAnnotationResultsOrBuilder> getAnnotationResultsFieldBuilder() { if (annotationResultsBuilder_ == null) { annotationResultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults, com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults.Builder, com.google.cloud.videointelligence.v1beta1.VideoAnnotationResultsOrBuilder>( annotationResults_, ((bitField0_ & 0x00000001) == 0x00000001), getParentForChildren(), isClean()); annotationResults_ = null; } return annotationResultsBuilder_; }
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * * * <pre> * Annotation results for all videos specified in `AnnotateVideoRequest`. * </pre> * * <code> * repeated .google.cloud.videointelligence.v1beta1.VideoAnnotationResults annotation_results = 1; * </code> */ public Builder addAnnotationResults( int index, com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults value) { if (annotationResultsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAnnotationResultsIsMutable(); annotationResults_.add(index, value); onChanged(); } else { annotationResultsBuilder_.addMessage(index, value); } return this; } /**
/** * * * <pre> * Annotation results for all videos specified in `AnnotateVideoRequest`. * </pre> * * <code> * repeated .google.cloud.videointelligence.v1beta1.VideoAnnotationResults annotation_results = 1; * </code> */ public Builder addAnnotationResults( com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults value) { if (annotationResultsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAnnotationResultsIsMutable(); annotationResults_.add(value); onChanged(); } else { annotationResultsBuilder_.addMessage(value); } return this; } /**
/** * * * <pre> * Annotation results for all videos specified in `AnnotateVideoRequest`. * </pre> * * <code> * repeated .google.cloud.videointelligence.v1beta1.VideoAnnotationResults annotation_results = 1; * </code> */ public Builder setAnnotationResults( int index, com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults value) { if (annotationResultsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAnnotationResultsIsMutable(); annotationResults_.set(index, value); onChanged(); } else { annotationResultsBuilder_.setMessage(index, value); } return this; } /**
@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> * Annotation results for all videos specified in `AnnotateVideoRequest`. * </pre> * * <code> * repeated .google.cloud.videointelligence.v1beta1.VideoAnnotationResults annotation_results = 1; * </code> */ public Builder addAllAnnotationResults( java.lang.Iterable< ? extends com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults> values) { if (annotationResultsBuilder_ == null) { ensureAnnotationResultsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, annotationResults_); onChanged(); } else { annotationResultsBuilder_.addAllMessages(values); } return this; } /**
/** * * * <pre> * Annotation results for all videos specified in `AnnotateVideoRequest`. * </pre> * * <code> * repeated .google.cloud.videointelligence.v1beta1.VideoAnnotationResults annotation_results = 1; * </code> */ public Builder addAnnotationResults( int index, com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults.Builder builderForValue) { if (annotationResultsBuilder_ == null) { ensureAnnotationResultsIsMutable(); annotationResults_.add(index, builderForValue.build()); onChanged(); } else { annotationResultsBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * Annotation results for all videos specified in `AnnotateVideoRequest`. * </pre> * * <code> * repeated .google.cloud.videointelligence.v1beta1.VideoAnnotationResults annotation_results = 1; * </code> */ public Builder setAnnotationResults( int index, com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults.Builder builderForValue) { if (annotationResultsBuilder_ == null) { ensureAnnotationResultsIsMutable(); annotationResults_.set(index, builderForValue.build()); onChanged(); } else { annotationResultsBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * Annotation results for all videos specified in `AnnotateVideoRequest`. * </pre> * * <code> * repeated .google.cloud.videointelligence.v1beta1.VideoAnnotationResults annotation_results = 1; * </code> */ public Builder addAnnotationResults( com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults.Builder builderForValue) { if (annotationResultsBuilder_ == null) { ensureAnnotationResultsIsMutable(); annotationResults_.add(builderForValue.build()); onChanged(); } else { annotationResultsBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * Annotation results for all videos specified in `AnnotateVideoRequest`. * </pre> * * <code> * repeated .google.cloud.videointelligence.v1beta1.VideoAnnotationResults annotation_results = 1; * </code> */ public Builder removeAnnotationResults(int index) { if (annotationResultsBuilder_ == null) { ensureAnnotationResultsIsMutable(); annotationResults_.remove(index); onChanged(); } else { annotationResultsBuilder_.remove(index); } return this; } /**
/** * * * <pre> * Annotation results for all videos specified in `AnnotateVideoRequest`. * </pre> * * <code> * repeated .google.cloud.videointelligence.v1beta1.VideoAnnotationResults annotation_results = 1; * </code> */ public com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults.Builder addAnnotationResultsBuilder(int index) { return getAnnotationResultsFieldBuilder() .addBuilder( index, com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults .getDefaultInstance()); } /**
/** * * * <pre> * Annotation results for all videos specified in `AnnotateVideoRequest`. * </pre> * * <code> * repeated .google.cloud.videointelligence.v1beta1.VideoAnnotationResults annotation_results = 1; * </code> */ public com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults.Builder addAnnotationResultsBuilder() { return getAnnotationResultsFieldBuilder() .addBuilder( com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults .getDefaultInstance()); } /**
/** * * * <pre> * Annotation results for all videos specified in `AnnotateVideoRequest`. * </pre> * * <code> * repeated .google.cloud.videointelligence.v1beta1.VideoAnnotationResults annotation_results = 1; * </code> */ public com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults.Builder getAnnotationResultsBuilder(int index) { return getAnnotationResultsFieldBuilder().getBuilder(index); } /**
private Builder() { maybeForceBuilderInitialization(); }
/** * * * <pre> * Annotation results for all videos specified in `AnnotateVideoRequest`. * </pre> * * <code> * repeated .google.cloud.videointelligence.v1beta1.VideoAnnotationResults annotation_results = 1; * </code> */ public java.util.List<com.google.cloud.videointelligence.v1beta1.VideoAnnotationResults.Builder> getAnnotationResultsBuilderList() { return getAnnotationResultsFieldBuilder().getBuilderList(); }
public static Builder newBuilder( com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); }