From c42dd3df38a339be808a1753aa14af14762cad87 Mon Sep 17 00:00:00 2001 From: Garrett Jones Date: Wed, 12 Sep 2018 14:41:36 -0700 Subject: [PATCH] Adding redis-v1 and video-intelligence-v1p2beta1 --- .../grpc-google-cloud-redis-v1/pom.xml | 31 + .../google/cloud/redis/v1/CloudRedisGrpc.java | 804 ++++ .../pom.xml | 31 + .../VideoIntelligenceServiceGrpc.java | 325 ++ google-api-grpc/pom.xml | 24 + .../proto-google-cloud-redis-v1/pom.xml | 31 + .../redis/v1/CloudRedisServiceV1Proto.java | 271 ++ .../cloud/redis/v1/CreateInstanceRequest.java | 1017 +++++ .../v1/CreateInstanceRequestOrBuilder.java | 86 + .../cloud/redis/v1/DeleteInstanceRequest.java | 591 +++ .../v1/DeleteInstanceRequestOrBuilder.java | 31 + .../cloud/redis/v1/GetInstanceRequest.java | 591 +++ .../redis/v1/GetInstanceRequestOrBuilder.java | 31 + .../com/google/cloud/redis/v1/Instance.java | 3770 ++++++++++++++++ .../google/cloud/redis/v1/InstanceName.java | 212 + .../cloud/redis/v1/InstanceOrBuilder.java | 450 ++ .../cloud/redis/v1/ListInstancesRequest.java | 847 ++++ .../v1/ListInstancesRequestOrBuilder.java | 65 + .../cloud/redis/v1/ListInstancesResponse.java | 1208 ++++++ .../v1/ListInstancesResponseOrBuilder.java | 113 + .../cloud/redis/v1/LocationMetadata.java | 780 ++++ .../redis/v1/LocationMetadataOrBuilder.java | 78 + .../google/cloud/redis/v1/LocationName.java | 189 + .../cloud/redis/v1/OperationMetadata.java | 1575 +++++++ .../redis/v1/OperationMetadataOrBuilder.java | 140 + .../cloud/redis/v1/UpdateInstanceRequest.java | 964 +++++ .../v1/UpdateInstanceRequestOrBuilder.java | 80 + .../google/cloud/redis/v1/ZoneMetadata.java | 423 ++ .../cloud/redis/v1/ZoneMetadataOrBuilder.java | 9 + .../google/cloud/redis/v1/cloud_redis.proto | 368 ++ .../pom.xml | 26 + .../v1p2beta1/AnnotateVideoProgress.java | 863 ++++ .../AnnotateVideoProgressOrBuilder.java | 53 + .../v1p2beta1/AnnotateVideoRequest.java | 1619 +++++++ .../AnnotateVideoRequestOrBuilder.java | 173 + .../v1p2beta1/AnnotateVideoResponse.java | 863 ++++ .../AnnotateVideoResponseOrBuilder.java | 53 + .../videointelligence/v1p2beta1/Entity.java | 901 ++++ .../v1p2beta1/EntityOrBuilder.java | 67 + .../v1p2beta1/ExplicitContentAnnotation.java | 863 ++++ .../ExplicitContentAnnotationOrBuilder.java | 53 + .../ExplicitContentDetectionConfig.java | 591 +++ ...plicitContentDetectionConfigOrBuilder.java | 31 + .../v1p2beta1/ExplicitContentFrame.java | 776 ++++ .../ExplicitContentFrameOrBuilder.java | 54 + .../videointelligence/v1p2beta1/Feature.java | 191 + .../v1p2beta1/LabelAnnotation.java | 2030 +++++++++ .../v1p2beta1/LabelAnnotationOrBuilder.java | 181 + .../v1p2beta1/LabelDetectionConfig.java | 801 ++++ .../LabelDetectionConfigOrBuilder.java | 63 + .../v1p2beta1/LabelDetectionMode.java | 157 + .../v1p2beta1/LabelFrame.java | 740 ++++ .../v1p2beta1/LabelFrameOrBuilder.java | 46 + .../v1p2beta1/LabelSegment.java | 728 ++++ .../v1p2beta1/LabelSegmentOrBuilder.java | 43 + .../v1p2beta1/Likelihood.java | 191 + .../v1p2beta1/NormalizedBoundingBox.java | 734 ++++ .../NormalizedBoundingBoxOrBuilder.java | 45 + .../v1p2beta1/NormalizedBoundingPoly.java | 887 ++++ .../NormalizedBoundingPolyOrBuilder.java | 53 + .../v1p2beta1/NormalizedVertex.java | 580 +++ .../v1p2beta1/NormalizedVertexOrBuilder.java | 27 + .../v1p2beta1/ObjectTrackingAnnotation.java | 1397 ++++++ .../ObjectTrackingAnnotationOrBuilder.java | 112 + .../v1p2beta1/ObjectTrackingFrame.java | 882 ++++ .../ObjectTrackingFrameOrBuilder.java | 59 + .../v1p2beta1/ShotChangeDetectionConfig.java | 591 +++ .../ShotChangeDetectionConfigOrBuilder.java | 31 + .../v1p2beta1/TextAnnotation.java | 1537 +++++++ .../v1p2beta1/TextAnnotationOrBuilder.java | 125 + .../v1p2beta1/TextDetectionConfig.java | 685 +++ .../TextDetectionConfigOrBuilder.java | 56 + .../v1p2beta1/TextFrame.java | 884 ++++ .../v1p2beta1/TextFrameOrBuilder.java | 59 + .../v1p2beta1/TextSegment.java | 651 +++ .../v1p2beta1/TextSegmentOrBuilder.java | 34 + .../v1p2beta1/VideoAnnotationProgress.java | 1120 +++++ .../VideoAnnotationProgressOrBuilder.java | 89 + .../v1p2beta1/VideoAnnotationResults.java | 3784 +++++++++++++++++ .../VideoAnnotationResultsOrBuilder.java | 371 ++ .../v1p2beta1/VideoContext.java | 1824 ++++++++ .../v1p2beta1/VideoContextOrBuilder.java | 163 + .../VideoIntelligenceServiceProto.java | 467 ++ .../v1p2beta1/VideoSegment.java | 904 ++++ .../v1p2beta1/VideoSegmentOrBuilder.java | 65 + .../v1p2beta1/video_intelligence.proto | 466 ++ google-cloud-bom/pom.xml | 20 + .../google-cloud-redis/pom.xml | 8 + .../cloud/redis/v1/CloudRedisClient.java | 1080 +++++ .../cloud/redis/v1/CloudRedisSettings.java | 270 ++ .../google/cloud/redis/v1/package-info.java | 49 + .../cloud/redis/v1/stub/CloudRedisStub.java | 97 + .../redis/v1/stub/CloudRedisStubSettings.java | 578 +++ .../stub/GrpcCloudRedisCallableFactory.java | 116 + .../redis/v1/stub/GrpcCloudRedisStub.java | 295 ++ .../cloud/redis/v1/CloudRedisClientTest.java | 411 ++ .../google/cloud/redis/v1/MockCloudRedis.java | 57 + .../cloud/redis/v1/MockCloudRedisImpl.java | 133 + .../google-cloud-video-intelligence/pom.xml | 9 + .../VideoIntelligenceServiceClient.java | 328 ++ .../VideoIntelligenceServiceSettings.java | 197 + .../v1p2beta1/package-info.java | 39 + ...deoIntelligenceServiceCallableFactory.java | 116 + .../GrpcVideoIntelligenceServiceStub.java | 171 + .../stub/VideoIntelligenceServiceStub.java | 56 + .../VideoIntelligenceServiceStubSettings.java | 322 ++ .../MockVideoIntelligenceService.java | 57 + .../MockVideoIntelligenceServiceImpl.java | 74 + .../VideoIntelligenceServiceClientTest.java | 130 + .../VideoIntelligenceServiceSmokeTest.java | 66 + google-cloud-clients/pom.xml | 2 +- versions.txt | 4 + 112 files changed, 50658 insertions(+), 1 deletion(-) create mode 100644 google-api-grpc/grpc-google-cloud-redis-v1/pom.xml create mode 100644 google-api-grpc/grpc-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CloudRedisGrpc.java create mode 100644 google-api-grpc/grpc-google-cloud-video-intelligence-v1p2beta1/pom.xml create mode 100644 google-api-grpc/grpc-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceGrpc.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/pom.xml create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CloudRedisServiceV1Proto.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CreateInstanceRequest.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CreateInstanceRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/DeleteInstanceRequest.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/DeleteInstanceRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/GetInstanceRequest.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/GetInstanceRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/Instance.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/InstanceName.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/InstanceOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesRequest.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesResponse.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/LocationMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/LocationMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/LocationName.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/UpdateInstanceRequest.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/UpdateInstanceRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ZoneMetadata.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ZoneMetadataOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-redis-v1/src/main/proto/google/cloud/redis/v1/cloud_redis.proto create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/pom.xml create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoProgress.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoProgressOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoRequest.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoResponse.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/Entity.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/EntityOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentDetectionConfig.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentDetectionConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentFrame.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentFrameOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/Feature.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelDetectionConfig.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelDetectionConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelDetectionMode.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelFrame.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelFrameOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelSegment.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelSegmentOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/Likelihood.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingBox.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingBoxOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingPoly.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingPolyOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedVertex.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedVertexOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingFrame.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingFrameOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ShotChangeDetectionConfig.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ShotChangeDetectionConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextAnnotation.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextAnnotationOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextDetectionConfig.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextDetectionConfigOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextFrame.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextFrameOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextSegment.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextSegmentOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationProgress.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationProgressOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationResults.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationResultsOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoContext.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoContextOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceProto.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoSegment.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoSegmentOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/proto/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto create mode 100644 google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisClient.java create mode 100644 google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisSettings.java create mode 100644 google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/package-info.java create mode 100644 google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/CloudRedisStub.java create mode 100644 google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/CloudRedisStubSettings.java create mode 100644 google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/GrpcCloudRedisCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/GrpcCloudRedisStub.java create mode 100644 google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1/CloudRedisClientTest.java create mode 100644 google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1/MockCloudRedis.java create mode 100644 google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1/MockCloudRedisImpl.java create mode 100644 google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceClient.java create mode 100644 google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceSettings.java create mode 100644 google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/package-info.java create mode 100644 google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/GrpcVideoIntelligenceServiceCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/GrpcVideoIntelligenceServiceStub.java create mode 100644 google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStub.java create mode 100644 google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStubSettings.java create mode 100644 google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/MockVideoIntelligenceService.java create mode 100644 google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/MockVideoIntelligenceServiceImpl.java create mode 100644 google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceClientTest.java create mode 100644 google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceSmokeTest.java diff --git a/google-api-grpc/grpc-google-cloud-redis-v1/pom.xml b/google-api-grpc/grpc-google-cloud-redis-v1/pom.xml new file mode 100644 index 000000000000..c4887b7cdf39 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-redis-v1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + grpc-google-cloud-redis-v1 + 0.26.1-SNAPSHOT + grpc-google-cloud-redis-v1 + GRPC library for grpc-google-cloud-redis-v1 + + com.google.api.grpc + google-api-grpc + 0.26.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-redis-v1 + compile + + + diff --git a/google-api-grpc/grpc-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CloudRedisGrpc.java b/google-api-grpc/grpc-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CloudRedisGrpc.java new file mode 100644 index 000000000000..0db0b35a8275 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CloudRedisGrpc.java @@ -0,0 +1,804 @@ +package com.google.cloud.redis.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * Configures and manages Cloud Memorystore for Redis instances
+ * Google Cloud Memorystore for Redis v1
+ * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+ * for Redis API and defines the following resource model for managing Redis
+ * instances:
+ * * The service works with a collection of cloud projects, named: `/projects/*`
+ * * Each project has a collection of available locations, named: `/locations/*`
+ * * Each location has a collection of Redis instances, named: `/instances/*`
+ * * As such, Redis instances are resources of the form:
+ *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+ * Note that location_id must be refering to a GCP `region`; for example:
+ * * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/redis/v1/cloud_redis.proto") +public final class CloudRedisGrpc { + + private CloudRedisGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.redis.v1.CloudRedis"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListInstancesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_INSTANCES = getListInstancesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListInstancesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListInstancesMethod() { + return getListInstancesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListInstancesMethodHelper() { + io.grpc.MethodDescriptor getListInstancesMethod; + if ((getListInstancesMethod = CloudRedisGrpc.getListInstancesMethod) == null) { + synchronized (CloudRedisGrpc.class) { + if ((getListInstancesMethod = CloudRedisGrpc.getListInstancesMethod) == null) { + CloudRedisGrpc.getListInstancesMethod = getListInstancesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.redis.v1.CloudRedis", "ListInstances")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.redis.v1.ListInstancesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.redis.v1.ListInstancesResponse.getDefaultInstance())) + .setSchemaDescriptor(new CloudRedisMethodDescriptorSupplier("ListInstances")) + .build(); + } + } + } + return getListInstancesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetInstanceMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_INSTANCE = getGetInstanceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetInstanceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetInstanceMethod() { + return getGetInstanceMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetInstanceMethodHelper() { + io.grpc.MethodDescriptor getGetInstanceMethod; + if ((getGetInstanceMethod = CloudRedisGrpc.getGetInstanceMethod) == null) { + synchronized (CloudRedisGrpc.class) { + if ((getGetInstanceMethod = CloudRedisGrpc.getGetInstanceMethod) == null) { + CloudRedisGrpc.getGetInstanceMethod = getGetInstanceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.redis.v1.CloudRedis", "GetInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.redis.v1.GetInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.redis.v1.Instance.getDefaultInstance())) + .setSchemaDescriptor(new CloudRedisMethodDescriptorSupplier("GetInstance")) + .build(); + } + } + } + return getGetInstanceMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateInstanceMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_INSTANCE = getCreateInstanceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateInstanceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateInstanceMethod() { + return getCreateInstanceMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateInstanceMethodHelper() { + io.grpc.MethodDescriptor getCreateInstanceMethod; + if ((getCreateInstanceMethod = CloudRedisGrpc.getCreateInstanceMethod) == null) { + synchronized (CloudRedisGrpc.class) { + if ((getCreateInstanceMethod = CloudRedisGrpc.getCreateInstanceMethod) == null) { + CloudRedisGrpc.getCreateInstanceMethod = getCreateInstanceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.redis.v1.CloudRedis", "CreateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.redis.v1.CreateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new CloudRedisMethodDescriptorSupplier("CreateInstance")) + .build(); + } + } + } + return getCreateInstanceMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateInstanceMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_INSTANCE = getUpdateInstanceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateInstanceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateInstanceMethod() { + return getUpdateInstanceMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateInstanceMethodHelper() { + io.grpc.MethodDescriptor getUpdateInstanceMethod; + if ((getUpdateInstanceMethod = CloudRedisGrpc.getUpdateInstanceMethod) == null) { + synchronized (CloudRedisGrpc.class) { + if ((getUpdateInstanceMethod = CloudRedisGrpc.getUpdateInstanceMethod) == null) { + CloudRedisGrpc.getUpdateInstanceMethod = getUpdateInstanceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.redis.v1.CloudRedis", "UpdateInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.redis.v1.UpdateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new CloudRedisMethodDescriptorSupplier("UpdateInstance")) + .build(); + } + } + } + return getUpdateInstanceMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteInstanceMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_INSTANCE = getDeleteInstanceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteInstanceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteInstanceMethod() { + return getDeleteInstanceMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteInstanceMethodHelper() { + io.grpc.MethodDescriptor getDeleteInstanceMethod; + if ((getDeleteInstanceMethod = CloudRedisGrpc.getDeleteInstanceMethod) == null) { + synchronized (CloudRedisGrpc.class) { + if ((getDeleteInstanceMethod = CloudRedisGrpc.getDeleteInstanceMethod) == null) { + CloudRedisGrpc.getDeleteInstanceMethod = getDeleteInstanceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.redis.v1.CloudRedis", "DeleteInstance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.redis.v1.DeleteInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new CloudRedisMethodDescriptorSupplier("DeleteInstance")) + .build(); + } + } + } + return getDeleteInstanceMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static CloudRedisStub newStub(io.grpc.Channel channel) { + return new CloudRedisStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudRedisBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new CloudRedisBlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static CloudRedisFutureStub newFutureStub( + io.grpc.Channel channel) { + return new CloudRedisFutureStub(channel); + } + + /** + *
+   * Configures and manages Cloud Memorystore for Redis instances
+   * Google Cloud Memorystore for Redis v1
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * instances:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis instances, named: `/instances/*`
+   * * As such, Redis instances are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * Note that location_id must be refering to a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
+   * 
+ */ + public static abstract class CloudRedisImplBase implements io.grpc.BindableService { + + /** + *
+     * Lists all Redis instances owned by a project in either the specified
+     * location (region) or all locations.
+     * The location should have the following format:
+     * * `projects/{project_id}/locations/{location_id}`
+     * If `location_id` is specified as `-` (wildcard), then all regions
+     * available to the project are queried, and the results are aggregated.
+     * 
+ */ + public void listInstances(com.google.cloud.redis.v1.ListInstancesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListInstancesMethodHelper(), responseObserver); + } + + /** + *
+     * Gets the details of a specific Redis instance.
+     * 
+ */ + public void getInstance(com.google.cloud.redis.v1.GetInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetInstanceMethodHelper(), responseObserver); + } + + /** + *
+     * Creates a Redis instance based on the specified tier and memory size.
+     * By default, the instance is accessible from the project's
+     * [default network](/compute/docs/networks-and-firewalls#networks).
+     * The creation is executed asynchronously and callers may check the returned
+     * operation to track its progress. Once the operation is completed the Redis
+     * instance will be fully functional. Completed longrunning.Operation will
+     * contain the new instance object in the response field.
+     * The returned operation is automatically deleted after a few hours, so there
+     * is no need to call DeleteOperation.
+     * 
+ */ + public void createInstance(com.google.cloud.redis.v1.CreateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateInstanceMethodHelper(), responseObserver); + } + + /** + *
+     * Updates the metadata and configuration of a specific Redis instance.
+     * Completed longrunning.Operation will contain the new instance object
+     * in the response field. The returned operation is automatically deleted
+     * after a few hours, so there is no need to call DeleteOperation.
+     * 
+ */ + public void updateInstance(com.google.cloud.redis.v1.UpdateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateInstanceMethodHelper(), responseObserver); + } + + /** + *
+     * Deletes a specific Redis instance.  Instance stops serving and data is
+     * deleted.
+     * 
+ */ + public void deleteInstance(com.google.cloud.redis.v1.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteInstanceMethodHelper(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListInstancesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.v1.ListInstancesRequest, + com.google.cloud.redis.v1.ListInstancesResponse>( + this, METHODID_LIST_INSTANCES))) + .addMethod( + getGetInstanceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.v1.GetInstanceRequest, + com.google.cloud.redis.v1.Instance>( + this, METHODID_GET_INSTANCE))) + .addMethod( + getCreateInstanceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.v1.CreateInstanceRequest, + com.google.longrunning.Operation>( + this, METHODID_CREATE_INSTANCE))) + .addMethod( + getUpdateInstanceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.v1.UpdateInstanceRequest, + com.google.longrunning.Operation>( + this, METHODID_UPDATE_INSTANCE))) + .addMethod( + getDeleteInstanceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.v1.DeleteInstanceRequest, + com.google.longrunning.Operation>( + this, METHODID_DELETE_INSTANCE))) + .build(); + } + } + + /** + *
+   * Configures and manages Cloud Memorystore for Redis instances
+   * Google Cloud Memorystore for Redis v1
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * instances:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis instances, named: `/instances/*`
+   * * As such, Redis instances are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * Note that location_id must be refering to a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
+   * 
+ */ + public static final class CloudRedisStub extends io.grpc.stub.AbstractStub { + private CloudRedisStub(io.grpc.Channel channel) { + super(channel); + } + + private CloudRedisStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudRedisStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new CloudRedisStub(channel, callOptions); + } + + /** + *
+     * Lists all Redis instances owned by a project in either the specified
+     * location (region) or all locations.
+     * The location should have the following format:
+     * * `projects/{project_id}/locations/{location_id}`
+     * If `location_id` is specified as `-` (wildcard), then all regions
+     * available to the project are queried, and the results are aggregated.
+     * 
+ */ + public void listInstances(com.google.cloud.redis.v1.ListInstancesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListInstancesMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets the details of a specific Redis instance.
+     * 
+ */ + public void getInstance(com.google.cloud.redis.v1.GetInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetInstanceMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates a Redis instance based on the specified tier and memory size.
+     * By default, the instance is accessible from the project's
+     * [default network](/compute/docs/networks-and-firewalls#networks).
+     * The creation is executed asynchronously and callers may check the returned
+     * operation to track its progress. Once the operation is completed the Redis
+     * instance will be fully functional. Completed longrunning.Operation will
+     * contain the new instance object in the response field.
+     * The returned operation is automatically deleted after a few hours, so there
+     * is no need to call DeleteOperation.
+     * 
+ */ + public void createInstance(com.google.cloud.redis.v1.CreateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateInstanceMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Updates the metadata and configuration of a specific Redis instance.
+     * Completed longrunning.Operation will contain the new instance object
+     * in the response field. The returned operation is automatically deleted
+     * after a few hours, so there is no need to call DeleteOperation.
+     * 
+ */ + public void updateInstance(com.google.cloud.redis.v1.UpdateInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateInstanceMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deletes a specific Redis instance.  Instance stops serving and data is
+     * deleted.
+     * 
+ */ + public void deleteInstance(com.google.cloud.redis.v1.DeleteInstanceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteInstanceMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * Configures and manages Cloud Memorystore for Redis instances
+   * Google Cloud Memorystore for Redis v1
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * instances:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis instances, named: `/instances/*`
+   * * As such, Redis instances are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * Note that location_id must be refering to a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
+   * 
+ */ + public static final class CloudRedisBlockingStub extends io.grpc.stub.AbstractStub { + private CloudRedisBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private CloudRedisBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudRedisBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new CloudRedisBlockingStub(channel, callOptions); + } + + /** + *
+     * Lists all Redis instances owned by a project in either the specified
+     * location (region) or all locations.
+     * The location should have the following format:
+     * * `projects/{project_id}/locations/{location_id}`
+     * If `location_id` is specified as `-` (wildcard), then all regions
+     * available to the project are queried, and the results are aggregated.
+     * 
+ */ + public com.google.cloud.redis.v1.ListInstancesResponse listInstances(com.google.cloud.redis.v1.ListInstancesRequest request) { + return blockingUnaryCall( + getChannel(), getListInstancesMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets the details of a specific Redis instance.
+     * 
+ */ + public com.google.cloud.redis.v1.Instance getInstance(com.google.cloud.redis.v1.GetInstanceRequest request) { + return blockingUnaryCall( + getChannel(), getGetInstanceMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Creates a Redis instance based on the specified tier and memory size.
+     * By default, the instance is accessible from the project's
+     * [default network](/compute/docs/networks-and-firewalls#networks).
+     * The creation is executed asynchronously and callers may check the returned
+     * operation to track its progress. Once the operation is completed the Redis
+     * instance will be fully functional. Completed longrunning.Operation will
+     * contain the new instance object in the response field.
+     * The returned operation is automatically deleted after a few hours, so there
+     * is no need to call DeleteOperation.
+     * 
+ */ + public com.google.longrunning.Operation createInstance(com.google.cloud.redis.v1.CreateInstanceRequest request) { + return blockingUnaryCall( + getChannel(), getCreateInstanceMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Updates the metadata and configuration of a specific Redis instance.
+     * Completed longrunning.Operation will contain the new instance object
+     * in the response field. The returned operation is automatically deleted
+     * after a few hours, so there is no need to call DeleteOperation.
+     * 
+ */ + public com.google.longrunning.Operation updateInstance(com.google.cloud.redis.v1.UpdateInstanceRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateInstanceMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Deletes a specific Redis instance.  Instance stops serving and data is
+     * deleted.
+     * 
+ */ + public com.google.longrunning.Operation deleteInstance(com.google.cloud.redis.v1.DeleteInstanceRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteInstanceMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+   * Configures and manages Cloud Memorystore for Redis instances
+   * Google Cloud Memorystore for Redis v1
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * instances:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis instances, named: `/instances/*`
+   * * As such, Redis instances are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * Note that location_id must be refering to a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/instances/my-redis`
+   * 
+ */ + public static final class CloudRedisFutureStub extends io.grpc.stub.AbstractStub { + private CloudRedisFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private CloudRedisFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudRedisFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new CloudRedisFutureStub(channel, callOptions); + } + + /** + *
+     * Lists all Redis instances owned by a project in either the specified
+     * location (region) or all locations.
+     * The location should have the following format:
+     * * `projects/{project_id}/locations/{location_id}`
+     * If `location_id` is specified as `-` (wildcard), then all regions
+     * available to the project are queried, and the results are aggregated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listInstances( + com.google.cloud.redis.v1.ListInstancesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListInstancesMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets the details of a specific Redis instance.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getInstance( + com.google.cloud.redis.v1.GetInstanceRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetInstanceMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates a Redis instance based on the specified tier and memory size.
+     * By default, the instance is accessible from the project's
+     * [default network](/compute/docs/networks-and-firewalls#networks).
+     * The creation is executed asynchronously and callers may check the returned
+     * operation to track its progress. Once the operation is completed the Redis
+     * instance will be fully functional. Completed longrunning.Operation will
+     * contain the new instance object in the response field.
+     * The returned operation is automatically deleted after a few hours, so there
+     * is no need to call DeleteOperation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createInstance( + com.google.cloud.redis.v1.CreateInstanceRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateInstanceMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Updates the metadata and configuration of a specific Redis instance.
+     * Completed longrunning.Operation will contain the new instance object
+     * in the response field. The returned operation is automatically deleted
+     * after a few hours, so there is no need to call DeleteOperation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateInstance( + com.google.cloud.redis.v1.UpdateInstanceRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateInstanceMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Deletes a specific Redis instance.  Instance stops serving and data is
+     * deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteInstance( + com.google.cloud.redis.v1.DeleteInstanceRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteInstanceMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_INSTANCES = 0; + private static final int METHODID_GET_INSTANCE = 1; + private static final int METHODID_CREATE_INSTANCE = 2; + private static final int METHODID_UPDATE_INSTANCE = 3; + private static final int METHODID_DELETE_INSTANCE = 4; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final CloudRedisImplBase serviceImpl; + private final int methodId; + + MethodHandlers(CloudRedisImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_INSTANCES: + serviceImpl.listInstances((com.google.cloud.redis.v1.ListInstancesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_INSTANCE: + serviceImpl.getInstance((com.google.cloud.redis.v1.GetInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_INSTANCE: + serviceImpl.createInstance((com.google.cloud.redis.v1.CreateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_INSTANCE: + serviceImpl.updateInstance((com.google.cloud.redis.v1.UpdateInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_INSTANCE: + serviceImpl.deleteInstance((com.google.cloud.redis.v1.DeleteInstanceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class CloudRedisBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudRedisBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudRedis"); + } + } + + private static final class CloudRedisFileDescriptorSupplier + extends CloudRedisBaseDescriptorSupplier { + CloudRedisFileDescriptorSupplier() {} + } + + private static final class CloudRedisMethodDescriptorSupplier + extends CloudRedisBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + CloudRedisMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (CloudRedisGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudRedisFileDescriptorSupplier()) + .addMethod(getListInstancesMethodHelper()) + .addMethod(getGetInstanceMethodHelper()) + .addMethod(getCreateInstanceMethodHelper()) + .addMethod(getUpdateInstanceMethodHelper()) + .addMethod(getDeleteInstanceMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/grpc-google-cloud-video-intelligence-v1p2beta1/pom.xml b/google-api-grpc/grpc-google-cloud-video-intelligence-v1p2beta1/pom.xml new file mode 100644 index 000000000000..6ab2e5463e1d --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-video-intelligence-v1p2beta1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + grpc-google-cloud-video-intelligence-v1p2beta1 + 0.26.1-SNAPSHOT + grpc-google-cloud-video-intelligence-v1p2beta1 + GRPC library for grpc-google-cloud-video-intelligence-v1p2beta1 + + com.google.api.grpc + google-api-grpc + 0.26.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-video-intelligence-v1p2beta1 + compile + + + diff --git a/google-api-grpc/grpc-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceGrpc.java b/google-api-grpc/grpc-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceGrpc.java new file mode 100644 index 000000000000..a299f0e900aa --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceGrpc.java @@ -0,0 +1,325 @@ +package com.google.cloud.videointelligence.v1p2beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * Service that implements Google Cloud Video Intelligence API.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto") +public final class VideoIntelligenceServiceGrpc { + + private VideoIntelligenceServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getAnnotateVideoMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_ANNOTATE_VIDEO = getAnnotateVideoMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getAnnotateVideoMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getAnnotateVideoMethod() { + return getAnnotateVideoMethodHelper(); + } + + private static io.grpc.MethodDescriptor getAnnotateVideoMethodHelper() { + io.grpc.MethodDescriptor getAnnotateVideoMethod; + if ((getAnnotateVideoMethod = VideoIntelligenceServiceGrpc.getAnnotateVideoMethod) == null) { + synchronized (VideoIntelligenceServiceGrpc.class) { + if ((getAnnotateVideoMethod = VideoIntelligenceServiceGrpc.getAnnotateVideoMethod) == null) { + VideoIntelligenceServiceGrpc.getAnnotateVideoMethod = getAnnotateVideoMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService", "AnnotateVideo")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new VideoIntelligenceServiceMethodDescriptorSupplier("AnnotateVideo")) + .build(); + } + } + } + return getAnnotateVideoMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static VideoIntelligenceServiceStub newStub(io.grpc.Channel channel) { + return new VideoIntelligenceServiceStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static VideoIntelligenceServiceBlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new VideoIntelligenceServiceBlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static VideoIntelligenceServiceFutureStub newFutureStub( + io.grpc.Channel channel) { + return new VideoIntelligenceServiceFutureStub(channel); + } + + /** + *
+   * Service that implements Google Cloud Video Intelligence API.
+   * 
+ */ + public static abstract class VideoIntelligenceServiceImplBase implements io.grpc.BindableService { + + /** + *
+     * Performs asynchronous video annotation. Progress and results can be
+     * retrieved through the `google.longrunning.Operations` interface.
+     * `Operation.metadata` contains `AnnotateVideoProgress` (progress).
+     * `Operation.response` contains `AnnotateVideoResponse` (results).
+     * 
+ */ + public void annotateVideo(com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getAnnotateVideoMethodHelper(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getAnnotateVideoMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest, + com.google.longrunning.Operation>( + this, METHODID_ANNOTATE_VIDEO))) + .build(); + } + } + + /** + *
+   * Service that implements Google Cloud Video Intelligence API.
+   * 
+ */ + public static final class VideoIntelligenceServiceStub extends io.grpc.stub.AbstractStub { + private VideoIntelligenceServiceStub(io.grpc.Channel channel) { + super(channel); + } + + private VideoIntelligenceServiceStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected VideoIntelligenceServiceStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new VideoIntelligenceServiceStub(channel, callOptions); + } + + /** + *
+     * Performs asynchronous video annotation. Progress and results can be
+     * retrieved through the `google.longrunning.Operations` interface.
+     * `Operation.metadata` contains `AnnotateVideoProgress` (progress).
+     * `Operation.response` contains `AnnotateVideoResponse` (results).
+     * 
+ */ + public void annotateVideo(com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getAnnotateVideoMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * Service that implements Google Cloud Video Intelligence API.
+   * 
+ */ + public static final class VideoIntelligenceServiceBlockingStub extends io.grpc.stub.AbstractStub { + private VideoIntelligenceServiceBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private VideoIntelligenceServiceBlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected VideoIntelligenceServiceBlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new VideoIntelligenceServiceBlockingStub(channel, callOptions); + } + + /** + *
+     * Performs asynchronous video annotation. Progress and results can be
+     * retrieved through the `google.longrunning.Operations` interface.
+     * `Operation.metadata` contains `AnnotateVideoProgress` (progress).
+     * `Operation.response` contains `AnnotateVideoResponse` (results).
+     * 
+ */ + public com.google.longrunning.Operation annotateVideo(com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest request) { + return blockingUnaryCall( + getChannel(), getAnnotateVideoMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+   * Service that implements Google Cloud Video Intelligence API.
+   * 
+ */ + public static final class VideoIntelligenceServiceFutureStub extends io.grpc.stub.AbstractStub { + private VideoIntelligenceServiceFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private VideoIntelligenceServiceFutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected VideoIntelligenceServiceFutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new VideoIntelligenceServiceFutureStub(channel, callOptions); + } + + /** + *
+     * Performs asynchronous video annotation. Progress and results can be
+     * retrieved through the `google.longrunning.Operations` interface.
+     * `Operation.metadata` contains `AnnotateVideoProgress` (progress).
+     * `Operation.response` contains `AnnotateVideoResponse` (results).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture annotateVideo( + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest request) { + return futureUnaryCall( + getChannel().newCall(getAnnotateVideoMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_ANNOTATE_VIDEO = 0; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final VideoIntelligenceServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(VideoIntelligenceServiceImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_ANNOTATE_VIDEO: + serviceImpl.annotateVideo((com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class VideoIntelligenceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + VideoIntelligenceServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("VideoIntelligenceService"); + } + } + + private static final class VideoIntelligenceServiceFileDescriptorSupplier + extends VideoIntelligenceServiceBaseDescriptorSupplier { + VideoIntelligenceServiceFileDescriptorSupplier() {} + } + + private static final class VideoIntelligenceServiceMethodDescriptorSupplier + extends VideoIntelligenceServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + VideoIntelligenceServiceMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (VideoIntelligenceServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new VideoIntelligenceServiceFileDescriptorSupplier()) + .addMethod(getAnnotateVideoMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/pom.xml b/google-api-grpc/pom.xml index a48a1ec96cda..6ecbe1d820ec 100644 --- a/google-api-grpc/pom.xml +++ b/google-api-grpc/pom.xml @@ -546,6 +546,16 @@ grpc-google-cloud-video-intelligence-v1p1beta1 0.26.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-video-intelligence-v1p2beta1 + 0.26.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-video-intelligence-v1p2beta1 + 0.26.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-iot-v1 @@ -566,6 +576,16 @@ grpc-google-cloud-redis-v1beta1 0.26.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-redis-v1 + 0.26.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-redis-v1 + 0.26.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-websecurityscanner-v1alpha @@ -617,12 +637,14 @@ grpc-google-cloud-video-intelligence-v1beta1 grpc-google-cloud-video-intelligence-v1beta2 grpc-google-cloud-video-intelligence-v1p1beta1 + grpc-google-cloud-video-intelligence-v1p2beta1 grpc-google-cloud-vision-v1 grpc-google-cloud-vision-v1p1beta1 grpc-google-cloud-vision-v1p2beta1 grpc-google-cloud-vision-v1p3beta1 grpc-google-cloud-iot-v1 grpc-google-cloud-redis-v1beta1 + grpc-google-cloud-redis-v1 grpc-google-cloud-websecurityscanner-v1alpha proto-google-cloud-asset-v1beta1 @@ -663,12 +685,14 @@ proto-google-cloud-video-intelligence-v1beta1 proto-google-cloud-video-intelligence-v1beta2 proto-google-cloud-video-intelligence-v1p1beta1 + proto-google-cloud-video-intelligence-v1p2beta1 proto-google-cloud-vision-v1 proto-google-cloud-vision-v1p1beta1 proto-google-cloud-vision-v1p2beta1 proto-google-cloud-vision-v1p3beta1 proto-google-cloud-iot-v1 proto-google-cloud-redis-v1beta1 + proto-google-cloud-redis-v1 proto-google-cloud-websecurityscanner-v1alpha diff --git a/google-api-grpc/proto-google-cloud-redis-v1/pom.xml b/google-api-grpc/proto-google-cloud-redis-v1/pom.xml new file mode 100644 index 000000000000..01ec8d4eb648 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + proto-google-cloud-redis-v1 + 0.26.1-SNAPSHOT + proto-google-cloud-redis-v1 + PROTO library for proto-google-cloud-redis-v1 + + com.google.api.grpc + google-api-grpc + 0.26.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api + api-common + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CloudRedisServiceV1Proto.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CloudRedisServiceV1Proto.java new file mode 100644 index 000000000000..f6817b9cadc5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CloudRedisServiceV1Proto.java @@ -0,0 +1,271 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +public final class CloudRedisServiceV1Proto { + private CloudRedisServiceV1Proto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_Instance_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_Instance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_Instance_LabelsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_Instance_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_Instance_RedisConfigsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_Instance_RedisConfigsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_ListInstancesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_ListInstancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_ListInstancesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_ListInstancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_GetInstanceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_GetInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_CreateInstanceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_CreateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_UpdateInstanceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_UpdateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_DeleteInstanceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_DeleteInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_OperationMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_OperationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_LocationMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_LocationMetadata_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_LocationMetadata_AvailableZonesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_LocationMetadata_AvailableZonesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_v1_ZoneMetadata_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_v1_ZoneMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\'google/cloud/redis/v1/cloud_redis.prot" + + "o\022\025google.cloud.redis.v1\032\034google/api/ann" + + "otations.proto\032#google/longrunning/opera" + + "tions.proto\032 google/protobuf/field_mask." + + "proto\032\037google/protobuf/timestamp.proto\"\320" + + "\006\n\010Instance\022\014\n\004name\030\001 \001(\t\022\024\n\014display_nam" + + "e\030\002 \001(\t\022;\n\006labels\030\003 \003(\0132+.google.cloud.r" + + "edis.v1.Instance.LabelsEntry\022\023\n\013location" + + "_id\030\004 \001(\t\022\037\n\027alternative_location_id\030\005 \001" + + "(\t\022\025\n\rredis_version\030\007 \001(\t\022\031\n\021reserved_ip" + + "_range\030\t \001(\t\022\014\n\004host\030\n \001(\t\022\014\n\004port\030\013 \001(\005" + + "\022\033\n\023current_location_id\030\014 \001(\t\022/\n\013create_" + + "time\030\r \001(\0132\032.google.protobuf.Timestamp\0224" + + "\n\005state\030\016 \001(\0162%.google.cloud.redis.v1.In" + + "stance.State\022\026\n\016status_message\030\017 \001(\t\022H\n\r" + + "redis_configs\030\020 \003(\01321.google.cloud.redis" + + ".v1.Instance.RedisConfigsEntry\0222\n\004tier\030\021" + + " \001(\0162$.google.cloud.redis.v1.Instance.Ti" + + "er\022\026\n\016memory_size_gb\030\022 \001(\005\022\032\n\022authorized" + + "_network\030\024 \001(\t\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001" + + "(\t\022\r\n\005value\030\002 \001(\t:\0028\001\0323\n\021RedisConfigsEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"s\n\005St" + + "ate\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREATING\020\001" + + "\022\t\n\005READY\020\002\022\014\n\010UPDATING\020\003\022\014\n\010DELETING\020\004\022" + + "\r\n\tREPAIRING\020\005\022\017\n\013MAINTENANCE\020\006\"8\n\004Tier\022" + + "\024\n\020TIER_UNSPECIFIED\020\000\022\t\n\005BASIC\020\001\022\017\n\013STAN" + + "DARD_HA\020\003\"M\n\024ListInstancesRequest\022\016\n\006par" + + "ent\030\001 \001(\t\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_tok" + + "en\030\003 \001(\t\"d\n\025ListInstancesResponse\0222\n\tins" + + "tances\030\001 \003(\0132\037.google.cloud.redis.v1.Ins" + + "tance\022\027\n\017next_page_token\030\002 \001(\t\"\"\n\022GetIns" + + "tanceRequest\022\014\n\004name\030\001 \001(\t\"o\n\025CreateInst" + + "anceRequest\022\016\n\006parent\030\001 \001(\t\022\023\n\013instance_" + + "id\030\002 \001(\t\0221\n\010instance\030\003 \001(\0132\037.google.clou" + + "d.redis.v1.Instance\"{\n\025UpdateInstanceReq" + + "uest\022/\n\013update_mask\030\001 \001(\0132\032.google.proto" + + "buf.FieldMask\0221\n\010instance\030\002 \001(\0132\037.google" + + ".cloud.redis.v1.Instance\"%\n\025DeleteInstan" + + "ceRequest\022\014\n\004name\030\001 \001(\t\"\326\001\n\021OperationMet" + + "adata\022/\n\013create_time\030\001 \001(\0132\032.google.prot" + + "obuf.Timestamp\022,\n\010end_time\030\002 \001(\0132\032.googl" + + "e.protobuf.Timestamp\022\016\n\006target\030\003 \001(\t\022\014\n\004" + + "verb\030\004 \001(\t\022\025\n\rstatus_detail\030\005 \001(\t\022\030\n\020can" + + "cel_requested\030\006 \001(\010\022\023\n\013api_version\030\007 \001(\t" + + "\"\304\001\n\020LocationMetadata\022T\n\017available_zones" + + "\030\001 \003(\0132;.google.cloud.redis.v1.LocationM" + + "etadata.AvailableZonesEntry\032Z\n\023Available" + + "ZonesEntry\022\013\n\003key\030\001 \001(\t\0222\n\005value\030\002 \001(\0132#" + + ".google.cloud.redis.v1.ZoneMetadata:\0028\001\"" + + "\016\n\014ZoneMetadata2\245\006\n\nCloudRedis\022\241\001\n\rListI" + + "nstances\022+.google.cloud.redis.v1.ListIns" + + "tancesRequest\032,.google.cloud.redis.v1.Li" + + "stInstancesResponse\"5\202\323\344\223\002/\022-/v1/{parent" + + "=projects/*/locations/*}/instances\022\220\001\n\013G" + + "etInstance\022).google.cloud.redis.v1.GetIn" + + "stanceRequest\032\037.google.cloud.redis.v1.In" + + "stance\"5\202\323\344\223\002/\022-/v1/{name=projects/*/loc" + + "ations/*/instances/*}\022\236\001\n\016CreateInstance" + + "\022,.google.cloud.redis.v1.CreateInstanceR" + + "equest\032\035.google.longrunning.Operation\"?\202" + + "\323\344\223\0029\"-/v1/{parent=projects/*/locations/" + + "*}/instances:\010instance\022\247\001\n\016UpdateInstanc" + + "e\022,.google.cloud.redis.v1.UpdateInstance" + + "Request\032\035.google.longrunning.Operation\"H" + + "\202\323\344\223\002B26/v1/{instance.name=projects/*/lo" + + "cations/*/instances/*}:\010instance\022\224\001\n\016Del" + + "eteInstance\022,.google.cloud.redis.v1.Dele" + + "teInstanceRequest\032\035.google.longrunning.O" + + "peration\"5\202\323\344\223\002/*-/v1/{name=projects/*/l" + + "ocations/*/instances/*}Bs\n\031com.google.cl" + + "oud.redis.v1B\030CloudRedisServiceV1ProtoP\001" + + "Z:google.golang.org/genproto/googleapis/" + + "cloud/redis/v1;redisb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_redis_v1_Instance_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_redis_v1_Instance_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_Instance_descriptor, + new java.lang.String[] { "Name", "DisplayName", "Labels", "LocationId", "AlternativeLocationId", "RedisVersion", "ReservedIpRange", "Host", "Port", "CurrentLocationId", "CreateTime", "State", "StatusMessage", "RedisConfigs", "Tier", "MemorySizeGb", "AuthorizedNetwork", }); + internal_static_google_cloud_redis_v1_Instance_LabelsEntry_descriptor = + internal_static_google_cloud_redis_v1_Instance_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_redis_v1_Instance_LabelsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_Instance_LabelsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_redis_v1_Instance_RedisConfigsEntry_descriptor = + internal_static_google_cloud_redis_v1_Instance_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_redis_v1_Instance_RedisConfigsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_Instance_RedisConfigsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_redis_v1_ListInstancesRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_redis_v1_ListInstancesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_ListInstancesRequest_descriptor, + new java.lang.String[] { "Parent", "PageSize", "PageToken", }); + internal_static_google_cloud_redis_v1_ListInstancesResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_redis_v1_ListInstancesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_ListInstancesResponse_descriptor, + new java.lang.String[] { "Instances", "NextPageToken", }); + internal_static_google_cloud_redis_v1_GetInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_redis_v1_GetInstanceRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_GetInstanceRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_redis_v1_CreateInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_redis_v1_CreateInstanceRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_CreateInstanceRequest_descriptor, + new java.lang.String[] { "Parent", "InstanceId", "Instance", }); + internal_static_google_cloud_redis_v1_UpdateInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_redis_v1_UpdateInstanceRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_UpdateInstanceRequest_descriptor, + new java.lang.String[] { "UpdateMask", "Instance", }); + internal_static_google_cloud_redis_v1_DeleteInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_redis_v1_DeleteInstanceRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_DeleteInstanceRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_cloud_redis_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_redis_v1_OperationMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_OperationMetadata_descriptor, + new java.lang.String[] { "CreateTime", "EndTime", "Target", "Verb", "StatusDetail", "CancelRequested", "ApiVersion", }); + internal_static_google_cloud_redis_v1_LocationMetadata_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_redis_v1_LocationMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_LocationMetadata_descriptor, + new java.lang.String[] { "AvailableZones", }); + internal_static_google_cloud_redis_v1_LocationMetadata_AvailableZonesEntry_descriptor = + internal_static_google_cloud_redis_v1_LocationMetadata_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_redis_v1_LocationMetadata_AvailableZonesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_LocationMetadata_AvailableZonesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_redis_v1_ZoneMetadata_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_redis_v1_ZoneMetadata_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_v1_ZoneMetadata_descriptor, + new java.lang.String[] { }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CreateInstanceRequest.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CreateInstanceRequest.java new file mode 100644 index 000000000000..7b1317f9ae77 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CreateInstanceRequest.java @@ -0,0 +1,1017 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +/** + *
+ * Request for [CreateInstance][google.cloud.redis.v1.CloudRedis.CreateInstance].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.v1.CreateInstanceRequest} + */ +public final class CreateInstanceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.v1.CreateInstanceRequest) + CreateInstanceRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateInstanceRequest.newBuilder() to construct. + private CreateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateInstanceRequest() { + parent_ = ""; + instanceId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateInstanceRequest( + 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(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + instanceId_ = s; + break; + } + case 26: { + com.google.cloud.redis.v1.Instance.Builder subBuilder = null; + if (instance_ != null) { + subBuilder = instance_.toBuilder(); + } + instance_ = input.readMessage(com.google.cloud.redis.v1.Instance.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(instance_); + instance_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.CreateInstanceRequest.class, com.google.cloud.redis.v1.CreateInstanceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The resource name of the instance location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The resource name of the instance location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object instanceId_; + /** + *
+   * Required. The logical name of the Redis instance in the customer project
+   * with the following restrictions:
+   * * Must contain only lowercase letters, numbers, and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-40 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project / location
+   * 
+ * + * string instance_id = 2; + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + 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(); + instanceId_ = s; + return s; + } + } + /** + *
+   * Required. The logical name of the Redis instance in the customer project
+   * with the following restrictions:
+   * * Must contain only lowercase letters, numbers, and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-40 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project / location
+   * 
+ * + * string instance_id = 2; + */ + public com.google.protobuf.ByteString + getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private com.google.cloud.redis.v1.Instance instance_; + /** + *
+   * Required. A Redis [Instance] resource
+   * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + public boolean hasInstance() { + return instance_ != null; + } + /** + *
+   * Required. A Redis [Instance] resource
+   * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + public com.google.cloud.redis.v1.Instance getInstance() { + return instance_ == null ? com.google.cloud.redis.v1.Instance.getDefaultInstance() : instance_; + } + /** + *
+   * Required. A Redis [Instance] resource
+   * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + public com.google.cloud.redis.v1.InstanceOrBuilder getInstanceOrBuilder() { + return getInstance(); + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getInstanceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); + } + if (instance_ != null) { + output.writeMessage(3, getInstance()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getInstanceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getInstance()); + } + 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.redis.v1.CreateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.v1.CreateInstanceRequest other = (com.google.cloud.redis.v1.CreateInstanceRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getInstanceId() + .equals(other.getInstanceId()); + result = result && (hasInstance() == other.hasInstance()); + if (hasInstance()) { + result = result && getInstance() + .equals(other.getInstance()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.v1.CreateInstanceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.CreateInstanceRequest 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.redis.v1.CreateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.CreateInstanceRequest 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.redis.v1.CreateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.CreateInstanceRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.redis.v1.CreateInstanceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.CreateInstanceRequest 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.redis.v1.CreateInstanceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.CreateInstanceRequest 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.redis.v1.CreateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.CreateInstanceRequest 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.redis.v1.CreateInstanceRequest 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 for [CreateInstance][google.cloud.redis.v1.CloudRedis.CreateInstance].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.v1.CreateInstanceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.v1.CreateInstanceRequest) + com.google.cloud.redis.v1.CreateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.CreateInstanceRequest.class, com.google.cloud.redis.v1.CreateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.v1.CreateInstanceRequest.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(); + parent_ = ""; + + instanceId_ = ""; + + if (instanceBuilder_ == null) { + instance_ = null; + } else { + instance_ = null; + instanceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.v1.CreateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.redis.v1.CreateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.v1.CreateInstanceRequest build() { + com.google.cloud.redis.v1.CreateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.v1.CreateInstanceRequest buildPartial() { + com.google.cloud.redis.v1.CreateInstanceRequest result = new com.google.cloud.redis.v1.CreateInstanceRequest(this); + result.parent_ = parent_; + result.instanceId_ = instanceId_; + if (instanceBuilder_ == null) { + result.instance_ = instance_; + } else { + result.instance_ = instanceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.v1.CreateInstanceRequest) { + return mergeFrom((com.google.cloud.redis.v1.CreateInstanceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.v1.CreateInstanceRequest other) { + if (other == com.google.cloud.redis.v1.CreateInstanceRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + onChanged(); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + 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.redis.v1.CreateInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.redis.v1.CreateInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The resource name of the instance location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name of the instance location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name of the instance location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the instance location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the instance location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + /** + *
+     * Required. The logical name of the Redis instance in the customer project
+     * with the following restrictions:
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-40 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * string instance_id = 2; + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The logical name of the Redis instance in the customer project
+     * with the following restrictions:
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-40 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * string instance_id = 2; + */ + public com.google.protobuf.ByteString + getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The logical name of the Redis instance in the customer project
+     * with the following restrictions:
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-40 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * string instance_id = 2; + */ + public Builder setInstanceId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + instanceId_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The logical name of the Redis instance in the customer project
+     * with the following restrictions:
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-40 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * string instance_id = 2; + */ + public Builder clearInstanceId() { + + instanceId_ = getDefaultInstance().getInstanceId(); + onChanged(); + return this; + } + /** + *
+     * Required. The logical name of the Redis instance in the customer project
+     * with the following restrictions:
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-40 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * string instance_id = 2; + */ + public Builder setInstanceIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + instanceId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.redis.v1.Instance instance_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.v1.Instance, com.google.cloud.redis.v1.Instance.Builder, com.google.cloud.redis.v1.InstanceOrBuilder> instanceBuilder_; + /** + *
+     * Required. A Redis [Instance] resource
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + public boolean hasInstance() { + return instanceBuilder_ != null || instance_ != null; + } + /** + *
+     * Required. A Redis [Instance] resource
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + public com.google.cloud.redis.v1.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null ? com.google.cloud.redis.v1.Instance.getDefaultInstance() : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + *
+     * Required. A Redis [Instance] resource
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + public Builder setInstance(com.google.cloud.redis.v1.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + onChanged(); + } else { + instanceBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. A Redis [Instance] resource
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + public Builder setInstance( + com.google.cloud.redis.v1.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + onChanged(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. A Redis [Instance] resource
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + public Builder mergeInstance(com.google.cloud.redis.v1.Instance value) { + if (instanceBuilder_ == null) { + if (instance_ != null) { + instance_ = + com.google.cloud.redis.v1.Instance.newBuilder(instance_).mergeFrom(value).buildPartial(); + } else { + instance_ = value; + } + onChanged(); + } else { + instanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. A Redis [Instance] resource
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + public Builder clearInstance() { + if (instanceBuilder_ == null) { + instance_ = null; + onChanged(); + } else { + instance_ = null; + instanceBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. A Redis [Instance] resource
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + public com.google.cloud.redis.v1.Instance.Builder getInstanceBuilder() { + + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + *
+     * Required. A Redis [Instance] resource
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + public com.google.cloud.redis.v1.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null ? + com.google.cloud.redis.v1.Instance.getDefaultInstance() : instance_; + } + } + /** + *
+     * Required. A Redis [Instance] resource
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.v1.Instance, com.google.cloud.redis.v1.Instance.Builder, com.google.cloud.redis.v1.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.v1.Instance, com.google.cloud.redis.v1.Instance.Builder, com.google.cloud.redis.v1.InstanceOrBuilder>( + getInstance(), + getParentForChildren(), + isClean()); + instance_ = null; + } + return instanceBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.redis.v1.CreateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.v1.CreateInstanceRequest) + private static final com.google.cloud.redis.v1.CreateInstanceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.v1.CreateInstanceRequest(); + } + + public static com.google.cloud.redis.v1.CreateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateInstanceRequest(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.redis.v1.CreateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CreateInstanceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CreateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..f4f2361ee463 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/CreateInstanceRequestOrBuilder.java @@ -0,0 +1,86 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +public interface CreateInstanceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.v1.CreateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name of the instance location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * Required. The resource name of the instance location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Required. The logical name of the Redis instance in the customer project
+   * with the following restrictions:
+   * * Must contain only lowercase letters, numbers, and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-40 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project / location
+   * 
+ * + * string instance_id = 2; + */ + java.lang.String getInstanceId(); + /** + *
+   * Required. The logical name of the Redis instance in the customer project
+   * with the following restrictions:
+   * * Must contain only lowercase letters, numbers, and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-40 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project / location
+   * 
+ * + * string instance_id = 2; + */ + com.google.protobuf.ByteString + getInstanceIdBytes(); + + /** + *
+   * Required. A Redis [Instance] resource
+   * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + boolean hasInstance(); + /** + *
+   * Required. A Redis [Instance] resource
+   * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + com.google.cloud.redis.v1.Instance getInstance(); + /** + *
+   * Required. A Redis [Instance] resource
+   * 
+ * + * .google.cloud.redis.v1.Instance instance = 3; + */ + com.google.cloud.redis.v1.InstanceOrBuilder getInstanceOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/DeleteInstanceRequest.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/DeleteInstanceRequest.java new file mode 100644 index 000000000000..66dc702fd799 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/DeleteInstanceRequest.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +/** + *
+ * Request for [DeleteInstance][google.cloud.redis.v1.CloudRedis.DeleteInstance].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.v1.DeleteInstanceRequest} + */ +public final class DeleteInstanceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.v1.DeleteInstanceRequest) + DeleteInstanceRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteInstanceRequest.newBuilder() to construct. + private DeleteInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteInstanceRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteInstanceRequest( + 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(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.DeleteInstanceRequest.class, com.google.cloud.redis.v1.DeleteInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. Redis instance resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + *
+   * Required. Redis instance resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.redis.v1.DeleteInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.v1.DeleteInstanceRequest other = (com.google.cloud.redis.v1.DeleteInstanceRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.v1.DeleteInstanceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.DeleteInstanceRequest 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.redis.v1.DeleteInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.DeleteInstanceRequest 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.redis.v1.DeleteInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.DeleteInstanceRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.redis.v1.DeleteInstanceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.DeleteInstanceRequest 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.redis.v1.DeleteInstanceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.DeleteInstanceRequest 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.redis.v1.DeleteInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.DeleteInstanceRequest 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.redis.v1.DeleteInstanceRequest 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 for [DeleteInstance][google.cloud.redis.v1.CloudRedis.DeleteInstance].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.v1.DeleteInstanceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.v1.DeleteInstanceRequest) + com.google.cloud.redis.v1.DeleteInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.DeleteInstanceRequest.class, com.google.cloud.redis.v1.DeleteInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.v1.DeleteInstanceRequest.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(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.v1.DeleteInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.redis.v1.DeleteInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.v1.DeleteInstanceRequest build() { + com.google.cloud.redis.v1.DeleteInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.v1.DeleteInstanceRequest buildPartial() { + com.google.cloud.redis.v1.DeleteInstanceRequest result = new com.google.cloud.redis.v1.DeleteInstanceRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.v1.DeleteInstanceRequest) { + return mergeFrom((com.google.cloud.redis.v1.DeleteInstanceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.v1.DeleteInstanceRequest other) { + if (other == com.google.cloud.redis.v1.DeleteInstanceRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + 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.redis.v1.DeleteInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.redis.v1.DeleteInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. Redis instance resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. Redis instance resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. Redis instance resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. Redis instance resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. Redis instance resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.redis.v1.DeleteInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.v1.DeleteInstanceRequest) + private static final com.google.cloud.redis.v1.DeleteInstanceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.v1.DeleteInstanceRequest(); + } + + public static com.google.cloud.redis.v1.DeleteInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteInstanceRequest(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.redis.v1.DeleteInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/DeleteInstanceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/DeleteInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..7b16eaab4f42 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/DeleteInstanceRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +public interface DeleteInstanceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.v1.DeleteInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. Redis instance resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required. Redis instance resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/GetInstanceRequest.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/GetInstanceRequest.java new file mode 100644 index 000000000000..9c9c11b27549 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/GetInstanceRequest.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +/** + *
+ * Request for [GetInstance][google.cloud.redis.v1.CloudRedis.GetInstance].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.v1.GetInstanceRequest} + */ +public final class GetInstanceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.v1.GetInstanceRequest) + GetInstanceRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetInstanceRequest.newBuilder() to construct. + private GetInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetInstanceRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetInstanceRequest( + 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(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.GetInstanceRequest.class, com.google.cloud.redis.v1.GetInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. Redis instance resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + *
+   * Required. Redis instance resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.redis.v1.GetInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.v1.GetInstanceRequest other = (com.google.cloud.redis.v1.GetInstanceRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.v1.GetInstanceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.GetInstanceRequest 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.redis.v1.GetInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.GetInstanceRequest 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.redis.v1.GetInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.GetInstanceRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.redis.v1.GetInstanceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.GetInstanceRequest 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.redis.v1.GetInstanceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.GetInstanceRequest 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.redis.v1.GetInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.GetInstanceRequest 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.redis.v1.GetInstanceRequest 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 for [GetInstance][google.cloud.redis.v1.CloudRedis.GetInstance].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.v1.GetInstanceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.v1.GetInstanceRequest) + com.google.cloud.redis.v1.GetInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.GetInstanceRequest.class, com.google.cloud.redis.v1.GetInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.v1.GetInstanceRequest.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(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.v1.GetInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.redis.v1.GetInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.v1.GetInstanceRequest build() { + com.google.cloud.redis.v1.GetInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.v1.GetInstanceRequest buildPartial() { + com.google.cloud.redis.v1.GetInstanceRequest result = new com.google.cloud.redis.v1.GetInstanceRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.v1.GetInstanceRequest) { + return mergeFrom((com.google.cloud.redis.v1.GetInstanceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.v1.GetInstanceRequest other) { + if (other == com.google.cloud.redis.v1.GetInstanceRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + 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.redis.v1.GetInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.redis.v1.GetInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Required. Redis instance resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. Redis instance resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. Redis instance resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. Redis instance resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. Redis instance resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.redis.v1.GetInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.v1.GetInstanceRequest) + private static final com.google.cloud.redis.v1.GetInstanceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.v1.GetInstanceRequest(); + } + + public static com.google.cloud.redis.v1.GetInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetInstanceRequest(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.redis.v1.GetInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/GetInstanceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/GetInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..cd5f046f92bd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/GetInstanceRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +public interface GetInstanceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.v1.GetInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. Redis instance resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required. Redis instance resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/Instance.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/Instance.java new file mode 100644 index 000000000000..3a345b260597 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/Instance.java @@ -0,0 +1,3770 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +/** + *
+ * A Google Cloud Redis instance.
+ * 
+ * + * Protobuf type {@code google.cloud.redis.v1.Instance} + */ +public final class Instance extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.v1.Instance) + InstanceOrBuilder { +private static final long serialVersionUID = 0L; + // Use Instance.newBuilder() to construct. + private Instance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Instance() { + name_ = ""; + displayName_ = ""; + locationId_ = ""; + alternativeLocationId_ = ""; + redisVersion_ = ""; + reservedIpRange_ = ""; + host_ = ""; + port_ = 0; + currentLocationId_ = ""; + state_ = 0; + statusMessage_ = ""; + tier_ = 0; + memorySizeGb_ = 0; + authorizedNetwork_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Instance( + 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(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + labels_ = com.google.protobuf.MapField.newMapField( + LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000004; + } + com.google.protobuf.MapEntry + labels__ = input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put( + labels__.getKey(), labels__.getValue()); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + locationId_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + alternativeLocationId_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + redisVersion_ = s; + break; + } + case 74: { + java.lang.String s = input.readStringRequireUtf8(); + + reservedIpRange_ = s; + break; + } + case 82: { + java.lang.String s = input.readStringRequireUtf8(); + + host_ = s; + break; + } + case 88: { + + port_ = input.readInt32(); + break; + } + case 98: { + java.lang.String s = input.readStringRequireUtf8(); + + currentLocationId_ = s; + break; + } + case 106: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 112: { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 122: { + java.lang.String s = input.readStringRequireUtf8(); + + statusMessage_ = s; + break; + } + case 130: { + if (!((mutable_bitField0_ & 0x00002000) == 0x00002000)) { + redisConfigs_ = com.google.protobuf.MapField.newMapField( + RedisConfigsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00002000; + } + com.google.protobuf.MapEntry + redisConfigs__ = input.readMessage( + RedisConfigsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + redisConfigs_.getMutableMap().put( + redisConfigs__.getKey(), redisConfigs__.getValue()); + break; + } + case 136: { + int rawValue = input.readEnum(); + + tier_ = rawValue; + break; + } + case 144: { + + memorySizeGb_ = input.readInt32(); + break; + } + case 162: { + java.lang.String s = input.readStringRequireUtf8(); + + authorizedNetwork_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetLabels(); + case 16: + return internalGetRedisConfigs(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.Instance.class, com.google.cloud.redis.v1.Instance.Builder.class); + } + + /** + *
+   * Represents the different states of a Redis instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.redis.v1.Instance.State} + */ + public enum State + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + *
+     * Redis instance is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + *
+     * Redis instance has been created and is fully usable.
+     * 
+ * + * READY = 2; + */ + READY(2), + /** + *
+     * Redis instance configuration is being updated. Certain kinds of updates
+     * may cause the instance to become unusable while the update is in
+     * progress.
+     * 
+ * + * UPDATING = 3; + */ + UPDATING(3), + /** + *
+     * Redis instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + /** + *
+     * Redis instance is being repaired and may be unusable. Details can be
+     * found in the `status_message` field.
+     * 
+ * + * REPAIRING = 5; + */ + REPAIRING(5), + /** + *
+     * Maintenance is being performed on this Redis instance.
+     * 
+ * + * MAINTENANCE = 6; + */ + MAINTENANCE(6), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + *
+     * Redis instance is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + *
+     * Redis instance has been created and is fully usable.
+     * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + *
+     * Redis instance configuration is being updated. Certain kinds of updates
+     * may cause the instance to become unusable while the update is in
+     * progress.
+     * 
+ * + * UPDATING = 3; + */ + public static final int UPDATING_VALUE = 3; + /** + *
+     * Redis instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + public static final int DELETING_VALUE = 4; + /** + *
+     * Redis instance is being repaired and may be unusable. Details can be
+     * found in the `status_message` field.
+     * 
+ * + * REPAIRING = 5; + */ + public static final int REPAIRING_VALUE = 5; + /** + *
+     * Maintenance is being performed on this Redis instance.
+     * 
+ * + * MAINTENANCE = 6; + */ + public static final int MAINTENANCE_VALUE = 6; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static State valueOf(int value) { + return forNumber(value); + } + + public static State forNumber(int value) { + switch (value) { + case 0: return STATE_UNSPECIFIED; + case 1: return CREATING; + case 2: return READY; + case 3: return UPDATING; + case 4: return DELETING; + case 5: return REPAIRING; + case 6: return MAINTENANCE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + State> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public State findValueByNumber(int number) { + return State.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.redis.v1.Instance.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.redis.v1.Instance.State) + } + + /** + *
+   * Available service tiers to choose from
+   * 
+ * + * Protobuf enum {@code google.cloud.redis.v1.Instance.Tier} + */ + public enum Tier + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Not set.
+     * 
+ * + * TIER_UNSPECIFIED = 0; + */ + TIER_UNSPECIFIED(0), + /** + *
+     * BASIC tier: standalone instance
+     * 
+ * + * BASIC = 1; + */ + BASIC(1), + /** + *
+     * STANDARD_HA tier: highly available primary/replica instances
+     * 
+ * + * STANDARD_HA = 3; + */ + STANDARD_HA(3), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Not set.
+     * 
+ * + * TIER_UNSPECIFIED = 0; + */ + public static final int TIER_UNSPECIFIED_VALUE = 0; + /** + *
+     * BASIC tier: standalone instance
+     * 
+ * + * BASIC = 1; + */ + public static final int BASIC_VALUE = 1; + /** + *
+     * STANDARD_HA tier: highly available primary/replica instances
+     * 
+ * + * STANDARD_HA = 3; + */ + public static final int STANDARD_HA_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Tier valueOf(int value) { + return forNumber(value); + } + + public static Tier forNumber(int value) { + switch (value) { + case 0: return TIER_UNSPECIFIED; + case 1: return BASIC; + case 3: return STANDARD_HA; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Tier> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Tier findValueByNumber(int number) { + return Tier.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.redis.v1.Instance.getDescriptor().getEnumTypes().get(1); + } + + private static final Tier[] VALUES = values(); + + public static Tier valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Tier(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.redis.v1.Instance.Tier) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Required. Unique name of the resource in this scope including project and
+   * location using the form:
+   *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * Note: Redis instances are managed and addressed at regional level so
+   * location_id here refers to a GCP region; however, users may choose which
+   * specific zone (or collection of zones for cross-zone instances) an instance
+   * should be provisioned in. Refer to [location_id] and
+   * [alternative_location_id] fields for more details.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + *
+   * Required. Unique name of the resource in this scope including project and
+   * location using the form:
+   *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * Note: Redis instances are managed and addressed at regional level so
+   * location_id here refers to a GCP region; however, users may choose which
+   * specific zone (or collection of zones for cross-zone instances) an instance
+   * should be provisioned in. Refer to [location_id] and
+   * [alternative_location_id] fields for more details.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + *
+   * An arbitrary and optional user-provided name for the instance.
+   * 
+ * + * string display_name = 2; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + *
+   * An arbitrary and optional user-provided name for the instance.
+   * 
+ * + * string display_name = 2; + */ + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABELS_FIELD_NUMBER = 3; + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_Instance_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> labels_; + private com.google.protobuf.MapField + internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + *
+   * Resource labels to represent user provided metadata
+   * 
+ * + * map<string, string> labels = 3; + */ + + public boolean containsLabels( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetLabels().getMap().containsKey(key); + } + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + *
+   * Resource labels to represent user provided metadata
+   * 
+ * + * map<string, string> labels = 3; + */ + + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + *
+   * Resource labels to represent user provided metadata
+   * 
+ * + * map<string, string> labels = 3; + */ + + public java.lang.String getLabelsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * Resource labels to represent user provided metadata
+   * 
+ * + * map<string, string> labels = 3; + */ + + public java.lang.String getLabelsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int LOCATION_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object locationId_; + /** + *
+   * Optional. The zone where the instance will be provisioned. If not provided,
+   * the service will choose a zone for the instance. For STANDARD_HA tier,
+   * instances will be created across two zones for protection against zonal
+   * failures. If [alternative_location_id] is also provided, it must be
+   * different from [location_id].
+   * 
+ * + * string location_id = 4; + */ + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + 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(); + locationId_ = s; + return s; + } + } + /** + *
+   * Optional. The zone where the instance will be provisioned. If not provided,
+   * the service will choose a zone for the instance. For STANDARD_HA tier,
+   * instances will be created across two zones for protection against zonal
+   * failures. If [alternative_location_id] is also provided, it must be
+   * different from [location_id].
+   * 
+ * + * string location_id = 4; + */ + public com.google.protobuf.ByteString + getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALTERNATIVE_LOCATION_ID_FIELD_NUMBER = 5; + private volatile java.lang.Object alternativeLocationId_; + /** + *
+   * Optional. Only applicable to STANDARD_HA tier which protects the instance
+   * against zonal failures by provisioning it across two zones. If provided, it
+   * must be a different zone from the one provided in [location_id].
+   * 
+ * + * string alternative_location_id = 5; + */ + public java.lang.String getAlternativeLocationId() { + java.lang.Object ref = alternativeLocationId_; + 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(); + alternativeLocationId_ = s; + return s; + } + } + /** + *
+   * Optional. Only applicable to STANDARD_HA tier which protects the instance
+   * against zonal failures by provisioning it across two zones. If provided, it
+   * must be a different zone from the one provided in [location_id].
+   * 
+ * + * string alternative_location_id = 5; + */ + public com.google.protobuf.ByteString + getAlternativeLocationIdBytes() { + java.lang.Object ref = alternativeLocationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + alternativeLocationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REDIS_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object redisVersion_; + /** + *
+   * Optional. The version of Redis software.
+   * If not provided, latest supported version will be used. Updating the
+   * version will perform an upgrade/downgrade to the new version. Currently,
+   * the supported values are `REDIS_3_2` for Redis 3.2.
+   * 
+ * + * string redis_version = 7; + */ + public java.lang.String getRedisVersion() { + java.lang.Object ref = redisVersion_; + 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(); + redisVersion_ = s; + return s; + } + } + /** + *
+   * Optional. The version of Redis software.
+   * If not provided, latest supported version will be used. Updating the
+   * version will perform an upgrade/downgrade to the new version. Currently,
+   * the supported values are `REDIS_3_2` for Redis 3.2.
+   * 
+ * + * string redis_version = 7; + */ + public com.google.protobuf.ByteString + getRedisVersionBytes() { + java.lang.Object ref = redisVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + redisVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESERVED_IP_RANGE_FIELD_NUMBER = 9; + private volatile java.lang.Object reservedIpRange_; + /** + *
+   * Optional. The CIDR range of internal addresses that are reserved for this
+   * instance. If not provided, the service will choose an unused /29 block,
+   * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
+   * and non-overlapping with existing subnets in an authorized network.
+   * 
+ * + * string reserved_ip_range = 9; + */ + public java.lang.String getReservedIpRange() { + java.lang.Object ref = reservedIpRange_; + 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(); + reservedIpRange_ = s; + return s; + } + } + /** + *
+   * Optional. The CIDR range of internal addresses that are reserved for this
+   * instance. If not provided, the service will choose an unused /29 block,
+   * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
+   * and non-overlapping with existing subnets in an authorized network.
+   * 
+ * + * string reserved_ip_range = 9; + */ + public com.google.protobuf.ByteString + getReservedIpRangeBytes() { + java.lang.Object ref = reservedIpRange_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + reservedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HOST_FIELD_NUMBER = 10; + private volatile java.lang.Object host_; + /** + *
+   * Output only. Hostname or IP address of the exposed Redis endpoint used by
+   * clients to connect to the service.
+   * 
+ * + * string host = 10; + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + 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(); + host_ = s; + return s; + } + } + /** + *
+   * Output only. Hostname or IP address of the exposed Redis endpoint used by
+   * clients to connect to the service.
+   * 
+ * + * string host = 10; + */ + public com.google.protobuf.ByteString + getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PORT_FIELD_NUMBER = 11; + private int port_; + /** + *
+   * Output only. The port number of the exposed Redis endpoint.
+   * 
+ * + * int32 port = 11; + */ + public int getPort() { + return port_; + } + + public static final int CURRENT_LOCATION_ID_FIELD_NUMBER = 12; + private volatile java.lang.Object currentLocationId_; + /** + *
+   * Output only. The current zone where the Redis endpoint is placed. For Basic
+   * Tier instances, this will always be the same as the [location_id]
+   * provided by the user at creation time. For Standard Tier instances,
+   * this can be either [location_id] or [alternative_location_id] and can
+   * change after a failover event.
+   * 
+ * + * string current_location_id = 12; + */ + public java.lang.String getCurrentLocationId() { + java.lang.Object ref = currentLocationId_; + 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(); + currentLocationId_ = s; + return s; + } + } + /** + *
+   * Output only. The current zone where the Redis endpoint is placed. For Basic
+   * Tier instances, this will always be the same as the [location_id]
+   * provided by the user at creation time. For Standard Tier instances,
+   * this can be either [location_id] or [alternative_location_id] and can
+   * change after a failover event.
+   * 
+ * + * string current_location_id = 12; + */ + public com.google.protobuf.ByteString + getCurrentLocationIdBytes() { + java.lang.Object ref = currentLocationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + currentLocationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 13; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * Output only. The time the instance was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * Output only. The time the instance was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + *
+   * Output only. The time the instance was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int STATE_FIELD_NUMBER = 14; + private int state_; + /** + *
+   * Output only. The current state of this instance.
+   * 
+ * + * .google.cloud.redis.v1.Instance.State state = 14; + */ + public int getStateValue() { + return state_; + } + /** + *
+   * Output only. The current state of this instance.
+   * 
+ * + * .google.cloud.redis.v1.Instance.State state = 14; + */ + public com.google.cloud.redis.v1.Instance.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.redis.v1.Instance.State result = com.google.cloud.redis.v1.Instance.State.valueOf(state_); + return result == null ? com.google.cloud.redis.v1.Instance.State.UNRECOGNIZED : result; + } + + public static final int STATUS_MESSAGE_FIELD_NUMBER = 15; + private volatile java.lang.Object statusMessage_; + /** + *
+   * Output only. Additional information about the current status of this
+   * instance, if available.
+   * 
+ * + * string status_message = 15; + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + 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(); + statusMessage_ = s; + return s; + } + } + /** + *
+   * Output only. Additional information about the current status of this
+   * instance, if available.
+   * 
+ * + * string status_message = 15; + */ + public com.google.protobuf.ByteString + getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REDIS_CONFIGS_FIELD_NUMBER = 16; + private static final class RedisConfigsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_Instance_RedisConfigsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> redisConfigs_; + private com.google.protobuf.MapField + internalGetRedisConfigs() { + if (redisConfigs_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RedisConfigsDefaultEntryHolder.defaultEntry); + } + return redisConfigs_; + } + + public int getRedisConfigsCount() { + return internalGetRedisConfigs().getMap().size(); + } + /** + *
+   * Optional. Redis configuration parameters, according to
+   * http://redis.io/topics/config. Currently, the only supported parameters
+   * are:
+   *  *   maxmemory-policy
+   *  *   notify-keyspace-events
+   * 
+ * + * map<string, string> redis_configs = 16; + */ + + public boolean containsRedisConfigs( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetRedisConfigs().getMap().containsKey(key); + } + /** + * Use {@link #getRedisConfigsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getRedisConfigs() { + return getRedisConfigsMap(); + } + /** + *
+   * Optional. Redis configuration parameters, according to
+   * http://redis.io/topics/config. Currently, the only supported parameters
+   * are:
+   *  *   maxmemory-policy
+   *  *   notify-keyspace-events
+   * 
+ * + * map<string, string> redis_configs = 16; + */ + + public java.util.Map getRedisConfigsMap() { + return internalGetRedisConfigs().getMap(); + } + /** + *
+   * Optional. Redis configuration parameters, according to
+   * http://redis.io/topics/config. Currently, the only supported parameters
+   * are:
+   *  *   maxmemory-policy
+   *  *   notify-keyspace-events
+   * 
+ * + * map<string, string> redis_configs = 16; + */ + + public java.lang.String getRedisConfigsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetRedisConfigs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * Optional. Redis configuration parameters, according to
+   * http://redis.io/topics/config. Currently, the only supported parameters
+   * are:
+   *  *   maxmemory-policy
+   *  *   notify-keyspace-events
+   * 
+ * + * map<string, string> redis_configs = 16; + */ + + public java.lang.String getRedisConfigsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetRedisConfigs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TIER_FIELD_NUMBER = 17; + private int tier_; + /** + *
+   * Required. The service tier of the instance.
+   * 
+ * + * .google.cloud.redis.v1.Instance.Tier tier = 17; + */ + public int getTierValue() { + return tier_; + } + /** + *
+   * Required. The service tier of the instance.
+   * 
+ * + * .google.cloud.redis.v1.Instance.Tier tier = 17; + */ + public com.google.cloud.redis.v1.Instance.Tier getTier() { + @SuppressWarnings("deprecation") + com.google.cloud.redis.v1.Instance.Tier result = com.google.cloud.redis.v1.Instance.Tier.valueOf(tier_); + return result == null ? com.google.cloud.redis.v1.Instance.Tier.UNRECOGNIZED : result; + } + + public static final int MEMORY_SIZE_GB_FIELD_NUMBER = 18; + private int memorySizeGb_; + /** + *
+   * Required. Redis memory size in GiB.
+   * 
+ * + * int32 memory_size_gb = 18; + */ + public int getMemorySizeGb() { + return memorySizeGb_; + } + + public static final int AUTHORIZED_NETWORK_FIELD_NUMBER = 20; + private volatile java.lang.Object authorizedNetwork_; + /** + *
+   * Optional. The full name of the Google Compute Engine
+   * [network](/compute/docs/networks-and-firewalls#networks) to which the
+   * instance is connected. If left unspecified, the `default` network
+   * will be used.
+   * 
+ * + * string authorized_network = 20; + */ + public java.lang.String getAuthorizedNetwork() { + java.lang.Object ref = authorizedNetwork_; + 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(); + authorizedNetwork_ = s; + return s; + } + } + /** + *
+   * Optional. The full name of the Google Compute Engine
+   * [network](/compute/docs/networks-and-firewalls#networks) to which the
+   * instance is connected. If left unspecified, the `default` network
+   * will be used.
+   * 
+ * + * string authorized_network = 20; + */ + public com.google.protobuf.ByteString + getAuthorizedNetworkBytes() { + java.lang.Object ref = authorizedNetwork_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + authorizedNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetLabels(), + LabelsDefaultEntryHolder.defaultEntry, + 3); + if (!getLocationIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, locationId_); + } + if (!getAlternativeLocationIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, alternativeLocationId_); + } + if (!getRedisVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, redisVersion_); + } + if (!getReservedIpRangeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, reservedIpRange_); + } + if (!getHostBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, host_); + } + if (port_ != 0) { + output.writeInt32(11, port_); + } + if (!getCurrentLocationIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, currentLocationId_); + } + if (createTime_ != null) { + output.writeMessage(13, getCreateTime()); + } + if (state_ != com.google.cloud.redis.v1.Instance.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(14, state_); + } + if (!getStatusMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, statusMessage_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetRedisConfigs(), + RedisConfigsDefaultEntryHolder.defaultEntry, + 16); + if (tier_ != com.google.cloud.redis.v1.Instance.Tier.TIER_UNSPECIFIED.getNumber()) { + output.writeEnum(17, tier_); + } + if (memorySizeGb_ != 0) { + output.writeInt32(18, memorySizeGb_); + } + if (!getAuthorizedNetworkBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 20, authorizedNetwork_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + for (java.util.Map.Entry entry + : internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry + labels__ = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, labels__); + } + if (!getLocationIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, locationId_); + } + if (!getAlternativeLocationIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, alternativeLocationId_); + } + if (!getRedisVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, redisVersion_); + } + if (!getReservedIpRangeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, reservedIpRange_); + } + if (!getHostBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, host_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(11, port_); + } + if (!getCurrentLocationIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, currentLocationId_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, getCreateTime()); + } + if (state_ != com.google.cloud.redis.v1.Instance.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(14, state_); + } + if (!getStatusMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, statusMessage_); + } + for (java.util.Map.Entry entry + : internalGetRedisConfigs().getMap().entrySet()) { + com.google.protobuf.MapEntry + redisConfigs__ = RedisConfigsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(16, redisConfigs__); + } + if (tier_ != com.google.cloud.redis.v1.Instance.Tier.TIER_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(17, tier_); + } + if (memorySizeGb_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(18, memorySizeGb_); + } + if (!getAuthorizedNetworkBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(20, authorizedNetwork_); + } + 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.redis.v1.Instance)) { + return super.equals(obj); + } + com.google.cloud.redis.v1.Instance other = (com.google.cloud.redis.v1.Instance) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getDisplayName() + .equals(other.getDisplayName()); + result = result && internalGetLabels().equals( + other.internalGetLabels()); + result = result && getLocationId() + .equals(other.getLocationId()); + result = result && getAlternativeLocationId() + .equals(other.getAlternativeLocationId()); + result = result && getRedisVersion() + .equals(other.getRedisVersion()); + result = result && getReservedIpRange() + .equals(other.getReservedIpRange()); + result = result && getHost() + .equals(other.getHost()); + result = result && (getPort() + == other.getPort()); + result = result && getCurrentLocationId() + .equals(other.getCurrentLocationId()); + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && state_ == other.state_; + result = result && getStatusMessage() + .equals(other.getStatusMessage()); + result = result && internalGetRedisConfigs().equals( + other.internalGetRedisConfigs()); + result = result && tier_ == other.tier_; + result = result && (getMemorySizeGb() + == other.getMemorySizeGb()); + result = result && getAuthorizedNetwork() + .equals(other.getAuthorizedNetwork()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + LOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getLocationId().hashCode(); + hash = (37 * hash) + ALTERNATIVE_LOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getAlternativeLocationId().hashCode(); + hash = (37 * hash) + REDIS_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getRedisVersion().hashCode(); + hash = (37 * hash) + RESERVED_IP_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getReservedIpRange().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + hash = (37 * hash) + CURRENT_LOCATION_ID_FIELD_NUMBER; + hash = (53 * hash) + getCurrentLocationId().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + STATUS_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getStatusMessage().hashCode(); + if (!internalGetRedisConfigs().getMap().isEmpty()) { + hash = (37 * hash) + REDIS_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetRedisConfigs().hashCode(); + } + hash = (37 * hash) + TIER_FIELD_NUMBER; + hash = (53 * hash) + tier_; + hash = (37 * hash) + MEMORY_SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + getMemorySizeGb(); + hash = (37 * hash) + AUTHORIZED_NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getAuthorizedNetwork().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.v1.Instance parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.Instance 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.redis.v1.Instance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.Instance 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.redis.v1.Instance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.Instance parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.redis.v1.Instance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.Instance 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.redis.v1.Instance parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.Instance 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.redis.v1.Instance parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.Instance 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.redis.v1.Instance 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; + } + /** + *
+   * A Google Cloud Redis instance.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.v1.Instance} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.v1.Instance) + com.google.cloud.redis.v1.InstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetLabels(); + case 16: + return internalGetRedisConfigs(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableLabels(); + case 16: + return internalGetMutableRedisConfigs(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.Instance.class, com.google.cloud.redis.v1.Instance.Builder.class); + } + + // Construct using com.google.cloud.redis.v1.Instance.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(); + name_ = ""; + + displayName_ = ""; + + internalGetMutableLabels().clear(); + locationId_ = ""; + + alternativeLocationId_ = ""; + + redisVersion_ = ""; + + reservedIpRange_ = ""; + + host_ = ""; + + port_ = 0; + + currentLocationId_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + state_ = 0; + + statusMessage_ = ""; + + internalGetMutableRedisConfigs().clear(); + tier_ = 0; + + memorySizeGb_ = 0; + + authorizedNetwork_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_Instance_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.v1.Instance getDefaultInstanceForType() { + return com.google.cloud.redis.v1.Instance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.v1.Instance build() { + com.google.cloud.redis.v1.Instance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.v1.Instance buildPartial() { + com.google.cloud.redis.v1.Instance result = new com.google.cloud.redis.v1.Instance(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + result.displayName_ = displayName_; + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.locationId_ = locationId_; + result.alternativeLocationId_ = alternativeLocationId_; + result.redisVersion_ = redisVersion_; + result.reservedIpRange_ = reservedIpRange_; + result.host_ = host_; + result.port_ = port_; + result.currentLocationId_ = currentLocationId_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.state_ = state_; + result.statusMessage_ = statusMessage_; + result.redisConfigs_ = internalGetRedisConfigs(); + result.redisConfigs_.makeImmutable(); + result.tier_ = tier_; + result.memorySizeGb_ = memorySizeGb_; + result.authorizedNetwork_ = authorizedNetwork_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.v1.Instance) { + return mergeFrom((com.google.cloud.redis.v1.Instance)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.v1.Instance other) { + if (other == com.google.cloud.redis.v1.Instance.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + internalGetMutableLabels().mergeFrom( + other.internalGetLabels()); + if (!other.getLocationId().isEmpty()) { + locationId_ = other.locationId_; + onChanged(); + } + if (!other.getAlternativeLocationId().isEmpty()) { + alternativeLocationId_ = other.alternativeLocationId_; + onChanged(); + } + if (!other.getRedisVersion().isEmpty()) { + redisVersion_ = other.redisVersion_; + onChanged(); + } + if (!other.getReservedIpRange().isEmpty()) { + reservedIpRange_ = other.reservedIpRange_; + onChanged(); + } + if (!other.getHost().isEmpty()) { + host_ = other.host_; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + if (!other.getCurrentLocationId().isEmpty()) { + currentLocationId_ = other.currentLocationId_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + onChanged(); + } + internalGetMutableRedisConfigs().mergeFrom( + other.internalGetRedisConfigs()); + if (other.tier_ != 0) { + setTierValue(other.getTierValue()); + } + if (other.getMemorySizeGb() != 0) { + setMemorySizeGb(other.getMemorySizeGb()); + } + if (!other.getAuthorizedNetwork().isEmpty()) { + authorizedNetwork_ = other.authorizedNetwork_; + onChanged(); + } + 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.redis.v1.Instance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.redis.v1.Instance) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * Note: Redis instances are managed and addressed at regional level so
+     * location_id here refers to a GCP region; however, users may choose which
+     * specific zone (or collection of zones for cross-zone instances) an instance
+     * should be provisioned in. Refer to [location_id] and
+     * [alternative_location_id] fields for more details.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * Note: Redis instances are managed and addressed at regional level so
+     * location_id here refers to a GCP region; however, users may choose which
+     * specific zone (or collection of zones for cross-zone instances) an instance
+     * should be provisioned in. Refer to [location_id] and
+     * [alternative_location_id] fields for more details.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * Note: Redis instances are managed and addressed at regional level so
+     * location_id here refers to a GCP region; however, users may choose which
+     * specific zone (or collection of zones for cross-zone instances) an instance
+     * should be provisioned in. Refer to [location_id] and
+     * [alternative_location_id] fields for more details.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * Note: Redis instances are managed and addressed at regional level so
+     * location_id here refers to a GCP region; however, users may choose which
+     * specific zone (or collection of zones for cross-zone instances) an instance
+     * should be provisioned in. Refer to [location_id] and
+     * [alternative_location_id] fields for more details.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+     * Note: Redis instances are managed and addressed at regional level so
+     * location_id here refers to a GCP region; however, users may choose which
+     * specific zone (or collection of zones for cross-zone instances) an instance
+     * should be provisioned in. Refer to [location_id] and
+     * [alternative_location_id] fields for more details.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + *
+     * An arbitrary and optional user-provided name for the instance.
+     * 
+ * + * string display_name = 2; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * An arbitrary and optional user-provided name for the instance.
+     * 
+ * + * string display_name = 2; + */ + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * An arbitrary and optional user-provided name for the instance.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + *
+     * An arbitrary and optional user-provided name for the instance.
+     * 
+ * + * string display_name = 2; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + *
+     * An arbitrary and optional user-provided name for the instance.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> labels_; + private com.google.protobuf.MapField + internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged();; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + *
+     * Resource labels to represent user provided metadata
+     * 
+ * + * map<string, string> labels = 3; + */ + + public boolean containsLabels( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetLabels().getMap().containsKey(key); + } + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + *
+     * Resource labels to represent user provided metadata
+     * 
+ * + * map<string, string> labels = 3; + */ + + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + *
+     * Resource labels to represent user provided metadata
+     * 
+ * + * map<string, string> labels = 3; + */ + + public java.lang.String getLabelsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Resource labels to represent user provided metadata
+     * 
+ * + * map<string, string> labels = 3; + */ + + public java.lang.String getLabelsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap() + .clear(); + return this; + } + /** + *
+     * Resource labels to represent user provided metadata
+     * 
+ * + * map<string, string> labels = 3; + */ + + public Builder removeLabels( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableLabels().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + *
+     * Resource labels to represent user provided metadata
+     * 
+ * + * map<string, string> labels = 3; + */ + public Builder putLabels( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableLabels().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * Resource labels to represent user provided metadata
+     * 
+ * + * map<string, string> labels = 3; + */ + + public Builder putAllLabels( + java.util.Map values) { + internalGetMutableLabels().getMutableMap() + .putAll(values); + return this; + } + + private java.lang.Object locationId_ = ""; + /** + *
+     * Optional. The zone where the instance will be provisioned. If not provided,
+     * the service will choose a zone for the instance. For STANDARD_HA tier,
+     * instances will be created across two zones for protection against zonal
+     * failures. If [alternative_location_id] is also provided, it must be
+     * different from [location_id].
+     * 
+ * + * string location_id = 4; + */ + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. The zone where the instance will be provisioned. If not provided,
+     * the service will choose a zone for the instance. For STANDARD_HA tier,
+     * instances will be created across two zones for protection against zonal
+     * failures. If [alternative_location_id] is also provided, it must be
+     * different from [location_id].
+     * 
+ * + * string location_id = 4; + */ + public com.google.protobuf.ByteString + getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. The zone where the instance will be provisioned. If not provided,
+     * the service will choose a zone for the instance. For STANDARD_HA tier,
+     * instances will be created across two zones for protection against zonal
+     * failures. If [alternative_location_id] is also provided, it must be
+     * different from [location_id].
+     * 
+ * + * string location_id = 4; + */ + public Builder setLocationId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + locationId_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The zone where the instance will be provisioned. If not provided,
+     * the service will choose a zone for the instance. For STANDARD_HA tier,
+     * instances will be created across two zones for protection against zonal
+     * failures. If [alternative_location_id] is also provided, it must be
+     * different from [location_id].
+     * 
+ * + * string location_id = 4; + */ + public Builder clearLocationId() { + + locationId_ = getDefaultInstance().getLocationId(); + onChanged(); + return this; + } + /** + *
+     * Optional. The zone where the instance will be provisioned. If not provided,
+     * the service will choose a zone for the instance. For STANDARD_HA tier,
+     * instances will be created across two zones for protection against zonal
+     * failures. If [alternative_location_id] is also provided, it must be
+     * different from [location_id].
+     * 
+ * + * string location_id = 4; + */ + public Builder setLocationIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + locationId_ = value; + onChanged(); + return this; + } + + private java.lang.Object alternativeLocationId_ = ""; + /** + *
+     * Optional. Only applicable to STANDARD_HA tier which protects the instance
+     * against zonal failures by provisioning it across two zones. If provided, it
+     * must be a different zone from the one provided in [location_id].
+     * 
+ * + * string alternative_location_id = 5; + */ + public java.lang.String getAlternativeLocationId() { + java.lang.Object ref = alternativeLocationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + alternativeLocationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. Only applicable to STANDARD_HA tier which protects the instance
+     * against zonal failures by provisioning it across two zones. If provided, it
+     * must be a different zone from the one provided in [location_id].
+     * 
+ * + * string alternative_location_id = 5; + */ + public com.google.protobuf.ByteString + getAlternativeLocationIdBytes() { + java.lang.Object ref = alternativeLocationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + alternativeLocationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. Only applicable to STANDARD_HA tier which protects the instance
+     * against zonal failures by provisioning it across two zones. If provided, it
+     * must be a different zone from the one provided in [location_id].
+     * 
+ * + * string alternative_location_id = 5; + */ + public Builder setAlternativeLocationId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + alternativeLocationId_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. Only applicable to STANDARD_HA tier which protects the instance
+     * against zonal failures by provisioning it across two zones. If provided, it
+     * must be a different zone from the one provided in [location_id].
+     * 
+ * + * string alternative_location_id = 5; + */ + public Builder clearAlternativeLocationId() { + + alternativeLocationId_ = getDefaultInstance().getAlternativeLocationId(); + onChanged(); + return this; + } + /** + *
+     * Optional. Only applicable to STANDARD_HA tier which protects the instance
+     * against zonal failures by provisioning it across two zones. If provided, it
+     * must be a different zone from the one provided in [location_id].
+     * 
+ * + * string alternative_location_id = 5; + */ + public Builder setAlternativeLocationIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + alternativeLocationId_ = value; + onChanged(); + return this; + } + + private java.lang.Object redisVersion_ = ""; + /** + *
+     * Optional. The version of Redis software.
+     * If not provided, latest supported version will be used. Updating the
+     * version will perform an upgrade/downgrade to the new version. Currently,
+     * the supported values are `REDIS_3_2` for Redis 3.2.
+     * 
+ * + * string redis_version = 7; + */ + public java.lang.String getRedisVersion() { + java.lang.Object ref = redisVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + redisVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. The version of Redis software.
+     * If not provided, latest supported version will be used. Updating the
+     * version will perform an upgrade/downgrade to the new version. Currently,
+     * the supported values are `REDIS_3_2` for Redis 3.2.
+     * 
+ * + * string redis_version = 7; + */ + public com.google.protobuf.ByteString + getRedisVersionBytes() { + java.lang.Object ref = redisVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + redisVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. The version of Redis software.
+     * If not provided, latest supported version will be used. Updating the
+     * version will perform an upgrade/downgrade to the new version. Currently,
+     * the supported values are `REDIS_3_2` for Redis 3.2.
+     * 
+ * + * string redis_version = 7; + */ + public Builder setRedisVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + redisVersion_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The version of Redis software.
+     * If not provided, latest supported version will be used. Updating the
+     * version will perform an upgrade/downgrade to the new version. Currently,
+     * the supported values are `REDIS_3_2` for Redis 3.2.
+     * 
+ * + * string redis_version = 7; + */ + public Builder clearRedisVersion() { + + redisVersion_ = getDefaultInstance().getRedisVersion(); + onChanged(); + return this; + } + /** + *
+     * Optional. The version of Redis software.
+     * If not provided, latest supported version will be used. Updating the
+     * version will perform an upgrade/downgrade to the new version. Currently,
+     * the supported values are `REDIS_3_2` for Redis 3.2.
+     * 
+ * + * string redis_version = 7; + */ + public Builder setRedisVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + redisVersion_ = value; + onChanged(); + return this; + } + + private java.lang.Object reservedIpRange_ = ""; + /** + *
+     * Optional. The CIDR range of internal addresses that are reserved for this
+     * instance. If not provided, the service will choose an unused /29 block,
+     * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
+     * and non-overlapping with existing subnets in an authorized network.
+     * 
+ * + * string reserved_ip_range = 9; + */ + public java.lang.String getReservedIpRange() { + java.lang.Object ref = reservedIpRange_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reservedIpRange_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. The CIDR range of internal addresses that are reserved for this
+     * instance. If not provided, the service will choose an unused /29 block,
+     * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
+     * and non-overlapping with existing subnets in an authorized network.
+     * 
+ * + * string reserved_ip_range = 9; + */ + public com.google.protobuf.ByteString + getReservedIpRangeBytes() { + java.lang.Object ref = reservedIpRange_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + reservedIpRange_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. The CIDR range of internal addresses that are reserved for this
+     * instance. If not provided, the service will choose an unused /29 block,
+     * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
+     * and non-overlapping with existing subnets in an authorized network.
+     * 
+ * + * string reserved_ip_range = 9; + */ + public Builder setReservedIpRange( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + reservedIpRange_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The CIDR range of internal addresses that are reserved for this
+     * instance. If not provided, the service will choose an unused /29 block,
+     * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
+     * and non-overlapping with existing subnets in an authorized network.
+     * 
+ * + * string reserved_ip_range = 9; + */ + public Builder clearReservedIpRange() { + + reservedIpRange_ = getDefaultInstance().getReservedIpRange(); + onChanged(); + return this; + } + /** + *
+     * Optional. The CIDR range of internal addresses that are reserved for this
+     * instance. If not provided, the service will choose an unused /29 block,
+     * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
+     * and non-overlapping with existing subnets in an authorized network.
+     * 
+ * + * string reserved_ip_range = 9; + */ + public Builder setReservedIpRangeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + reservedIpRange_ = value; + onChanged(); + return this; + } + + private java.lang.Object host_ = ""; + /** + *
+     * Output only. Hostname or IP address of the exposed Redis endpoint used by
+     * clients to connect to the service.
+     * 
+ * + * string host = 10; + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. Hostname or IP address of the exposed Redis endpoint used by
+     * clients to connect to the service.
+     * 
+ * + * string host = 10; + */ + public com.google.protobuf.ByteString + getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. Hostname or IP address of the exposed Redis endpoint used by
+     * clients to connect to the service.
+     * 
+ * + * string host = 10; + */ + public Builder setHost( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + host_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. Hostname or IP address of the exposed Redis endpoint used by
+     * clients to connect to the service.
+     * 
+ * + * string host = 10; + */ + public Builder clearHost() { + + host_ = getDefaultInstance().getHost(); + onChanged(); + return this; + } + /** + *
+     * Output only. Hostname or IP address of the exposed Redis endpoint used by
+     * clients to connect to the service.
+     * 
+ * + * string host = 10; + */ + public Builder setHostBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + host_ = value; + onChanged(); + return this; + } + + private int port_ ; + /** + *
+     * Output only. The port number of the exposed Redis endpoint.
+     * 
+ * + * int32 port = 11; + */ + public int getPort() { + return port_; + } + /** + *
+     * Output only. The port number of the exposed Redis endpoint.
+     * 
+ * + * int32 port = 11; + */ + public Builder setPort(int value) { + + port_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The port number of the exposed Redis endpoint.
+     * 
+ * + * int32 port = 11; + */ + public Builder clearPort() { + + port_ = 0; + onChanged(); + return this; + } + + private java.lang.Object currentLocationId_ = ""; + /** + *
+     * Output only. The current zone where the Redis endpoint is placed. For Basic
+     * Tier instances, this will always be the same as the [location_id]
+     * provided by the user at creation time. For Standard Tier instances,
+     * this can be either [location_id] or [alternative_location_id] and can
+     * change after a failover event.
+     * 
+ * + * string current_location_id = 12; + */ + public java.lang.String getCurrentLocationId() { + java.lang.Object ref = currentLocationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + currentLocationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The current zone where the Redis endpoint is placed. For Basic
+     * Tier instances, this will always be the same as the [location_id]
+     * provided by the user at creation time. For Standard Tier instances,
+     * this can be either [location_id] or [alternative_location_id] and can
+     * change after a failover event.
+     * 
+ * + * string current_location_id = 12; + */ + public com.google.protobuf.ByteString + getCurrentLocationIdBytes() { + java.lang.Object ref = currentLocationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + currentLocationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The current zone where the Redis endpoint is placed. For Basic
+     * Tier instances, this will always be the same as the [location_id]
+     * provided by the user at creation time. For Standard Tier instances,
+     * this can be either [location_id] or [alternative_location_id] and can
+     * change after a failover event.
+     * 
+ * + * string current_location_id = 12; + */ + public Builder setCurrentLocationId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + currentLocationId_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The current zone where the Redis endpoint is placed. For Basic
+     * Tier instances, this will always be the same as the [location_id]
+     * provided by the user at creation time. For Standard Tier instances,
+     * this can be either [location_id] or [alternative_location_id] and can
+     * change after a failover event.
+     * 
+ * + * string current_location_id = 12; + */ + public Builder clearCurrentLocationId() { + + currentLocationId_ = getDefaultInstance().getCurrentLocationId(); + onChanged(); + return this; + } + /** + *
+     * Output only. The current zone where the Redis endpoint is placed. For Basic
+     * Tier instances, this will always be the same as the [location_id]
+     * provided by the user at creation time. For Standard Tier instances,
+     * this can be either [location_id] or [alternative_location_id] and can
+     * change after a failover event.
+     * 
+ * + * string current_location_id = 12; + */ + public Builder setCurrentLocationIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + currentLocationId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * Output only. The time the instance was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * Output only. The time the instance was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time the instance was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time the instance was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + public Builder setCreateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time the instance was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time the instance was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time the instance was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time the instance was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + } + /** + *
+     * Output only. The time the instance was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), + getParentForChildren(), + isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private int state_ = 0; + /** + *
+     * Output only. The current state of this instance.
+     * 
+ * + * .google.cloud.redis.v1.Instance.State state = 14; + */ + public int getStateValue() { + return state_; + } + /** + *
+     * Output only. The current state of this instance.
+     * 
+ * + * .google.cloud.redis.v1.Instance.State state = 14; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The current state of this instance.
+     * 
+ * + * .google.cloud.redis.v1.Instance.State state = 14; + */ + public com.google.cloud.redis.v1.Instance.State getState() { + @SuppressWarnings("deprecation") + com.google.cloud.redis.v1.Instance.State result = com.google.cloud.redis.v1.Instance.State.valueOf(state_); + return result == null ? com.google.cloud.redis.v1.Instance.State.UNRECOGNIZED : result; + } + /** + *
+     * Output only. The current state of this instance.
+     * 
+ * + * .google.cloud.redis.v1.Instance.State state = 14; + */ + public Builder setState(com.google.cloud.redis.v1.Instance.State value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Output only. The current state of this instance.
+     * 
+ * + * .google.cloud.redis.v1.Instance.State state = 14; + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object statusMessage_ = ""; + /** + *
+     * Output only. Additional information about the current status of this
+     * instance, if available.
+     * 
+ * + * string status_message = 15; + */ + public java.lang.String getStatusMessage() { + java.lang.Object ref = statusMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. Additional information about the current status of this
+     * instance, if available.
+     * 
+ * + * string status_message = 15; + */ + public com.google.protobuf.ByteString + getStatusMessageBytes() { + java.lang.Object ref = statusMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + statusMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. Additional information about the current status of this
+     * instance, if available.
+     * 
+ * + * string status_message = 15; + */ + public Builder setStatusMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusMessage_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. Additional information about the current status of this
+     * instance, if available.
+     * 
+ * + * string status_message = 15; + */ + public Builder clearStatusMessage() { + + statusMessage_ = getDefaultInstance().getStatusMessage(); + onChanged(); + return this; + } + /** + *
+     * Output only. Additional information about the current status of this
+     * instance, if available.
+     * 
+ * + * string status_message = 15; + */ + public Builder setStatusMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusMessage_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> redisConfigs_; + private com.google.protobuf.MapField + internalGetRedisConfigs() { + if (redisConfigs_ == null) { + return com.google.protobuf.MapField.emptyMapField( + RedisConfigsDefaultEntryHolder.defaultEntry); + } + return redisConfigs_; + } + private com.google.protobuf.MapField + internalGetMutableRedisConfigs() { + onChanged();; + if (redisConfigs_ == null) { + redisConfigs_ = com.google.protobuf.MapField.newMapField( + RedisConfigsDefaultEntryHolder.defaultEntry); + } + if (!redisConfigs_.isMutable()) { + redisConfigs_ = redisConfigs_.copy(); + } + return redisConfigs_; + } + + public int getRedisConfigsCount() { + return internalGetRedisConfigs().getMap().size(); + } + /** + *
+     * Optional. Redis configuration parameters, according to
+     * http://redis.io/topics/config. Currently, the only supported parameters
+     * are:
+     *  *   maxmemory-policy
+     *  *   notify-keyspace-events
+     * 
+ * + * map<string, string> redis_configs = 16; + */ + + public boolean containsRedisConfigs( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetRedisConfigs().getMap().containsKey(key); + } + /** + * Use {@link #getRedisConfigsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getRedisConfigs() { + return getRedisConfigsMap(); + } + /** + *
+     * Optional. Redis configuration parameters, according to
+     * http://redis.io/topics/config. Currently, the only supported parameters
+     * are:
+     *  *   maxmemory-policy
+     *  *   notify-keyspace-events
+     * 
+ * + * map<string, string> redis_configs = 16; + */ + + public java.util.Map getRedisConfigsMap() { + return internalGetRedisConfigs().getMap(); + } + /** + *
+     * Optional. Redis configuration parameters, according to
+     * http://redis.io/topics/config. Currently, the only supported parameters
+     * are:
+     *  *   maxmemory-policy
+     *  *   notify-keyspace-events
+     * 
+ * + * map<string, string> redis_configs = 16; + */ + + public java.lang.String getRedisConfigsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetRedisConfigs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Optional. Redis configuration parameters, according to
+     * http://redis.io/topics/config. Currently, the only supported parameters
+     * are:
+     *  *   maxmemory-policy
+     *  *   notify-keyspace-events
+     * 
+ * + * map<string, string> redis_configs = 16; + */ + + public java.lang.String getRedisConfigsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetRedisConfigs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearRedisConfigs() { + internalGetMutableRedisConfigs().getMutableMap() + .clear(); + return this; + } + /** + *
+     * Optional. Redis configuration parameters, according to
+     * http://redis.io/topics/config. Currently, the only supported parameters
+     * are:
+     *  *   maxmemory-policy
+     *  *   notify-keyspace-events
+     * 
+ * + * map<string, string> redis_configs = 16; + */ + + public Builder removeRedisConfigs( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableRedisConfigs().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableRedisConfigs() { + return internalGetMutableRedisConfigs().getMutableMap(); + } + /** + *
+     * Optional. Redis configuration parameters, according to
+     * http://redis.io/topics/config. Currently, the only supported parameters
+     * are:
+     *  *   maxmemory-policy
+     *  *   notify-keyspace-events
+     * 
+ * + * map<string, string> redis_configs = 16; + */ + public Builder putRedisConfigs( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableRedisConfigs().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * Optional. Redis configuration parameters, according to
+     * http://redis.io/topics/config. Currently, the only supported parameters
+     * are:
+     *  *   maxmemory-policy
+     *  *   notify-keyspace-events
+     * 
+ * + * map<string, string> redis_configs = 16; + */ + + public Builder putAllRedisConfigs( + java.util.Map values) { + internalGetMutableRedisConfigs().getMutableMap() + .putAll(values); + return this; + } + + private int tier_ = 0; + /** + *
+     * Required. The service tier of the instance.
+     * 
+ * + * .google.cloud.redis.v1.Instance.Tier tier = 17; + */ + public int getTierValue() { + return tier_; + } + /** + *
+     * Required. The service tier of the instance.
+     * 
+ * + * .google.cloud.redis.v1.Instance.Tier tier = 17; + */ + public Builder setTierValue(int value) { + tier_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The service tier of the instance.
+     * 
+ * + * .google.cloud.redis.v1.Instance.Tier tier = 17; + */ + public com.google.cloud.redis.v1.Instance.Tier getTier() { + @SuppressWarnings("deprecation") + com.google.cloud.redis.v1.Instance.Tier result = com.google.cloud.redis.v1.Instance.Tier.valueOf(tier_); + return result == null ? com.google.cloud.redis.v1.Instance.Tier.UNRECOGNIZED : result; + } + /** + *
+     * Required. The service tier of the instance.
+     * 
+ * + * .google.cloud.redis.v1.Instance.Tier tier = 17; + */ + public Builder setTier(com.google.cloud.redis.v1.Instance.Tier value) { + if (value == null) { + throw new NullPointerException(); + } + + tier_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Required. The service tier of the instance.
+     * 
+ * + * .google.cloud.redis.v1.Instance.Tier tier = 17; + */ + public Builder clearTier() { + + tier_ = 0; + onChanged(); + return this; + } + + private int memorySizeGb_ ; + /** + *
+     * Required. Redis memory size in GiB.
+     * 
+ * + * int32 memory_size_gb = 18; + */ + public int getMemorySizeGb() { + return memorySizeGb_; + } + /** + *
+     * Required. Redis memory size in GiB.
+     * 
+ * + * int32 memory_size_gb = 18; + */ + public Builder setMemorySizeGb(int value) { + + memorySizeGb_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. Redis memory size in GiB.
+     * 
+ * + * int32 memory_size_gb = 18; + */ + public Builder clearMemorySizeGb() { + + memorySizeGb_ = 0; + onChanged(); + return this; + } + + private java.lang.Object authorizedNetwork_ = ""; + /** + *
+     * Optional. The full name of the Google Compute Engine
+     * [network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected. If left unspecified, the `default` network
+     * will be used.
+     * 
+ * + * string authorized_network = 20; + */ + public java.lang.String getAuthorizedNetwork() { + java.lang.Object ref = authorizedNetwork_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + authorizedNetwork_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. The full name of the Google Compute Engine
+     * [network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected. If left unspecified, the `default` network
+     * will be used.
+     * 
+ * + * string authorized_network = 20; + */ + public com.google.protobuf.ByteString + getAuthorizedNetworkBytes() { + java.lang.Object ref = authorizedNetwork_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + authorizedNetwork_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. The full name of the Google Compute Engine
+     * [network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected. If left unspecified, the `default` network
+     * will be used.
+     * 
+ * + * string authorized_network = 20; + */ + public Builder setAuthorizedNetwork( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + authorizedNetwork_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The full name of the Google Compute Engine
+     * [network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected. If left unspecified, the `default` network
+     * will be used.
+     * 
+ * + * string authorized_network = 20; + */ + public Builder clearAuthorizedNetwork() { + + authorizedNetwork_ = getDefaultInstance().getAuthorizedNetwork(); + onChanged(); + return this; + } + /** + *
+     * Optional. The full name of the Google Compute Engine
+     * [network](/compute/docs/networks-and-firewalls#networks) to which the
+     * instance is connected. If left unspecified, the `default` network
+     * will be used.
+     * 
+ * + * string authorized_network = 20; + */ + public Builder setAuthorizedNetworkBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + authorizedNetwork_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.redis.v1.Instance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.v1.Instance) + private static final com.google.cloud.redis.v1.Instance DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.v1.Instance(); + } + + public static com.google.cloud.redis.v1.Instance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Instance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Instance(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.redis.v1.Instance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/InstanceName.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/InstanceName.java new file mode 100644 index 000000000000..fd8383bd1326 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/InstanceName.java @@ -0,0 +1,212 @@ +/* + * Copyright 2018 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 + * + * http://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. + */ + +package com.google.cloud.redis.v1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class InstanceName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/instances/{instance}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + private final String instance; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public static InstanceName of(String project, String location, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setInstance(instance) + .build(); + } + + public static String format(String project, String location, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setInstance(instance) + .build() + .toString(); + } + + public static InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "InstanceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("instance")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (InstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldMapBuilder.put("instance", instance); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location, "instance", instance); + } + + /** Builder for InstanceName. */ + public static class Builder { + + private String project; + private String location; + private String instance; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder() { + } + + private Builder(InstanceName instanceName) { + project = instanceName.project; + location = instanceName.location; + instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof InstanceName) { + InstanceName that = (InstanceName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)) + && (this.instance.equals(that.instance)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + h *= 1000003; + h ^= instance.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/InstanceOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/InstanceOrBuilder.java new file mode 100644 index 000000000000..13c091496f92 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/InstanceOrBuilder.java @@ -0,0 +1,450 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +public interface InstanceOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.v1.Instance) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. Unique name of the resource in this scope including project and
+   * location using the form:
+   *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * Note: Redis instances are managed and addressed at regional level so
+   * location_id here refers to a GCP region; however, users may choose which
+   * specific zone (or collection of zones for cross-zone instances) an instance
+   * should be provisioned in. Refer to [location_id] and
+   * [alternative_location_id] fields for more details.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Required. Unique name of the resource in this scope including project and
+   * location using the form:
+   *     `projects/{project_id}/locations/{location_id}/instances/{instance_id}`
+   * Note: Redis instances are managed and addressed at regional level so
+   * location_id here refers to a GCP region; however, users may choose which
+   * specific zone (or collection of zones for cross-zone instances) an instance
+   * should be provisioned in. Refer to [location_id] and
+   * [alternative_location_id] fields for more details.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * An arbitrary and optional user-provided name for the instance.
+   * 
+ * + * string display_name = 2; + */ + java.lang.String getDisplayName(); + /** + *
+   * An arbitrary and optional user-provided name for the instance.
+   * 
+ * + * string display_name = 2; + */ + com.google.protobuf.ByteString + getDisplayNameBytes(); + + /** + *
+   * Resource labels to represent user provided metadata
+   * 
+ * + * map<string, string> labels = 3; + */ + int getLabelsCount(); + /** + *
+   * Resource labels to represent user provided metadata
+   * 
+ * + * map<string, string> labels = 3; + */ + boolean containsLabels( + java.lang.String key); + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getLabels(); + /** + *
+   * Resource labels to represent user provided metadata
+   * 
+ * + * map<string, string> labels = 3; + */ + java.util.Map + getLabelsMap(); + /** + *
+   * Resource labels to represent user provided metadata
+   * 
+ * + * map<string, string> labels = 3; + */ + + java.lang.String getLabelsOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+   * Resource labels to represent user provided metadata
+   * 
+ * + * map<string, string> labels = 3; + */ + + java.lang.String getLabelsOrThrow( + java.lang.String key); + + /** + *
+   * Optional. The zone where the instance will be provisioned. If not provided,
+   * the service will choose a zone for the instance. For STANDARD_HA tier,
+   * instances will be created across two zones for protection against zonal
+   * failures. If [alternative_location_id] is also provided, it must be
+   * different from [location_id].
+   * 
+ * + * string location_id = 4; + */ + java.lang.String getLocationId(); + /** + *
+   * Optional. The zone where the instance will be provisioned. If not provided,
+   * the service will choose a zone for the instance. For STANDARD_HA tier,
+   * instances will be created across two zones for protection against zonal
+   * failures. If [alternative_location_id] is also provided, it must be
+   * different from [location_id].
+   * 
+ * + * string location_id = 4; + */ + com.google.protobuf.ByteString + getLocationIdBytes(); + + /** + *
+   * Optional. Only applicable to STANDARD_HA tier which protects the instance
+   * against zonal failures by provisioning it across two zones. If provided, it
+   * must be a different zone from the one provided in [location_id].
+   * 
+ * + * string alternative_location_id = 5; + */ + java.lang.String getAlternativeLocationId(); + /** + *
+   * Optional. Only applicable to STANDARD_HA tier which protects the instance
+   * against zonal failures by provisioning it across two zones. If provided, it
+   * must be a different zone from the one provided in [location_id].
+   * 
+ * + * string alternative_location_id = 5; + */ + com.google.protobuf.ByteString + getAlternativeLocationIdBytes(); + + /** + *
+   * Optional. The version of Redis software.
+   * If not provided, latest supported version will be used. Updating the
+   * version will perform an upgrade/downgrade to the new version. Currently,
+   * the supported values are `REDIS_3_2` for Redis 3.2.
+   * 
+ * + * string redis_version = 7; + */ + java.lang.String getRedisVersion(); + /** + *
+   * Optional. The version of Redis software.
+   * If not provided, latest supported version will be used. Updating the
+   * version will perform an upgrade/downgrade to the new version. Currently,
+   * the supported values are `REDIS_3_2` for Redis 3.2.
+   * 
+ * + * string redis_version = 7; + */ + com.google.protobuf.ByteString + getRedisVersionBytes(); + + /** + *
+   * Optional. The CIDR range of internal addresses that are reserved for this
+   * instance. If not provided, the service will choose an unused /29 block,
+   * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
+   * and non-overlapping with existing subnets in an authorized network.
+   * 
+ * + * string reserved_ip_range = 9; + */ + java.lang.String getReservedIpRange(); + /** + *
+   * Optional. The CIDR range of internal addresses that are reserved for this
+   * instance. If not provided, the service will choose an unused /29 block,
+   * for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique
+   * and non-overlapping with existing subnets in an authorized network.
+   * 
+ * + * string reserved_ip_range = 9; + */ + com.google.protobuf.ByteString + getReservedIpRangeBytes(); + + /** + *
+   * Output only. Hostname or IP address of the exposed Redis endpoint used by
+   * clients to connect to the service.
+   * 
+ * + * string host = 10; + */ + java.lang.String getHost(); + /** + *
+   * Output only. Hostname or IP address of the exposed Redis endpoint used by
+   * clients to connect to the service.
+   * 
+ * + * string host = 10; + */ + com.google.protobuf.ByteString + getHostBytes(); + + /** + *
+   * Output only. The port number of the exposed Redis endpoint.
+   * 
+ * + * int32 port = 11; + */ + int getPort(); + + /** + *
+   * Output only. The current zone where the Redis endpoint is placed. For Basic
+   * Tier instances, this will always be the same as the [location_id]
+   * provided by the user at creation time. For Standard Tier instances,
+   * this can be either [location_id] or [alternative_location_id] and can
+   * change after a failover event.
+   * 
+ * + * string current_location_id = 12; + */ + java.lang.String getCurrentLocationId(); + /** + *
+   * Output only. The current zone where the Redis endpoint is placed. For Basic
+   * Tier instances, this will always be the same as the [location_id]
+   * provided by the user at creation time. For Standard Tier instances,
+   * this can be either [location_id] or [alternative_location_id] and can
+   * change after a failover event.
+   * 
+ * + * string current_location_id = 12; + */ + com.google.protobuf.ByteString + getCurrentLocationIdBytes(); + + /** + *
+   * Output only. The time the instance was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + boolean hasCreateTime(); + /** + *
+   * Output only. The time the instance was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * Output only. The time the instance was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 13; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * Output only. The current state of this instance.
+   * 
+ * + * .google.cloud.redis.v1.Instance.State state = 14; + */ + int getStateValue(); + /** + *
+   * Output only. The current state of this instance.
+   * 
+ * + * .google.cloud.redis.v1.Instance.State state = 14; + */ + com.google.cloud.redis.v1.Instance.State getState(); + + /** + *
+   * Output only. Additional information about the current status of this
+   * instance, if available.
+   * 
+ * + * string status_message = 15; + */ + java.lang.String getStatusMessage(); + /** + *
+   * Output only. Additional information about the current status of this
+   * instance, if available.
+   * 
+ * + * string status_message = 15; + */ + com.google.protobuf.ByteString + getStatusMessageBytes(); + + /** + *
+   * Optional. Redis configuration parameters, according to
+   * http://redis.io/topics/config. Currently, the only supported parameters
+   * are:
+   *  *   maxmemory-policy
+   *  *   notify-keyspace-events
+   * 
+ * + * map<string, string> redis_configs = 16; + */ + int getRedisConfigsCount(); + /** + *
+   * Optional. Redis configuration parameters, according to
+   * http://redis.io/topics/config. Currently, the only supported parameters
+   * are:
+   *  *   maxmemory-policy
+   *  *   notify-keyspace-events
+   * 
+ * + * map<string, string> redis_configs = 16; + */ + boolean containsRedisConfigs( + java.lang.String key); + /** + * Use {@link #getRedisConfigsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getRedisConfigs(); + /** + *
+   * Optional. Redis configuration parameters, according to
+   * http://redis.io/topics/config. Currently, the only supported parameters
+   * are:
+   *  *   maxmemory-policy
+   *  *   notify-keyspace-events
+   * 
+ * + * map<string, string> redis_configs = 16; + */ + java.util.Map + getRedisConfigsMap(); + /** + *
+   * Optional. Redis configuration parameters, according to
+   * http://redis.io/topics/config. Currently, the only supported parameters
+   * are:
+   *  *   maxmemory-policy
+   *  *   notify-keyspace-events
+   * 
+ * + * map<string, string> redis_configs = 16; + */ + + java.lang.String getRedisConfigsOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+   * Optional. Redis configuration parameters, according to
+   * http://redis.io/topics/config. Currently, the only supported parameters
+   * are:
+   *  *   maxmemory-policy
+   *  *   notify-keyspace-events
+   * 
+ * + * map<string, string> redis_configs = 16; + */ + + java.lang.String getRedisConfigsOrThrow( + java.lang.String key); + + /** + *
+   * Required. The service tier of the instance.
+   * 
+ * + * .google.cloud.redis.v1.Instance.Tier tier = 17; + */ + int getTierValue(); + /** + *
+   * Required. The service tier of the instance.
+   * 
+ * + * .google.cloud.redis.v1.Instance.Tier tier = 17; + */ + com.google.cloud.redis.v1.Instance.Tier getTier(); + + /** + *
+   * Required. Redis memory size in GiB.
+   * 
+ * + * int32 memory_size_gb = 18; + */ + int getMemorySizeGb(); + + /** + *
+   * Optional. The full name of the Google Compute Engine
+   * [network](/compute/docs/networks-and-firewalls#networks) to which the
+   * instance is connected. If left unspecified, the `default` network
+   * will be used.
+   * 
+ * + * string authorized_network = 20; + */ + java.lang.String getAuthorizedNetwork(); + /** + *
+   * Optional. The full name of the Google Compute Engine
+   * [network](/compute/docs/networks-and-firewalls#networks) to which the
+   * instance is connected. If left unspecified, the `default` network
+   * will be used.
+   * 
+ * + * string authorized_network = 20; + */ + com.google.protobuf.ByteString + getAuthorizedNetworkBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesRequest.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesRequest.java new file mode 100644 index 000000000000..d7be57b6b1d3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesRequest.java @@ -0,0 +1,847 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +/** + *
+ * Request for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.v1.ListInstancesRequest} + */ +public final class ListInstancesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.v1.ListInstancesRequest) + ListInstancesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListInstancesRequest.newBuilder() to construct. + private ListInstancesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListInstancesRequest() { + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListInstancesRequest( + 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(); + + parent_ = s; + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.ListInstancesRequest.class, com.google.cloud.redis.v1.ListInstancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * Required. The resource name of the instance location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + 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(); + parent_ = s; + return s; + } + } + /** + *
+   * Required. The resource name of the instance location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + *
+   * The maximum number of items to return.
+   * If not specified, a default value of 1000 will be used by the service.
+   * Regardless of the page_size value, the response may include a partial list
+   * and a caller should only rely on response's
+   * [next_page_token][CloudRedis.ListInstancesResponse.next_page_token]
+   * to determine if there are more instances left to be queried.
+   * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + *
+   * The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + *
+   * The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + 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.redis.v1.ListInstancesRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.v1.ListInstancesRequest other = (com.google.cloud.redis.v1.ListInstancesRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.v1.ListInstancesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.ListInstancesRequest 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.redis.v1.ListInstancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.ListInstancesRequest 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.redis.v1.ListInstancesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.ListInstancesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.redis.v1.ListInstancesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.ListInstancesRequest 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.redis.v1.ListInstancesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.ListInstancesRequest 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.redis.v1.ListInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.ListInstancesRequest 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.redis.v1.ListInstancesRequest 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 for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.v1.ListInstancesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.v1.ListInstancesRequest) + com.google.cloud.redis.v1.ListInstancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.ListInstancesRequest.class, com.google.cloud.redis.v1.ListInstancesRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.v1.ListInstancesRequest.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(); + parent_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.v1.ListInstancesRequest getDefaultInstanceForType() { + return com.google.cloud.redis.v1.ListInstancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.v1.ListInstancesRequest build() { + com.google.cloud.redis.v1.ListInstancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.v1.ListInstancesRequest buildPartial() { + com.google.cloud.redis.v1.ListInstancesRequest result = new com.google.cloud.redis.v1.ListInstancesRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.v1.ListInstancesRequest) { + return mergeFrom((com.google.cloud.redis.v1.ListInstancesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.v1.ListInstancesRequest other) { + if (other == com.google.cloud.redis.v1.ListInstancesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + 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.redis.v1.ListInstancesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.redis.v1.ListInstancesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * Required. The resource name of the instance location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. The resource name of the instance location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. The resource name of the instance location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the instance location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * Required. The resource name of the instance location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * The maximum number of items to return.
+     * If not specified, a default value of 1000 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [next_page_token][CloudRedis.ListInstancesResponse.next_page_token]
+     * to determine if there are more instances left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The maximum number of items to return.
+     * If not specified, a default value of 1000 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [next_page_token][CloudRedis.ListInstancesResponse.next_page_token]
+     * to determine if there are more instances left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The maximum number of items to return.
+     * If not specified, a default value of 1000 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [next_page_token][CloudRedis.ListInstancesResponse.next_page_token]
+     * to determine if there are more instances left to be queried.
+     * 
+ * + * int32 page_size = 2; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next_page_token value returned from a previous List request,
+     * if any.
+     * 
+ * + * string page_token = 3; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.redis.v1.ListInstancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.v1.ListInstancesRequest) + private static final com.google.cloud.redis.v1.ListInstancesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.v1.ListInstancesRequest(); + } + + public static com.google.cloud.redis.v1.ListInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListInstancesRequest(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.redis.v1.ListInstancesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesRequestOrBuilder.java new file mode 100644 index 000000000000..dfe9d0579680 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesRequestOrBuilder.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +public interface ListInstancesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.v1.ListInstancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. The resource name of the instance location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * Required. The resource name of the instance location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The maximum number of items to return.
+   * If not specified, a default value of 1000 will be used by the service.
+   * Regardless of the page_size value, the response may include a partial list
+   * and a caller should only rely on response's
+   * [next_page_token][CloudRedis.ListInstancesResponse.next_page_token]
+   * to determine if there are more instances left to be queried.
+   * 
+ * + * int32 page_size = 2; + */ + int getPageSize(); + + /** + *
+   * The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + java.lang.String getPageToken(); + /** + *
+   * The next_page_token value returned from a previous List request,
+   * if any.
+   * 
+ * + * string page_token = 3; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesResponse.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesResponse.java new file mode 100644 index 000000000000..7c210959a23f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesResponse.java @@ -0,0 +1,1208 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +/** + *
+ * Response for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.v1.ListInstancesResponse} + */ +public final class ListInstancesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.v1.ListInstancesResponse) + ListInstancesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListInstancesResponse.newBuilder() to construct. + private ListInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListInstancesResponse() { + instances_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListInstancesResponse( + 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: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + instances_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + instances_.add( + input.readMessage(com.google.cloud.redis.v1.Instance.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.ListInstancesResponse.class, com.google.cloud.redis.v1.ListInstancesResponse.Builder.class); + } + + private int bitField0_; + public static final int INSTANCES_FIELD_NUMBER = 1; + private java.util.List instances_; + /** + *
+   * A list of Redis instances in the project in the specified location,
+   * or across all locations.
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a dummy Redis
+   * entry is included in the response with the "name" field set to a value of
+   * the form projects/{project_id}/locations/{location_id}/instances/- and the
+   * "status" field set to ERROR and "status_message" field set to "location not
+   * available for ListInstances".
+   * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public java.util.List getInstancesList() { + return instances_; + } + /** + *
+   * A list of Redis instances in the project in the specified location,
+   * or across all locations.
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a dummy Redis
+   * entry is included in the response with the "name" field set to a value of
+   * the form projects/{project_id}/locations/{location_id}/instances/- and the
+   * "status" field set to ERROR and "status_message" field set to "location not
+   * available for ListInstances".
+   * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + return instances_; + } + /** + *
+   * A list of Redis instances in the project in the specified location,
+   * or across all locations.
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a dummy Redis
+   * entry is included in the response with the "name" field set to a value of
+   * the form projects/{project_id}/locations/{location_id}/instances/- and the
+   * "status" field set to ERROR and "status_message" field set to "location not
+   * available for ListInstances".
+   * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public int getInstancesCount() { + return instances_.size(); + } + /** + *
+   * A list of Redis instances in the project in the specified location,
+   * or across all locations.
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a dummy Redis
+   * entry is included in the response with the "name" field set to a value of
+   * the form projects/{project_id}/locations/{location_id}/instances/- and the
+   * "status" field set to ERROR and "status_message" field set to "location not
+   * available for ListInstances".
+   * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public com.google.cloud.redis.v1.Instance getInstances(int index) { + return instances_.get(index); + } + /** + *
+   * A list of Redis instances in the project in the specified location,
+   * or across all locations.
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a dummy Redis
+   * entry is included in the response with the "name" field set to a value of
+   * the form projects/{project_id}/locations/{location_id}/instances/- and the
+   * "status" field set to ERROR and "status_message" field set to "location not
+   * available for ListInstances".
+   * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public com.google.cloud.redis.v1.InstanceOrBuilder getInstancesOrBuilder( + int index) { + return instances_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 { + for (int i = 0; i < instances_.size(); i++) { + output.writeMessage(1, instances_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, instances_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + 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.redis.v1.ListInstancesResponse)) { + return super.equals(obj); + } + com.google.cloud.redis.v1.ListInstancesResponse other = (com.google.cloud.redis.v1.ListInstancesResponse) obj; + + boolean result = true; + result = result && getInstancesList() + .equals(other.getInstancesList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.v1.ListInstancesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.ListInstancesResponse 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.redis.v1.ListInstancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.ListInstancesResponse 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.redis.v1.ListInstancesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.ListInstancesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.redis.v1.ListInstancesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.ListInstancesResponse 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.redis.v1.ListInstancesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.ListInstancesResponse 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.redis.v1.ListInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.ListInstancesResponse 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.redis.v1.ListInstancesResponse 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 for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.v1.ListInstancesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.v1.ListInstancesResponse) + com.google.cloud.redis.v1.ListInstancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.ListInstancesResponse.class, com.google.cloud.redis.v1.ListInstancesResponse.Builder.class); + } + + // Construct using com.google.cloud.redis.v1.ListInstancesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getInstancesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + instancesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.v1.ListInstancesResponse getDefaultInstanceForType() { + return com.google.cloud.redis.v1.ListInstancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.v1.ListInstancesResponse build() { + com.google.cloud.redis.v1.ListInstancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.v1.ListInstancesResponse buildPartial() { + com.google.cloud.redis.v1.ListInstancesResponse result = new com.google.cloud.redis.v1.ListInstancesResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.v1.ListInstancesResponse) { + return mergeFrom((com.google.cloud.redis.v1.ListInstancesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.v1.ListInstancesResponse other) { + if (other == com.google.cloud.redis.v1.ListInstancesResponse.getDefaultInstance()) return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getInstancesFieldBuilder() : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + 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.redis.v1.ListInstancesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.redis.v1.ListInstancesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List instances_ = + java.util.Collections.emptyList(); + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.v1.Instance, com.google.cloud.redis.v1.Instance.Builder, com.google.cloud.redis.v1.InstanceOrBuilder> instancesBuilder_; + + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public com.google.cloud.redis.v1.Instance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.cloud.redis.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.cloud.redis.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.redis.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.cloud.redis.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public Builder addInstances( + com.google.cloud.redis.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.cloud.redis.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public Builder addAllInstances( + java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public com.google.cloud.redis.v1.Instance.Builder getInstancesBuilder( + int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public com.google.cloud.redis.v1.InstanceOrBuilder getInstancesOrBuilder( + int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public com.google.cloud.redis.v1.Instance.Builder addInstancesBuilder() { + return getInstancesFieldBuilder().addBuilder( + com.google.cloud.redis.v1.Instance.getDefaultInstance()); + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public com.google.cloud.redis.v1.Instance.Builder addInstancesBuilder( + int index) { + return getInstancesFieldBuilder().addBuilder( + index, com.google.cloud.redis.v1.Instance.getDefaultInstance()); + } + /** + *
+     * A list of Redis instances in the project in the specified location,
+     * or across all locations.
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a dummy Redis
+     * entry is included in the response with the "name" field set to a value of
+     * the form projects/{project_id}/locations/{location_id}/instances/- and the
+     * "status" field set to ERROR and "status_message" field set to "location not
+     * available for ListInstances".
+     * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + public java.util.List + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.v1.Instance, com.google.cloud.redis.v1.Instance.Builder, com.google.cloud.redis.v1.InstanceOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.v1.Instance, com.google.cloud.redis.v1.Instance.Builder, com.google.cloud.redis.v1.InstanceOrBuilder>( + instances_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.redis.v1.ListInstancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.v1.ListInstancesResponse) + private static final com.google.cloud.redis.v1.ListInstancesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.v1.ListInstancesResponse(); + } + + public static com.google.cloud.redis.v1.ListInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListInstancesResponse(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.redis.v1.ListInstancesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesResponseOrBuilder.java new file mode 100644 index 000000000000..f910d3c361e3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ListInstancesResponseOrBuilder.java @@ -0,0 +1,113 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +public interface ListInstancesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.v1.ListInstancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A list of Redis instances in the project in the specified location,
+   * or across all locations.
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a dummy Redis
+   * entry is included in the response with the "name" field set to a value of
+   * the form projects/{project_id}/locations/{location_id}/instances/- and the
+   * "status" field set to ERROR and "status_message" field set to "location not
+   * available for ListInstances".
+   * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + java.util.List + getInstancesList(); + /** + *
+   * A list of Redis instances in the project in the specified location,
+   * or across all locations.
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a dummy Redis
+   * entry is included in the response with the "name" field set to a value of
+   * the form projects/{project_id}/locations/{location_id}/instances/- and the
+   * "status" field set to ERROR and "status_message" field set to "location not
+   * available for ListInstances".
+   * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + com.google.cloud.redis.v1.Instance getInstances(int index); + /** + *
+   * A list of Redis instances in the project in the specified location,
+   * or across all locations.
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a dummy Redis
+   * entry is included in the response with the "name" field set to a value of
+   * the form projects/{project_id}/locations/{location_id}/instances/- and the
+   * "status" field set to ERROR and "status_message" field set to "location not
+   * available for ListInstances".
+   * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + int getInstancesCount(); + /** + *
+   * A list of Redis instances in the project in the specified location,
+   * or across all locations.
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a dummy Redis
+   * entry is included in the response with the "name" field set to a value of
+   * the form projects/{project_id}/locations/{location_id}/instances/- and the
+   * "status" field set to ERROR and "status_message" field set to "location not
+   * available for ListInstances".
+   * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + java.util.List + getInstancesOrBuilderList(); + /** + *
+   * A list of Redis instances in the project in the specified location,
+   * or across all locations.
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a dummy Redis
+   * entry is included in the response with the "name" field set to a value of
+   * the form projects/{project_id}/locations/{location_id}/instances/- and the
+   * "status" field set to ERROR and "status_message" field set to "location not
+   * available for ListInstances".
+   * 
+ * + * repeated .google.cloud.redis.v1.Instance instances = 1; + */ + com.google.cloud.redis.v1.InstanceOrBuilder getInstancesOrBuilder( + int index); + + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/LocationMetadata.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/LocationMetadata.java new file mode 100644 index 000000000000..ed2d4b306a44 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/LocationMetadata.java @@ -0,0 +1,780 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +/** + *
+ * This location metadata represents additional configuration options for a
+ * given location where a Redis instance may be created. All fields are output
+ * only. It is returned as content of the
+ * `google.cloud.location.Location.metadata` field.
+ * 
+ * + * Protobuf type {@code google.cloud.redis.v1.LocationMetadata} + */ +public final class LocationMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.v1.LocationMetadata) + LocationMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use LocationMetadata.newBuilder() to construct. + private LocationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LocationMetadata() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LocationMetadata( + 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: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + availableZones_ = com.google.protobuf.MapField.newMapField( + AvailableZonesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + availableZones__ = input.readMessage( + AvailableZonesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + availableZones_.getMutableMap().put( + availableZones__.getKey(), availableZones__.getValue()); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_LocationMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetAvailableZones(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_LocationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.LocationMetadata.class, com.google.cloud.redis.v1.LocationMetadata.Builder.class); + } + + public static final int AVAILABLE_ZONES_FIELD_NUMBER = 1; + private static final class AvailableZonesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, com.google.cloud.redis.v1.ZoneMetadata> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_LocationMetadata_AvailableZonesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + com.google.cloud.redis.v1.ZoneMetadata.getDefaultInstance()); + } + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.redis.v1.ZoneMetadata> availableZones_; + private com.google.protobuf.MapField + internalGetAvailableZones() { + if (availableZones_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AvailableZonesDefaultEntryHolder.defaultEntry); + } + return availableZones_; + } + + public int getAvailableZonesCount() { + return internalGetAvailableZones().getMap().size(); + } + /** + *
+   * Output only. The set of available zones in the location. The map is keyed
+   * by the lowercase ID of each zone, as defined by GCE. These keys can be
+   * specified in `location_id` or `alternative_location_id` fields when
+   * creating a Redis instance.
+   * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + + public boolean containsAvailableZones( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetAvailableZones().getMap().containsKey(key); + } + /** + * Use {@link #getAvailableZonesMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getAvailableZones() { + return getAvailableZonesMap(); + } + /** + *
+   * Output only. The set of available zones in the location. The map is keyed
+   * by the lowercase ID of each zone, as defined by GCE. These keys can be
+   * specified in `location_id` or `alternative_location_id` fields when
+   * creating a Redis instance.
+   * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + + public java.util.Map getAvailableZonesMap() { + return internalGetAvailableZones().getMap(); + } + /** + *
+   * Output only. The set of available zones in the location. The map is keyed
+   * by the lowercase ID of each zone, as defined by GCE. These keys can be
+   * specified in `location_id` or `alternative_location_id` fields when
+   * creating a Redis instance.
+   * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + + public com.google.cloud.redis.v1.ZoneMetadata getAvailableZonesOrDefault( + java.lang.String key, + com.google.cloud.redis.v1.ZoneMetadata defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAvailableZones().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * Output only. The set of available zones in the location. The map is keyed
+   * by the lowercase ID of each zone, as defined by GCE. These keys can be
+   * specified in `location_id` or `alternative_location_id` fields when
+   * creating a Redis instance.
+   * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + + public com.google.cloud.redis.v1.ZoneMetadata getAvailableZonesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAvailableZones().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 { + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetAvailableZones(), + AvailableZonesDefaultEntryHolder.defaultEntry, + 1); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetAvailableZones().getMap().entrySet()) { + com.google.protobuf.MapEntry + availableZones__ = AvailableZonesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, availableZones__); + } + 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.redis.v1.LocationMetadata)) { + return super.equals(obj); + } + com.google.cloud.redis.v1.LocationMetadata other = (com.google.cloud.redis.v1.LocationMetadata) obj; + + boolean result = true; + result = result && internalGetAvailableZones().equals( + other.internalGetAvailableZones()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetAvailableZones().getMap().isEmpty()) { + hash = (37 * hash) + AVAILABLE_ZONES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAvailableZones().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.v1.LocationMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.LocationMetadata 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.redis.v1.LocationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.LocationMetadata 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.redis.v1.LocationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.LocationMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.redis.v1.LocationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.LocationMetadata 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.redis.v1.LocationMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.LocationMetadata 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.redis.v1.LocationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.LocationMetadata 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.redis.v1.LocationMetadata 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; + } + /** + *
+   * This location metadata represents additional configuration options for a
+   * given location where a Redis instance may be created. All fields are output
+   * only. It is returned as content of the
+   * `google.cloud.location.Location.metadata` field.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.v1.LocationMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.v1.LocationMetadata) + com.google.cloud.redis.v1.LocationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_LocationMetadata_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetAvailableZones(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableAvailableZones(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_LocationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.LocationMetadata.class, com.google.cloud.redis.v1.LocationMetadata.Builder.class); + } + + // Construct using com.google.cloud.redis.v1.LocationMetadata.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(); + internalGetMutableAvailableZones().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_LocationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.v1.LocationMetadata getDefaultInstanceForType() { + return com.google.cloud.redis.v1.LocationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.v1.LocationMetadata build() { + com.google.cloud.redis.v1.LocationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.v1.LocationMetadata buildPartial() { + com.google.cloud.redis.v1.LocationMetadata result = new com.google.cloud.redis.v1.LocationMetadata(this); + int from_bitField0_ = bitField0_; + result.availableZones_ = internalGetAvailableZones(); + result.availableZones_.makeImmutable(); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.v1.LocationMetadata) { + return mergeFrom((com.google.cloud.redis.v1.LocationMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.v1.LocationMetadata other) { + if (other == com.google.cloud.redis.v1.LocationMetadata.getDefaultInstance()) return this; + internalGetMutableAvailableZones().mergeFrom( + other.internalGetAvailableZones()); + 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.redis.v1.LocationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.redis.v1.LocationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, com.google.cloud.redis.v1.ZoneMetadata> availableZones_; + private com.google.protobuf.MapField + internalGetAvailableZones() { + if (availableZones_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AvailableZonesDefaultEntryHolder.defaultEntry); + } + return availableZones_; + } + private com.google.protobuf.MapField + internalGetMutableAvailableZones() { + onChanged();; + if (availableZones_ == null) { + availableZones_ = com.google.protobuf.MapField.newMapField( + AvailableZonesDefaultEntryHolder.defaultEntry); + } + if (!availableZones_.isMutable()) { + availableZones_ = availableZones_.copy(); + } + return availableZones_; + } + + public int getAvailableZonesCount() { + return internalGetAvailableZones().getMap().size(); + } + /** + *
+     * Output only. The set of available zones in the location. The map is keyed
+     * by the lowercase ID of each zone, as defined by GCE. These keys can be
+     * specified in `location_id` or `alternative_location_id` fields when
+     * creating a Redis instance.
+     * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + + public boolean containsAvailableZones( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetAvailableZones().getMap().containsKey(key); + } + /** + * Use {@link #getAvailableZonesMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getAvailableZones() { + return getAvailableZonesMap(); + } + /** + *
+     * Output only. The set of available zones in the location. The map is keyed
+     * by the lowercase ID of each zone, as defined by GCE. These keys can be
+     * specified in `location_id` or `alternative_location_id` fields when
+     * creating a Redis instance.
+     * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + + public java.util.Map getAvailableZonesMap() { + return internalGetAvailableZones().getMap(); + } + /** + *
+     * Output only. The set of available zones in the location. The map is keyed
+     * by the lowercase ID of each zone, as defined by GCE. These keys can be
+     * specified in `location_id` or `alternative_location_id` fields when
+     * creating a Redis instance.
+     * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + + public com.google.cloud.redis.v1.ZoneMetadata getAvailableZonesOrDefault( + java.lang.String key, + com.google.cloud.redis.v1.ZoneMetadata defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAvailableZones().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Output only. The set of available zones in the location. The map is keyed
+     * by the lowercase ID of each zone, as defined by GCE. These keys can be
+     * specified in `location_id` or `alternative_location_id` fields when
+     * creating a Redis instance.
+     * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + + public com.google.cloud.redis.v1.ZoneMetadata getAvailableZonesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetAvailableZones().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAvailableZones() { + internalGetMutableAvailableZones().getMutableMap() + .clear(); + return this; + } + /** + *
+     * Output only. The set of available zones in the location. The map is keyed
+     * by the lowercase ID of each zone, as defined by GCE. These keys can be
+     * specified in `location_id` or `alternative_location_id` fields when
+     * creating a Redis instance.
+     * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + + public Builder removeAvailableZones( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableAvailableZones().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableAvailableZones() { + return internalGetMutableAvailableZones().getMutableMap(); + } + /** + *
+     * Output only. The set of available zones in the location. The map is keyed
+     * by the lowercase ID of each zone, as defined by GCE. These keys can be
+     * specified in `location_id` or `alternative_location_id` fields when
+     * creating a Redis instance.
+     * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + public Builder putAvailableZones( + java.lang.String key, + com.google.cloud.redis.v1.ZoneMetadata value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableAvailableZones().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * Output only. The set of available zones in the location. The map is keyed
+     * by the lowercase ID of each zone, as defined by GCE. These keys can be
+     * specified in `location_id` or `alternative_location_id` fields when
+     * creating a Redis instance.
+     * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + + public Builder putAllAvailableZones( + java.util.Map values) { + internalGetMutableAvailableZones().getMutableMap() + .putAll(values); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.redis.v1.LocationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.v1.LocationMetadata) + private static final com.google.cloud.redis.v1.LocationMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.v1.LocationMetadata(); + } + + public static com.google.cloud.redis.v1.LocationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LocationMetadata(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.redis.v1.LocationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/LocationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/LocationMetadataOrBuilder.java new file mode 100644 index 000000000000..885b4fd2e57c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/LocationMetadataOrBuilder.java @@ -0,0 +1,78 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +public interface LocationMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.v1.LocationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Output only. The set of available zones in the location. The map is keyed
+   * by the lowercase ID of each zone, as defined by GCE. These keys can be
+   * specified in `location_id` or `alternative_location_id` fields when
+   * creating a Redis instance.
+   * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + int getAvailableZonesCount(); + /** + *
+   * Output only. The set of available zones in the location. The map is keyed
+   * by the lowercase ID of each zone, as defined by GCE. These keys can be
+   * specified in `location_id` or `alternative_location_id` fields when
+   * creating a Redis instance.
+   * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + boolean containsAvailableZones( + java.lang.String key); + /** + * Use {@link #getAvailableZonesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getAvailableZones(); + /** + *
+   * Output only. The set of available zones in the location. The map is keyed
+   * by the lowercase ID of each zone, as defined by GCE. These keys can be
+   * specified in `location_id` or `alternative_location_id` fields when
+   * creating a Redis instance.
+   * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + java.util.Map + getAvailableZonesMap(); + /** + *
+   * Output only. The set of available zones in the location. The map is keyed
+   * by the lowercase ID of each zone, as defined by GCE. These keys can be
+   * specified in `location_id` or `alternative_location_id` fields when
+   * creating a Redis instance.
+   * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + + com.google.cloud.redis.v1.ZoneMetadata getAvailableZonesOrDefault( + java.lang.String key, + com.google.cloud.redis.v1.ZoneMetadata defaultValue); + /** + *
+   * Output only. The set of available zones in the location. The map is keyed
+   * by the lowercase ID of each zone, as defined by GCE. These keys can be
+   * specified in `location_id` or `alternative_location_id` fields when
+   * creating a Redis instance.
+   * 
+ * + * map<string, .google.cloud.redis.v1.ZoneMetadata> available_zones = 1; + */ + + com.google.cloud.redis.v1.ZoneMetadata getAvailableZonesOrThrow( + java.lang.String key); +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/LocationName.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/LocationName.java new file mode 100644 index 000000000000..74f8cfaaf1ff --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/LocationName.java @@ -0,0 +1,189 @@ +/* + * Copyright 2018 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 + * + * http://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. + */ + +package com.google.cloud.redis.v1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class LocationName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public static LocationName of(String project, String location) { + return newBuilder() + .setProject(project) + .setLocation(location) + .build(); + } + + public static String format(String project, String location) { + return newBuilder() + .setProject(project) + .setLocation(location) + .build() + .toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("location", location); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "location", location); + } + + /** Builder for LocationName. */ + public static class Builder { + + private String project; + private String location; + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder() { + } + + private Builder(LocationName locationName) { + project = locationName.project; + location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof LocationName) { + LocationName that = (LocationName) o; + return (this.project.equals(that.project)) + && (this.location.equals(that.location)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= location.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadata.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadata.java new file mode 100644 index 000000000000..c619ee9cdbf3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadata.java @@ -0,0 +1,1575 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +/** + *
+ * Represents the v1 metadata of the long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.redis.v1.OperationMetadata} + */ +public final class OperationMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.v1.OperationMetadata) + OperationMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusDetail_ = ""; + cancelRequested_ = false; + apiVersion_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private OperationMetadata( + 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: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + verb_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + statusDetail_ = s; + break; + } + case 48: { + + cancelRequested_ = input.readBool(); + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + apiVersion_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.OperationMetadata.class, com.google.cloud.redis.v1.OperationMetadata.Builder.class); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + *
+   * Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp endTime_; + /** + *
+   * End timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTime_ != null; + } + /** + *
+   * End timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + *
+   * End timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int TARGET_FIELD_NUMBER = 3; + private volatile java.lang.Object target_; + /** + *
+   * Operation target.
+   * 
+ * + * string target = 3; + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + 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(); + target_ = s; + return s; + } + } + /** + *
+   * Operation target.
+   * 
+ * + * string target = 3; + */ + public com.google.protobuf.ByteString + getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERB_FIELD_NUMBER = 4; + private volatile java.lang.Object verb_; + /** + *
+   * Operation verb.
+   * 
+ * + * string verb = 4; + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + 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(); + verb_ = s; + return s; + } + } + /** + *
+   * Operation verb.
+   * 
+ * + * string verb = 4; + */ + public com.google.protobuf.ByteString + getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_DETAIL_FIELD_NUMBER = 5; + private volatile java.lang.Object statusDetail_; + /** + *
+   * Operation status details.
+   * 
+ * + * string status_detail = 5; + */ + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + 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(); + statusDetail_ = s; + return s; + } + } + /** + *
+   * Operation status details.
+   * 
+ * + * string status_detail = 5; + */ + public com.google.protobuf.ByteString + getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CANCEL_REQUESTED_FIELD_NUMBER = 6; + private boolean cancelRequested_; + /** + *
+   * Specifies if cancellation was requested for the operaiton.
+   * 
+ * + * bool cancel_requested = 6; + */ + public boolean getCancelRequested() { + return cancelRequested_; + } + + public static final int API_VERSION_FIELD_NUMBER = 7; + private volatile java.lang.Object apiVersion_; + /** + *
+   * API version.
+   * 
+ * + * string api_version = 7; + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + 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(); + apiVersion_ = s; + return s; + } + } + /** + *
+   * API version.
+   * 
+ * + * string api_version = 7; + */ + public com.google.protobuf.ByteString + getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (createTime_ != null) { + output.writeMessage(1, getCreateTime()); + } + if (endTime_ != null) { + output.writeMessage(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, target_); + } + if (!getVerbBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, verb_); + } + if (!getStatusDetailBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, statusDetail_); + } + if (cancelRequested_ != false) { + output.writeBool(6, cancelRequested_); + } + if (!getApiVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, apiVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getCreateTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getEndTime()); + } + if (!getTargetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, target_); + } + if (!getVerbBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, verb_); + } + if (!getStatusDetailBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, statusDetail_); + } + if (cancelRequested_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(6, cancelRequested_); + } + if (!getApiVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, apiVersion_); + } + 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.redis.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.redis.v1.OperationMetadata other = (com.google.cloud.redis.v1.OperationMetadata) obj; + + boolean result = true; + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && (hasEndTime() == other.hasEndTime()); + if (hasEndTime()) { + result = result && getEndTime() + .equals(other.getEndTime()); + } + result = result && getTarget() + .equals(other.getTarget()); + result = result && getVerb() + .equals(other.getVerb()); + result = result && getStatusDetail() + .equals(other.getStatusDetail()); + result = result && (getCancelRequested() + == other.getCancelRequested()); + result = result && getApiVersion() + .equals(other.getApiVersion()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (37 * hash) + VERB_FIELD_NUMBER; + hash = (53 * hash) + getVerb().hashCode(); + hash = (37 * hash) + STATUS_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getStatusDetail().hashCode(); + hash = (37 * hash) + CANCEL_REQUESTED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getCancelRequested()); + hash = (37 * hash) + API_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getApiVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.OperationMetadata 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.redis.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.OperationMetadata 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.redis.v1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.OperationMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.redis.v1.OperationMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.OperationMetadata 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.redis.v1.OperationMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.OperationMetadata 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.redis.v1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.OperationMetadata 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.redis.v1.OperationMetadata 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; + } + /** + *
+   * Represents the v1 metadata of the long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.v1.OperationMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.v1.OperationMetadata) + com.google.cloud.redis.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.OperationMetadata.class, com.google.cloud.redis.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.redis.v1.OperationMetadata.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(); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + target_ = ""; + + verb_ = ""; + + statusDetail_ = ""; + + cancelRequested_ = false; + + apiVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.redis.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.v1.OperationMetadata build() { + com.google.cloud.redis.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.v1.OperationMetadata buildPartial() { + com.google.cloud.redis.v1.OperationMetadata result = new com.google.cloud.redis.v1.OperationMetadata(this); + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.target_ = target_; + result.verb_ = verb_; + result.statusDetail_ = statusDetail_; + result.cancelRequested_ = cancelRequested_; + result.apiVersion_ = apiVersion_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.redis.v1.OperationMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.v1.OperationMetadata other) { + if (other == com.google.cloud.redis.v1.OperationMetadata.getDefaultInstance()) return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + onChanged(); + } + if (!other.getStatusDetail().isEmpty()) { + statusDetail_ = other.statusDetail_; + onChanged(); + } + if (other.getCancelRequested() != false) { + setCancelRequested(other.getCancelRequested()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + onChanged(); + } + 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.redis.v1.OperationMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.redis.v1.OperationMetadata) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp createTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * Creation timestamp.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * Creation timestamp.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + *
+     * Creation timestamp.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Creation timestamp.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder setCreateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Creation timestamp.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Creation timestamp.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Creation timestamp.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Creation timestamp.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + } + /** + *
+     * Creation timestamp.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), + getParentForChildren(), + isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; + /** + *
+     * End timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + *
+     * End timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + *
+     * End timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * End timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder setEndTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * End timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * End timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * End timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * End timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + *
+     * End timestamp.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getEndTime(), + getParentForChildren(), + isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object target_ = ""; + /** + *
+     * Operation target.
+     * 
+ * + * string target = 3; + */ + public java.lang.String getTarget() { + java.lang.Object ref = target_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Operation target.
+     * 
+ * + * string target = 3; + */ + public com.google.protobuf.ByteString + getTargetBytes() { + java.lang.Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Operation target.
+     * 
+ * + * string target = 3; + */ + public Builder setTarget( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + *
+     * Operation target.
+     * 
+ * + * string target = 3; + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + *
+     * Operation target.
+     * 
+ * + * string target = 3; + */ + public Builder setTargetBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + + private java.lang.Object verb_ = ""; + /** + *
+     * Operation verb.
+     * 
+ * + * string verb = 4; + */ + public java.lang.String getVerb() { + java.lang.Object ref = verb_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + verb_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Operation verb.
+     * 
+ * + * string verb = 4; + */ + public com.google.protobuf.ByteString + getVerbBytes() { + java.lang.Object ref = verb_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + verb_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Operation verb.
+     * 
+ * + * string verb = 4; + */ + public Builder setVerb( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value; + onChanged(); + return this; + } + /** + *
+     * Operation verb.
+     * 
+ * + * string verb = 4; + */ + public Builder clearVerb() { + + verb_ = getDefaultInstance().getVerb(); + onChanged(); + return this; + } + /** + *
+     * Operation verb.
+     * 
+ * + * string verb = 4; + */ + public Builder setVerbBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + verb_ = value; + onChanged(); + return this; + } + + private java.lang.Object statusDetail_ = ""; + /** + *
+     * Operation status details.
+     * 
+ * + * string status_detail = 5; + */ + public java.lang.String getStatusDetail() { + java.lang.Object ref = statusDetail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + statusDetail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Operation status details.
+     * 
+ * + * string status_detail = 5; + */ + public com.google.protobuf.ByteString + getStatusDetailBytes() { + java.lang.Object ref = statusDetail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + statusDetail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Operation status details.
+     * 
+ * + * string status_detail = 5; + */ + public Builder setStatusDetail( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + statusDetail_ = value; + onChanged(); + return this; + } + /** + *
+     * Operation status details.
+     * 
+ * + * string status_detail = 5; + */ + public Builder clearStatusDetail() { + + statusDetail_ = getDefaultInstance().getStatusDetail(); + onChanged(); + return this; + } + /** + *
+     * Operation status details.
+     * 
+ * + * string status_detail = 5; + */ + public Builder setStatusDetailBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + statusDetail_ = value; + onChanged(); + return this; + } + + private boolean cancelRequested_ ; + /** + *
+     * Specifies if cancellation was requested for the operaiton.
+     * 
+ * + * bool cancel_requested = 6; + */ + public boolean getCancelRequested() { + return cancelRequested_; + } + /** + *
+     * Specifies if cancellation was requested for the operaiton.
+     * 
+ * + * bool cancel_requested = 6; + */ + public Builder setCancelRequested(boolean value) { + + cancelRequested_ = value; + onChanged(); + return this; + } + /** + *
+     * Specifies if cancellation was requested for the operaiton.
+     * 
+ * + * bool cancel_requested = 6; + */ + public Builder clearCancelRequested() { + + cancelRequested_ = false; + onChanged(); + return this; + } + + private java.lang.Object apiVersion_ = ""; + /** + *
+     * API version.
+     * 
+ * + * string api_version = 7; + */ + public java.lang.String getApiVersion() { + java.lang.Object ref = apiVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + apiVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * API version.
+     * 
+ * + * string api_version = 7; + */ + public com.google.protobuf.ByteString + getApiVersionBytes() { + java.lang.Object ref = apiVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + apiVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * API version.
+     * 
+ * + * string api_version = 7; + */ + public Builder setApiVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + apiVersion_ = value; + onChanged(); + return this; + } + /** + *
+     * API version.
+     * 
+ * + * string api_version = 7; + */ + public Builder clearApiVersion() { + + apiVersion_ = getDefaultInstance().getApiVersion(); + onChanged(); + return this; + } + /** + *
+     * API version.
+     * 
+ * + * string api_version = 7; + */ + public Builder setApiVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + apiVersion_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.redis.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.v1.OperationMetadata) + private static final com.google.cloud.redis.v1.OperationMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.v1.OperationMetadata(); + } + + public static com.google.cloud.redis.v1.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OperationMetadata(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.redis.v1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..232e762aea2b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,140 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +public interface OperationMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + boolean hasCreateTime(); + /** + *
+   * Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * Creation timestamp.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * End timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + boolean hasEndTime(); + /** + *
+   * End timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.Timestamp getEndTime(); + /** + *
+   * End timestamp.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + *
+   * Operation target.
+   * 
+ * + * string target = 3; + */ + java.lang.String getTarget(); + /** + *
+   * Operation target.
+   * 
+ * + * string target = 3; + */ + com.google.protobuf.ByteString + getTargetBytes(); + + /** + *
+   * Operation verb.
+   * 
+ * + * string verb = 4; + */ + java.lang.String getVerb(); + /** + *
+   * Operation verb.
+   * 
+ * + * string verb = 4; + */ + com.google.protobuf.ByteString + getVerbBytes(); + + /** + *
+   * Operation status details.
+   * 
+ * + * string status_detail = 5; + */ + java.lang.String getStatusDetail(); + /** + *
+   * Operation status details.
+   * 
+ * + * string status_detail = 5; + */ + com.google.protobuf.ByteString + getStatusDetailBytes(); + + /** + *
+   * Specifies if cancellation was requested for the operaiton.
+   * 
+ * + * bool cancel_requested = 6; + */ + boolean getCancelRequested(); + + /** + *
+   * API version.
+   * 
+ * + * string api_version = 7; + */ + java.lang.String getApiVersion(); + /** + *
+   * API version.
+   * 
+ * + * string api_version = 7; + */ + com.google.protobuf.ByteString + getApiVersionBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/UpdateInstanceRequest.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/UpdateInstanceRequest.java new file mode 100644 index 000000000000..bda31b4dd122 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/UpdateInstanceRequest.java @@ -0,0 +1,964 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +/** + *
+ * Request for [UpdateInstance][google.cloud.redis.v1.CloudRedis.UpdateInstance].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.v1.UpdateInstanceRequest} + */ +public final class UpdateInstanceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.v1.UpdateInstanceRequest) + UpdateInstanceRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateInstanceRequest.newBuilder() to construct. + private UpdateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateInstanceRequest() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateInstanceRequest( + 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: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.cloud.redis.v1.Instance.Builder subBuilder = null; + if (instance_ != null) { + subBuilder = instance_.toBuilder(); + } + instance_ = input.readMessage(com.google.cloud.redis.v1.Instance.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(instance_); + instance_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.UpdateInstanceRequest.class, com.google.cloud.redis.v1.UpdateInstanceRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Instance][CloudRedis.Instance]:
+   *  *   `displayName`
+   *  *   `labels`
+   *  *   `memorySizeGb`
+   *  *   `redisConfig`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Instance][CloudRedis.Instance]:
+   *  *   `displayName`
+   *  *   `labels`
+   *  *   `memorySizeGb`
+   *  *   `redisConfig`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Instance][CloudRedis.Instance]:
+   *  *   `displayName`
+   *  *   `labels`
+   *  *   `memorySizeGb`
+   *  *   `redisConfig`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + private com.google.cloud.redis.v1.Instance instance_; + /** + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + public boolean hasInstance() { + return instance_ != null; + } + /** + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + public com.google.cloud.redis.v1.Instance getInstance() { + return instance_ == null ? com.google.cloud.redis.v1.Instance.getDefaultInstance() : instance_; + } + /** + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + public com.google.cloud.redis.v1.InstanceOrBuilder getInstanceOrBuilder() { + return getInstance(); + } + + 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 (updateMask_ != null) { + output.writeMessage(1, getUpdateMask()); + } + if (instance_ != null) { + output.writeMessage(2, getInstance()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getUpdateMask()); + } + if (instance_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getInstance()); + } + 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.redis.v1.UpdateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.v1.UpdateInstanceRequest other = (com.google.cloud.redis.v1.UpdateInstanceRequest) obj; + + boolean result = true; + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask() + .equals(other.getUpdateMask()); + } + result = result && (hasInstance() == other.hasInstance()); + if (hasInstance()) { + result = result && getInstance() + .equals(other.getInstance()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.v1.UpdateInstanceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.UpdateInstanceRequest 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.redis.v1.UpdateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.UpdateInstanceRequest 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.redis.v1.UpdateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.UpdateInstanceRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.redis.v1.UpdateInstanceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.UpdateInstanceRequest 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.redis.v1.UpdateInstanceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.UpdateInstanceRequest 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.redis.v1.UpdateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.UpdateInstanceRequest 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.redis.v1.UpdateInstanceRequest 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 for [UpdateInstance][google.cloud.redis.v1.CloudRedis.UpdateInstance].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.v1.UpdateInstanceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.v1.UpdateInstanceRequest) + com.google.cloud.redis.v1.UpdateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.UpdateInstanceRequest.class, com.google.cloud.redis.v1.UpdateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.v1.UpdateInstanceRequest.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(); + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + if (instanceBuilder_ == null) { + instance_ = null; + } else { + instance_ = null; + instanceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.v1.UpdateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.redis.v1.UpdateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.v1.UpdateInstanceRequest build() { + com.google.cloud.redis.v1.UpdateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.v1.UpdateInstanceRequest buildPartial() { + com.google.cloud.redis.v1.UpdateInstanceRequest result = new com.google.cloud.redis.v1.UpdateInstanceRequest(this); + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + if (instanceBuilder_ == null) { + result.instance_ = instance_; + } else { + result.instance_ = instanceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.v1.UpdateInstanceRequest) { + return mergeFrom((com.google.cloud.redis.v1.UpdateInstanceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.v1.UpdateInstanceRequest other) { + if (other == com.google.cloud.redis.v1.UpdateInstanceRequest.getDefaultInstance()) return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + 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.redis.v1.UpdateInstanceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.redis.v1.UpdateInstanceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Instance][CloudRedis.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Instance][CloudRedis.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Instance][CloudRedis.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Instance][CloudRedis.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Instance][CloudRedis.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Instance][CloudRedis.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Instance][CloudRedis.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Instance][CloudRedis.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Instance][CloudRedis.Instance]:
+     *  *   `displayName`
+     *  *   `labels`
+     *  *   `memorySizeGb`
+     *  *   `redisConfig`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.redis.v1.Instance instance_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.v1.Instance, com.google.cloud.redis.v1.Instance.Builder, com.google.cloud.redis.v1.InstanceOrBuilder> instanceBuilder_; + /** + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + public boolean hasInstance() { + return instanceBuilder_ != null || instance_ != null; + } + /** + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + public com.google.cloud.redis.v1.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null ? com.google.cloud.redis.v1.Instance.getDefaultInstance() : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + public Builder setInstance(com.google.cloud.redis.v1.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + onChanged(); + } else { + instanceBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + public Builder setInstance( + com.google.cloud.redis.v1.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + onChanged(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + public Builder mergeInstance(com.google.cloud.redis.v1.Instance value) { + if (instanceBuilder_ == null) { + if (instance_ != null) { + instance_ = + com.google.cloud.redis.v1.Instance.newBuilder(instance_).mergeFrom(value).buildPartial(); + } else { + instance_ = value; + } + onChanged(); + } else { + instanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + public Builder clearInstance() { + if (instanceBuilder_ == null) { + instance_ = null; + onChanged(); + } else { + instance_ = null; + instanceBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + public com.google.cloud.redis.v1.Instance.Builder getInstanceBuilder() { + + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + public com.google.cloud.redis.v1.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null ? + com.google.cloud.redis.v1.Instance.getDefaultInstance() : instance_; + } + } + /** + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.v1.Instance, com.google.cloud.redis.v1.Instance.Builder, com.google.cloud.redis.v1.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.v1.Instance, com.google.cloud.redis.v1.Instance.Builder, com.google.cloud.redis.v1.InstanceOrBuilder>( + getInstance(), + getParentForChildren(), + isClean()); + instance_ = null; + } + return instanceBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.redis.v1.UpdateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.v1.UpdateInstanceRequest) + private static final com.google.cloud.redis.v1.UpdateInstanceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.v1.UpdateInstanceRequest(); + } + + public static com.google.cloud.redis.v1.UpdateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateInstanceRequest(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.redis.v1.UpdateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/UpdateInstanceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/UpdateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..740cacb81b72 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/UpdateInstanceRequestOrBuilder.java @@ -0,0 +1,80 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +public interface UpdateInstanceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.v1.UpdateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Instance][CloudRedis.Instance]:
+   *  *   `displayName`
+   *  *   `labels`
+   *  *   `memorySizeGb`
+   *  *   `redisConfig`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + boolean hasUpdateMask(); + /** + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Instance][CloudRedis.Instance]:
+   *  *   `displayName`
+   *  *   `labels`
+   *  *   `memorySizeGb`
+   *  *   `redisConfig`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Instance][CloudRedis.Instance]:
+   *  *   `displayName`
+   *  *   `labels`
+   *  *   `memorySizeGb`
+   *  *   `redisConfig`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + boolean hasInstance(); + /** + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + com.google.cloud.redis.v1.Instance getInstance(); + /** + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * .google.cloud.redis.v1.Instance instance = 2; + */ + com.google.cloud.redis.v1.InstanceOrBuilder getInstanceOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ZoneMetadata.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ZoneMetadata.java new file mode 100644 index 000000000000..1fe4d178caaa --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ZoneMetadata.java @@ -0,0 +1,423 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +/** + *
+ * Defines specific information for a particular zone. Currently empty and
+ * reserved for future use only.
+ * 
+ * + * Protobuf type {@code google.cloud.redis.v1.ZoneMetadata} + */ +public final class ZoneMetadata extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.v1.ZoneMetadata) + ZoneMetadataOrBuilder { +private static final long serialVersionUID = 0L; + // Use ZoneMetadata.newBuilder() to construct. + private ZoneMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ZoneMetadata() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ZoneMetadata( + 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 (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ZoneMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ZoneMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.ZoneMetadata.class, com.google.cloud.redis.v1.ZoneMetadata.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.redis.v1.ZoneMetadata)) { + return super.equals(obj); + } + com.google.cloud.redis.v1.ZoneMetadata other = (com.google.cloud.redis.v1.ZoneMetadata) obj; + + boolean result = true; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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.redis.v1.ZoneMetadata parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.ZoneMetadata 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.redis.v1.ZoneMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.ZoneMetadata 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.redis.v1.ZoneMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.redis.v1.ZoneMetadata parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.redis.v1.ZoneMetadata parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.ZoneMetadata 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.redis.v1.ZoneMetadata parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.ZoneMetadata 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.redis.v1.ZoneMetadata parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.redis.v1.ZoneMetadata 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.redis.v1.ZoneMetadata 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; + } + /** + *
+   * Defines specific information for a particular zone. Currently empty and
+   * reserved for future use only.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.v1.ZoneMetadata} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.v1.ZoneMetadata) + com.google.cloud.redis.v1.ZoneMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ZoneMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ZoneMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.v1.ZoneMetadata.class, com.google.cloud.redis.v1.ZoneMetadata.Builder.class); + } + + // Construct using com.google.cloud.redis.v1.ZoneMetadata.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.redis.v1.CloudRedisServiceV1Proto.internal_static_google_cloud_redis_v1_ZoneMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.v1.ZoneMetadata getDefaultInstanceForType() { + return com.google.cloud.redis.v1.ZoneMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.v1.ZoneMetadata build() { + com.google.cloud.redis.v1.ZoneMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.v1.ZoneMetadata buildPartial() { + com.google.cloud.redis.v1.ZoneMetadata result = new com.google.cloud.redis.v1.ZoneMetadata(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.v1.ZoneMetadata) { + return mergeFrom((com.google.cloud.redis.v1.ZoneMetadata)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.v1.ZoneMetadata other) { + if (other == com.google.cloud.redis.v1.ZoneMetadata.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.redis.v1.ZoneMetadata parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.redis.v1.ZoneMetadata) 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.setUnknownFieldsProto3(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.redis.v1.ZoneMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.v1.ZoneMetadata) + private static final com.google.cloud.redis.v1.ZoneMetadata DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.v1.ZoneMetadata(); + } + + public static com.google.cloud.redis.v1.ZoneMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ZoneMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ZoneMetadata(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.redis.v1.ZoneMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ZoneMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ZoneMetadataOrBuilder.java new file mode 100644 index 000000000000..826f3203d113 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/ZoneMetadataOrBuilder.java @@ -0,0 +1,9 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/v1/cloud_redis.proto + +package com.google.cloud.redis.v1; + +public interface ZoneMetadataOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.v1.ZoneMetadata) + com.google.protobuf.MessageOrBuilder { +} diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/proto/google/cloud/redis/v1/cloud_redis.proto b/google-api-grpc/proto-google-cloud-redis-v1/src/main/proto/google/cloud/redis/v1/cloud_redis.proto new file mode 100644 index 000000000000..bf2cc0fe6b04 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/proto/google/cloud/redis/v1/cloud_redis.proto @@ -0,0 +1,368 @@ +// Copyright 2018 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 +// +// http://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. + +syntax = "proto3"; + +package google.cloud.redis.v1; + +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/redis/v1;redis"; +option java_multiple_files = true; +option java_outer_classname = "CloudRedisServiceV1Proto"; +option java_package = "com.google.cloud.redis.v1"; + + +// Configures and manages Cloud Memorystore for Redis instances +// +// Google Cloud Memorystore for Redis v1 +// +// The `redis.googleapis.com` service implements the Google Cloud Memorystore +// for Redis API and defines the following resource model for managing Redis +// instances: +// * The service works with a collection of cloud projects, named: `/projects/*` +// * Each project has a collection of available locations, named: `/locations/*` +// * Each location has a collection of Redis instances, named: `/instances/*` +// * As such, Redis instances are resources of the form: +// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` +// +// Note that location_id must be refering to a GCP `region`; for example: +// * `projects/redpepper-1290/locations/us-central1/instances/my-redis` +service CloudRedis { + // Lists all Redis instances owned by a project in either the specified + // location (region) or all locations. + // + // The location should have the following format: + // * `projects/{project_id}/locations/{location_id}` + // + // If `location_id` is specified as `-` (wildcard), then all regions + // available to the project are queried, and the results are aggregated. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/instances" + }; + } + + // Gets the details of a specific Redis instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*}" + }; + } + + // Creates a Redis instance based on the specified tier and memory size. + // + // By default, the instance is accessible from the project's + // [default network](/compute/docs/networks-and-firewalls#networks). + // + // The creation is executed asynchronously and callers may check the returned + // operation to track its progress. Once the operation is completed the Redis + // instance will be fully functional. Completed longrunning.Operation will + // contain the new instance object in the response field. + // + // The returned operation is automatically deleted after a few hours, so there + // is no need to call DeleteOperation. + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + } + + // Updates the metadata and configuration of a specific Redis instance. + // + // Completed longrunning.Operation will contain the new instance object + // in the response field. The returned operation is automatically deleted + // after a few hours, so there is no need to call DeleteOperation. + rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance.name=projects/*/locations/*/instances/*}" + body: "instance" + }; + } + + // Deletes a specific Redis instance. Instance stops serving and data is + // deleted. + rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/instances/*}" + }; + } +} + +// A Google Cloud Redis instance. +message Instance { + // Represents the different states of a Redis instance. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // Redis instance is being created. + CREATING = 1; + + // Redis instance has been created and is fully usable. + READY = 2; + + // Redis instance configuration is being updated. Certain kinds of updates + // may cause the instance to become unusable while the update is in + // progress. + UPDATING = 3; + + // Redis instance is being deleted. + DELETING = 4; + + // Redis instance is being repaired and may be unusable. Details can be + // found in the `status_message` field. + REPAIRING = 5; + + // Maintenance is being performed on this Redis instance. + MAINTENANCE = 6; + } + + // Available service tiers to choose from + enum Tier { + // Not set. + TIER_UNSPECIFIED = 0; + + // BASIC tier: standalone instance + BASIC = 1; + + // STANDARD_HA tier: highly available primary/replica instances + STANDARD_HA = 3; + } + + // Required. Unique name of the resource in this scope including project and + // location using the form: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // + // Note: Redis instances are managed and addressed at regional level so + // location_id here refers to a GCP region; however, users may choose which + // specific zone (or collection of zones for cross-zone instances) an instance + // should be provisioned in. Refer to [location_id] and + // [alternative_location_id] fields for more details. + string name = 1; + + // An arbitrary and optional user-provided name for the instance. + string display_name = 2; + + // Resource labels to represent user provided metadata + map labels = 3; + + // Optional. The zone where the instance will be provisioned. If not provided, + // the service will choose a zone for the instance. For STANDARD_HA tier, + // instances will be created across two zones for protection against zonal + // failures. If [alternative_location_id] is also provided, it must be + // different from [location_id]. + string location_id = 4; + + // Optional. Only applicable to STANDARD_HA tier which protects the instance + // against zonal failures by provisioning it across two zones. If provided, it + // must be a different zone from the one provided in [location_id]. + string alternative_location_id = 5; + + // Optional. The version of Redis software. + // If not provided, latest supported version will be used. Updating the + // version will perform an upgrade/downgrade to the new version. Currently, + // the supported values are `REDIS_3_2` for Redis 3.2. + string redis_version = 7; + + // Optional. The CIDR range of internal addresses that are reserved for this + // instance. If not provided, the service will choose an unused /29 block, + // for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique + // and non-overlapping with existing subnets in an authorized network. + string reserved_ip_range = 9; + + // Output only. Hostname or IP address of the exposed Redis endpoint used by + // clients to connect to the service. + string host = 10; + + // Output only. The port number of the exposed Redis endpoint. + int32 port = 11; + + // Output only. The current zone where the Redis endpoint is placed. For Basic + // Tier instances, this will always be the same as the [location_id] + // provided by the user at creation time. For Standard Tier instances, + // this can be either [location_id] or [alternative_location_id] and can + // change after a failover event. + string current_location_id = 12; + + // Output only. The time the instance was created. + google.protobuf.Timestamp create_time = 13; + + // Output only. The current state of this instance. + State state = 14; + + // Output only. Additional information about the current status of this + // instance, if available. + string status_message = 15; + + // Optional. Redis configuration parameters, according to + // http://redis.io/topics/config. Currently, the only supported parameters + // are: + // + // * maxmemory-policy + // * notify-keyspace-events + map redis_configs = 16; + + // Required. The service tier of the instance. + Tier tier = 17; + + // Required. Redis memory size in GiB. + int32 memory_size_gb = 18; + + // Optional. The full name of the Google Compute Engine + // [network](/compute/docs/networks-and-firewalls#networks) to which the + // instance is connected. If left unspecified, the `default` network + // will be used. + string authorized_network = 20; +} + +// Request for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances]. +message ListInstancesRequest { + // Required. The resource name of the instance location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region + string parent = 1; + + // The maximum number of items to return. + // + // If not specified, a default value of 1000 will be used by the service. + // Regardless of the page_size value, the response may include a partial list + // and a caller should only rely on response's + // [next_page_token][CloudRedis.ListInstancesResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2; + + // The next_page_token value returned from a previous List request, + // if any. + string page_token = 3; +} + +// Response for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances]. +message ListInstancesResponse { + // A list of Redis instances in the project in the specified location, + // or across all locations. + // + // If the `location_id` in the parent field of the request is "-", all regions + // available to the project are queried, and the results aggregated. + // If in such an aggregated query a location is unavailable, a dummy Redis + // entry is included in the response with the "name" field set to a value of + // the form projects/{project_id}/locations/{location_id}/instances/- and the + // "status" field set to ERROR and "status_message" field set to "location not + // available for ListInstances". + repeated Instance instances = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request for [GetInstance][google.cloud.redis.v1.CloudRedis.GetInstance]. +message GetInstanceRequest { + // Required. Redis instance resource name using the form: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region + string name = 1; +} + +// Request for [CreateInstance][google.cloud.redis.v1.CloudRedis.CreateInstance]. +message CreateInstanceRequest { + // Required. The resource name of the instance location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region + string parent = 1; + + // Required. The logical name of the Redis instance in the customer project + // with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-40 characters. + // * Must end with a number or a letter. + // * Must be unique within the customer project / location + string instance_id = 2; + + // Required. A Redis [Instance] resource + Instance instance = 3; +} + +// Request for [UpdateInstance][google.cloud.redis.v1.CloudRedis.UpdateInstance]. +message UpdateInstanceRequest { + // Required. Mask of fields to update. At least one path must be supplied in + // this field. The elements of the repeated paths field may only include these + // fields from [Instance][CloudRedis.Instance]: + // + // * `displayName` + // * `labels` + // * `memorySizeGb` + // * `redisConfig` + google.protobuf.FieldMask update_mask = 1; + + // Required. Update description. + // Only fields specified in update_mask are updated. + Instance instance = 2; +} + +// Request for [DeleteInstance][google.cloud.redis.v1.CloudRedis.DeleteInstance]. +message DeleteInstanceRequest { + // Required. Redis instance resource name using the form: + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + // where `location_id` refers to a GCP region + string name = 1; +} + +// Represents the v1 metadata of the long-running operation. +message OperationMetadata { + // Creation timestamp. + google.protobuf.Timestamp create_time = 1; + + // End timestamp. + google.protobuf.Timestamp end_time = 2; + + // Operation target. + string target = 3; + + // Operation verb. + string verb = 4; + + // Operation status details. + string status_detail = 5; + + // Specifies if cancellation was requested for the operaiton. + bool cancel_requested = 6; + + // API version. + string api_version = 7; +} + +// This location metadata represents additional configuration options for a +// given location where a Redis instance may be created. All fields are output +// only. It is returned as content of the +// `google.cloud.location.Location.metadata` field. +message LocationMetadata { + // Output only. The set of available zones in the location. The map is keyed + // by the lowercase ID of each zone, as defined by GCE. These keys can be + // specified in `location_id` or `alternative_location_id` fields when + // creating a Redis instance. + map available_zones = 1; +} + +// Defines specific information for a particular zone. Currently empty and +// reserved for future use only. +message ZoneMetadata { + +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/pom.xml b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/pom.xml new file mode 100644 index 000000000000..6a4e705d62b0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/pom.xml @@ -0,0 +1,26 @@ + + 4.0.0 + proto-google-cloud-video-intelligence-v1p2beta1 + 0.26.1-SNAPSHOT + proto-google-cloud-video-intelligence-v1p2beta1 + PROTO library for proto-google-cloud-video-intelligence-v1p2beta1 + + com.google.api.grpc + google-api-grpc + 0.26.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoProgress.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoProgress.java new file mode 100644 index 000000000000..d88c9192eaf1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoProgress.java @@ -0,0 +1,863 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Video annotation progress. Included in the `metadata`
+ * field of the `Operation` returned by the `GetOperation`
+ * call of the `google::longrunning::Operations` service.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress} + */ +public final class AnnotateVideoProgress extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress) + AnnotateVideoProgressOrBuilder { +private static final long serialVersionUID = 0L; + // Use AnnotateVideoProgress.newBuilder() to construct. + private AnnotateVideoProgress(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AnnotateVideoProgress() { + annotationProgress_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AnnotateVideoProgress( + 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: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotationProgress_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + annotationProgress_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotationProgress_ = java.util.Collections.unmodifiableList(annotationProgress_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoProgress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoProgress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.class, com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.Builder.class); + } + + public static final int ANNOTATION_PROGRESS_FIELD_NUMBER = 1; + private java.util.List annotationProgress_; + /** + *
+   * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public java.util.List getAnnotationProgressList() { + return annotationProgress_; + } + /** + *
+   * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public java.util.List + getAnnotationProgressOrBuilderList() { + return annotationProgress_; + } + /** + *
+   * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public int getAnnotationProgressCount() { + return annotationProgress_.size(); + } + /** + *
+   * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress getAnnotationProgress(int index) { + return annotationProgress_.get(index); + } + /** + *
+   * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgressOrBuilder getAnnotationProgressOrBuilder( + int index) { + return annotationProgress_.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 { + for (int i = 0; i < annotationProgress_.size(); i++) { + output.writeMessage(1, annotationProgress_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < annotationProgress_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, annotationProgress_.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.videointelligence.v1p2beta1.AnnotateVideoProgress)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress other = (com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress) obj; + + boolean result = true; + result = result && getAnnotationProgressList() + .equals(other.getAnnotationProgressList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAnnotationProgressCount() > 0) { + hash = (37 * hash) + ANNOTATION_PROGRESS_FIELD_NUMBER; + hash = (53 * hash) + getAnnotationProgressList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress 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.videointelligence.v1p2beta1.AnnotateVideoProgress parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress 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.videointelligence.v1p2beta1.AnnotateVideoProgress parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress 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.videointelligence.v1p2beta1.AnnotateVideoProgress parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress 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.videointelligence.v1p2beta1.AnnotateVideoProgress parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress 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.videointelligence.v1p2beta1.AnnotateVideoProgress 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; + } + /** + *
+   * Video annotation progress. Included in the `metadata`
+   * field of the `Operation` returned by the `GetOperation`
+   * call of the `google::longrunning::Operations` service.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress) + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgressOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoProgress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoProgress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.class, com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAnnotationProgressFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (annotationProgressBuilder_ == null) { + annotationProgress_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + annotationProgressBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoProgress_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress build() { + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress result = new com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress(this); + int from_bitField0_ = bitField0_; + if (annotationProgressBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + annotationProgress_ = java.util.Collections.unmodifiableList(annotationProgress_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.annotationProgress_ = annotationProgress_; + } else { + result.annotationProgress_ = annotationProgressBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.getDefaultInstance()) return this; + if (annotationProgressBuilder_ == null) { + if (!other.annotationProgress_.isEmpty()) { + if (annotationProgress_.isEmpty()) { + annotationProgress_ = other.annotationProgress_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAnnotationProgressIsMutable(); + annotationProgress_.addAll(other.annotationProgress_); + } + onChanged(); + } + } else { + if (!other.annotationProgress_.isEmpty()) { + if (annotationProgressBuilder_.isEmpty()) { + annotationProgressBuilder_.dispose(); + annotationProgressBuilder_ = null; + annotationProgress_ = other.annotationProgress_; + bitField0_ = (bitField0_ & ~0x00000001); + annotationProgressBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAnnotationProgressFieldBuilder() : null; + } else { + annotationProgressBuilder_.addAllMessages(other.annotationProgress_); + } + } + } + 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.videointelligence.v1p2beta1.AnnotateVideoProgress parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List annotationProgress_ = + java.util.Collections.emptyList(); + private void ensureAnnotationProgressIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + annotationProgress_ = new java.util.ArrayList(annotationProgress_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgressOrBuilder> annotationProgressBuilder_; + + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public java.util.List getAnnotationProgressList() { + if (annotationProgressBuilder_ == null) { + return java.util.Collections.unmodifiableList(annotationProgress_); + } else { + return annotationProgressBuilder_.getMessageList(); + } + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public int getAnnotationProgressCount() { + if (annotationProgressBuilder_ == null) { + return annotationProgress_.size(); + } else { + return annotationProgressBuilder_.getCount(); + } + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress getAnnotationProgress(int index) { + if (annotationProgressBuilder_ == null) { + return annotationProgress_.get(index); + } else { + return annotationProgressBuilder_.getMessage(index); + } + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public Builder setAnnotationProgress( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress value) { + if (annotationProgressBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationProgressIsMutable(); + annotationProgress_.set(index, value); + onChanged(); + } else { + annotationProgressBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public Builder setAnnotationProgress( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.Builder builderForValue) { + if (annotationProgressBuilder_ == null) { + ensureAnnotationProgressIsMutable(); + annotationProgress_.set(index, builderForValue.build()); + onChanged(); + } else { + annotationProgressBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public Builder addAnnotationProgress(com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress value) { + if (annotationProgressBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationProgressIsMutable(); + annotationProgress_.add(value); + onChanged(); + } else { + annotationProgressBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public Builder addAnnotationProgress( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress value) { + if (annotationProgressBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationProgressIsMutable(); + annotationProgress_.add(index, value); + onChanged(); + } else { + annotationProgressBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public Builder addAnnotationProgress( + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.Builder builderForValue) { + if (annotationProgressBuilder_ == null) { + ensureAnnotationProgressIsMutable(); + annotationProgress_.add(builderForValue.build()); + onChanged(); + } else { + annotationProgressBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public Builder addAnnotationProgress( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.Builder builderForValue) { + if (annotationProgressBuilder_ == null) { + ensureAnnotationProgressIsMutable(); + annotationProgress_.add(index, builderForValue.build()); + onChanged(); + } else { + annotationProgressBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public Builder addAllAnnotationProgress( + java.lang.Iterable values) { + if (annotationProgressBuilder_ == null) { + ensureAnnotationProgressIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, annotationProgress_); + onChanged(); + } else { + annotationProgressBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public Builder clearAnnotationProgress() { + if (annotationProgressBuilder_ == null) { + annotationProgress_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + annotationProgressBuilder_.clear(); + } + return this; + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public Builder removeAnnotationProgress(int index) { + if (annotationProgressBuilder_ == null) { + ensureAnnotationProgressIsMutable(); + annotationProgress_.remove(index); + onChanged(); + } else { + annotationProgressBuilder_.remove(index); + } + return this; + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.Builder getAnnotationProgressBuilder( + int index) { + return getAnnotationProgressFieldBuilder().getBuilder(index); + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgressOrBuilder getAnnotationProgressOrBuilder( + int index) { + if (annotationProgressBuilder_ == null) { + return annotationProgress_.get(index); } else { + return annotationProgressBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public java.util.List + getAnnotationProgressOrBuilderList() { + if (annotationProgressBuilder_ != null) { + return annotationProgressBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(annotationProgress_); + } + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.Builder addAnnotationProgressBuilder() { + return getAnnotationProgressFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.getDefaultInstance()); + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.Builder addAnnotationProgressBuilder( + int index) { + return getAnnotationProgressFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.getDefaultInstance()); + } + /** + *
+     * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + public java.util.List + getAnnotationProgressBuilderList() { + return getAnnotationProgressFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgressOrBuilder> + getAnnotationProgressFieldBuilder() { + if (annotationProgressBuilder_ == null) { + annotationProgressBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgressOrBuilder>( + annotationProgress_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + annotationProgress_ = null; + } + return annotationProgressBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.AnnotateVideoProgress) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress) + private static final com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AnnotateVideoProgress parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AnnotateVideoProgress(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.videointelligence.v1p2beta1.AnnotateVideoProgress getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoProgressOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoProgressOrBuilder.java new file mode 100644 index 000000000000..235ee3f23649 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoProgressOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface AnnotateVideoProgressOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + java.util.List + getAnnotationProgressList(); + /** + *
+   * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress getAnnotationProgress(int index); + /** + *
+   * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + int getAnnotationProgressCount(); + /** + *
+   * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + java.util.List + getAnnotationProgressOrBuilderList(); + /** + *
+   * Progress metadata for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress annotation_progress = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgressOrBuilder getAnnotationProgressOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoRequest.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoRequest.java new file mode 100644 index 000000000000..201e27416af7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoRequest.java @@ -0,0 +1,1619 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Video annotation request.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest} + */ +public final class AnnotateVideoRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest) + AnnotateVideoRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use AnnotateVideoRequest.newBuilder() to construct. + private AnnotateVideoRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AnnotateVideoRequest() { + inputUri_ = ""; + inputContent_ = com.google.protobuf.ByteString.EMPTY; + features_ = java.util.Collections.emptyList(); + outputUri_ = ""; + locationId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AnnotateVideoRequest( + 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(); + + inputUri_ = s; + break; + } + case 16: { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + features_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + features_.add(rawValue); + break; + } + case 18: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + features_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + features_.add(rawValue); + } + input.popLimit(oldLimit); + break; + } + case 26: { + com.google.cloud.videointelligence.v1p2beta1.VideoContext.Builder subBuilder = null; + if (videoContext_ != null) { + subBuilder = videoContext_.toBuilder(); + } + videoContext_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.VideoContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(videoContext_); + videoContext_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + outputUri_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + locationId_ = s; + break; + } + case 50: { + + inputContent_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + features_ = java.util.Collections.unmodifiableList(features_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.class, com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.Builder.class); + } + + private int bitField0_; + public static final int INPUT_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object inputUri_; + /** + *
+   * 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.
+   * 
+ * + * string input_uri = 1; + */ + public java.lang.String getInputUri() { + java.lang.Object ref = inputUri_; + 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(); + inputUri_ = s; + return s; + } + } + /** + *
+   * 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.
+   * 
+ * + * string input_uri = 1; + */ + public com.google.protobuf.ByteString + getInputUriBytes() { + java.lang.Object ref = inputUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + inputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_CONTENT_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString inputContent_; + /** + *
+   * The video data bytes.
+   * If unset, the input video(s) should be specified via `input_uri`.
+   * If set, `input_uri` should be unset.
+   * 
+ * + * bytes input_content = 6; + */ + public com.google.protobuf.ByteString getInputContent() { + return inputContent_; + } + + public static final int FEATURES_FIELD_NUMBER = 2; + private java.util.List features_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.videointelligence.v1p2beta1.Feature> features_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.videointelligence.v1p2beta1.Feature>() { + public com.google.cloud.videointelligence.v1p2beta1.Feature convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.videointelligence.v1p2beta1.Feature result = com.google.cloud.videointelligence.v1p2beta1.Feature.valueOf(from); + return result == null ? com.google.cloud.videointelligence.v1p2beta1.Feature.UNRECOGNIZED : result; + } + }; + /** + *
+   * Requested video annotation features.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public java.util.List getFeaturesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.videointelligence.v1p2beta1.Feature>(features_, features_converter_); + } + /** + *
+   * Requested video annotation features.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public int getFeaturesCount() { + return features_.size(); + } + /** + *
+   * Requested video annotation features.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.Feature getFeatures(int index) { + return features_converter_.convert(features_.get(index)); + } + /** + *
+   * Requested video annotation features.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public java.util.List + getFeaturesValueList() { + return features_; + } + /** + *
+   * Requested video annotation features.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public int getFeaturesValue(int index) { + return features_.get(index); + } + private int featuresMemoizedSerializedSize; + + public static final int VIDEO_CONTEXT_FIELD_NUMBER = 3; + private com.google.cloud.videointelligence.v1p2beta1.VideoContext videoContext_; + /** + *
+   * Additional video context and/or feature-specific parameters.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + public boolean hasVideoContext() { + return videoContext_ != null; + } + /** + *
+   * Additional video context and/or feature-specific parameters.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoContext getVideoContext() { + return videoContext_ == null ? com.google.cloud.videointelligence.v1p2beta1.VideoContext.getDefaultInstance() : videoContext_; + } + /** + *
+   * Additional video context and/or feature-specific parameters.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoContextOrBuilder getVideoContextOrBuilder() { + return getVideoContext(); + } + + public static final int OUTPUT_URI_FIELD_NUMBER = 4; + private volatile java.lang.Object outputUri_; + /** + *
+   * 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).
+   * 
+ * + * string output_uri = 4; + */ + public java.lang.String getOutputUri() { + java.lang.Object ref = outputUri_; + 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(); + outputUri_ = s; + return s; + } + } + /** + *
+   * 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).
+   * 
+ * + * string output_uri = 4; + */ + public com.google.protobuf.ByteString + getOutputUriBytes() { + java.lang.Object ref = outputUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + outputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_ID_FIELD_NUMBER = 5; + private volatile java.lang.Object locationId_; + /** + *
+   * 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.
+   * 
+ * + * string location_id = 5; + */ + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + 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(); + locationId_ = s; + return s; + } + } + /** + *
+   * 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.
+   * 
+ * + * string location_id = 5; + */ + public com.google.protobuf.ByteString + getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 { + 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 (!inputContent_.isEmpty()) { + output.writeBytes(6, inputContent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getInputUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, inputUri_); + } + { + int dataSize = 0; + for (int i = 0; i < features_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(features_.get(i)); + } + size += dataSize; + if (!getFeaturesList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }featuresMemoizedSerializedSize = dataSize; + } + if (videoContext_ != null) { + 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 (!inputContent_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(6, inputContent_); + } + 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.videointelligence.v1p2beta1.AnnotateVideoRequest)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest other = (com.google.cloud.videointelligence.v1p2beta1.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; + } + + @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; + } + + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest 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.videointelligence.v1p2beta1.AnnotateVideoRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest 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.videointelligence.v1p2beta1.AnnotateVideoRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest 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.videointelligence.v1p2beta1.AnnotateVideoRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest 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.videointelligence.v1p2beta1.AnnotateVideoRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest 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.videointelligence.v1p2beta1.AnnotateVideoRequest 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; + } + /** + *
+   * Video annotation request.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest) + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.class, com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.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(); + inputUri_ = ""; + + inputContent_ = com.google.protobuf.ByteString.EMPTY; + + features_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + if (videoContextBuilder_ == null) { + videoContext_ = null; + } else { + videoContext_ = null; + videoContextBuilder_ = null; + } + outputUri_ = ""; + + locationId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest build() { + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest result = new com.google.cloud.videointelligence.v1p2beta1.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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.getDefaultInstance()) return this; + if (!other.getInputUri().isEmpty()) { + inputUri_ = other.inputUri_; + onChanged(); + } + if (other.getInputContent() != com.google.protobuf.ByteString.EMPTY) { + setInputContent(other.getInputContent()); + } + if (!other.features_.isEmpty()) { + if (features_.isEmpty()) { + features_ = other.features_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureFeaturesIsMutable(); + features_.addAll(other.features_); + } + onChanged(); + } + if (other.hasVideoContext()) { + mergeVideoContext(other.getVideoContext()); + } + if (!other.getOutputUri().isEmpty()) { + outputUri_ = other.outputUri_; + onChanged(); + } + if (!other.getLocationId().isEmpty()) { + locationId_ = other.locationId_; + onChanged(); + } + 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.videointelligence.v1p2beta1.AnnotateVideoRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object inputUri_ = ""; + /** + *
+     * 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.
+     * 
+ * + * string input_uri = 1; + */ + public java.lang.String getInputUri() { + java.lang.Object ref = inputUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * 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.
+     * 
+ * + * string input_uri = 1; + */ + public com.google.protobuf.ByteString + getInputUriBytes() { + java.lang.Object ref = inputUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + inputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * 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.
+     * 
+ * + * string input_uri = 1; + */ + public Builder setInputUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + inputUri_ = value; + onChanged(); + return this; + } + /** + *
+     * 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.
+     * 
+ * + * string input_uri = 1; + */ + public Builder clearInputUri() { + + inputUri_ = getDefaultInstance().getInputUri(); + onChanged(); + return this; + } + /** + *
+     * 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.
+     * 
+ * + * string input_uri = 1; + */ + public Builder setInputUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + inputUri_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString inputContent_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * The video data bytes.
+     * If unset, the input video(s) should be specified via `input_uri`.
+     * If set, `input_uri` should be unset.
+     * 
+ * + * bytes input_content = 6; + */ + public com.google.protobuf.ByteString getInputContent() { + return inputContent_; + } + /** + *
+     * The video data bytes.
+     * If unset, the input video(s) should be specified via `input_uri`.
+     * If set, `input_uri` should be unset.
+     * 
+ * + * bytes input_content = 6; + */ + public Builder setInputContent(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + inputContent_ = value; + onChanged(); + return this; + } + /** + *
+     * The video data bytes.
+     * If unset, the input video(s) should be specified via `input_uri`.
+     * If set, `input_uri` should be unset.
+     * 
+ * + * bytes input_content = 6; + */ + public Builder clearInputContent() { + + inputContent_ = getDefaultInstance().getInputContent(); + onChanged(); + return this; + } + + private java.util.List features_ = + java.util.Collections.emptyList(); + private void ensureFeaturesIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + features_ = new java.util.ArrayList(features_); + bitField0_ |= 0x00000004; + } + } + /** + *
+     * Requested video annotation features.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public java.util.List getFeaturesList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.videointelligence.v1p2beta1.Feature>(features_, features_converter_); + } + /** + *
+     * Requested video annotation features.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public int getFeaturesCount() { + return features_.size(); + } + /** + *
+     * Requested video annotation features.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.Feature getFeatures(int index) { + return features_converter_.convert(features_.get(index)); + } + /** + *
+     * Requested video annotation features.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public Builder setFeatures( + int index, com.google.cloud.videointelligence.v1p2beta1.Feature value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFeaturesIsMutable(); + features_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + *
+     * Requested video annotation features.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public Builder addFeatures(com.google.cloud.videointelligence.v1p2beta1.Feature value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFeaturesIsMutable(); + features_.add(value.getNumber()); + onChanged(); + return this; + } + /** + *
+     * Requested video annotation features.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public Builder addAllFeatures( + java.lang.Iterable values) { + ensureFeaturesIsMutable(); + for (com.google.cloud.videointelligence.v1p2beta1.Feature value : values) { + features_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + *
+     * Requested video annotation features.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public Builder clearFeatures() { + features_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * Requested video annotation features.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public java.util.List + getFeaturesValueList() { + return java.util.Collections.unmodifiableList(features_); + } + /** + *
+     * Requested video annotation features.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public int getFeaturesValue(int index) { + return features_.get(index); + } + /** + *
+     * Requested video annotation features.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public Builder setFeaturesValue( + int index, int value) { + ensureFeaturesIsMutable(); + features_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Requested video annotation features.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public Builder addFeaturesValue(int value) { + ensureFeaturesIsMutable(); + features_.add(value); + onChanged(); + return this; + } + /** + *
+     * Requested video annotation features.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + public Builder addAllFeaturesValue( + java.lang.Iterable values) { + ensureFeaturesIsMutable(); + for (int value : values) { + features_.add(value); + } + onChanged(); + return this; + } + + private com.google.cloud.videointelligence.v1p2beta1.VideoContext videoContext_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoContext, com.google.cloud.videointelligence.v1p2beta1.VideoContext.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoContextOrBuilder> videoContextBuilder_; + /** + *
+     * Additional video context and/or feature-specific parameters.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + public boolean hasVideoContext() { + return videoContextBuilder_ != null || videoContext_ != null; + } + /** + *
+     * Additional video context and/or feature-specific parameters.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoContext getVideoContext() { + if (videoContextBuilder_ == null) { + return videoContext_ == null ? com.google.cloud.videointelligence.v1p2beta1.VideoContext.getDefaultInstance() : videoContext_; + } else { + return videoContextBuilder_.getMessage(); + } + } + /** + *
+     * Additional video context and/or feature-specific parameters.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + public Builder setVideoContext(com.google.cloud.videointelligence.v1p2beta1.VideoContext value) { + if (videoContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + videoContext_ = value; + onChanged(); + } else { + videoContextBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Additional video context and/or feature-specific parameters.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + public Builder setVideoContext( + com.google.cloud.videointelligence.v1p2beta1.VideoContext.Builder builderForValue) { + if (videoContextBuilder_ == null) { + videoContext_ = builderForValue.build(); + onChanged(); + } else { + videoContextBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Additional video context and/or feature-specific parameters.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + public Builder mergeVideoContext(com.google.cloud.videointelligence.v1p2beta1.VideoContext value) { + if (videoContextBuilder_ == null) { + if (videoContext_ != null) { + videoContext_ = + com.google.cloud.videointelligence.v1p2beta1.VideoContext.newBuilder(videoContext_).mergeFrom(value).buildPartial(); + } else { + videoContext_ = value; + } + onChanged(); + } else { + videoContextBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Additional video context and/or feature-specific parameters.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + public Builder clearVideoContext() { + if (videoContextBuilder_ == null) { + videoContext_ = null; + onChanged(); + } else { + videoContext_ = null; + videoContextBuilder_ = null; + } + + return this; + } + /** + *
+     * Additional video context and/or feature-specific parameters.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoContext.Builder getVideoContextBuilder() { + + onChanged(); + return getVideoContextFieldBuilder().getBuilder(); + } + /** + *
+     * Additional video context and/or feature-specific parameters.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoContextOrBuilder getVideoContextOrBuilder() { + if (videoContextBuilder_ != null) { + return videoContextBuilder_.getMessageOrBuilder(); + } else { + return videoContext_ == null ? + com.google.cloud.videointelligence.v1p2beta1.VideoContext.getDefaultInstance() : videoContext_; + } + } + /** + *
+     * Additional video context and/or feature-specific parameters.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoContext, com.google.cloud.videointelligence.v1p2beta1.VideoContext.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoContextOrBuilder> + getVideoContextFieldBuilder() { + if (videoContextBuilder_ == null) { + videoContextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoContext, com.google.cloud.videointelligence.v1p2beta1.VideoContext.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoContextOrBuilder>( + getVideoContext(), + getParentForChildren(), + isClean()); + videoContext_ = null; + } + return videoContextBuilder_; + } + + private java.lang.Object outputUri_ = ""; + /** + *
+     * 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).
+     * 
+ * + * string output_uri = 4; + */ + public java.lang.String getOutputUri() { + java.lang.Object ref = outputUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + outputUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * 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).
+     * 
+ * + * string output_uri = 4; + */ + public com.google.protobuf.ByteString + getOutputUriBytes() { + java.lang.Object ref = outputUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + outputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * 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).
+     * 
+ * + * string output_uri = 4; + */ + public Builder setOutputUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + outputUri_ = value; + onChanged(); + return this; + } + /** + *
+     * 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).
+     * 
+ * + * string output_uri = 4; + */ + public Builder clearOutputUri() { + + outputUri_ = getDefaultInstance().getOutputUri(); + onChanged(); + return this; + } + /** + *
+     * 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).
+     * 
+ * + * string output_uri = 4; + */ + public Builder setOutputUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + outputUri_ = value; + onChanged(); + return this; + } + + private java.lang.Object locationId_ = ""; + /** + *
+     * 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.
+     * 
+ * + * string location_id = 5; + */ + public java.lang.String getLocationId() { + java.lang.Object ref = locationId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locationId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * 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.
+     * 
+ * + * string location_id = 5; + */ + public com.google.protobuf.ByteString + getLocationIdBytes() { + java.lang.Object ref = locationId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + locationId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * 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.
+     * 
+ * + * string location_id = 5; + */ + public Builder setLocationId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + locationId_ = value; + onChanged(); + return this; + } + /** + *
+     * 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.
+     * 
+ * + * string location_id = 5; + */ + public Builder clearLocationId() { + + locationId_ = getDefaultInstance().getLocationId(); + onChanged(); + return this; + } + /** + *
+     * 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.
+     * 
+ * + * string location_id = 5; + */ + public Builder setLocationIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + locationId_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.AnnotateVideoRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest) + private static final com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AnnotateVideoRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AnnotateVideoRequest(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.videointelligence.v1p2beta1.AnnotateVideoRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoRequestOrBuilder.java new file mode 100644 index 000000000000..b5e9ca7b580e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoRequestOrBuilder.java @@ -0,0 +1,173 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface AnnotateVideoRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * 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.
+   * 
+ * + * string input_uri = 1; + */ + java.lang.String getInputUri(); + /** + *
+   * 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.
+   * 
+ * + * string input_uri = 1; + */ + com.google.protobuf.ByteString + getInputUriBytes(); + + /** + *
+   * The video data bytes.
+   * If unset, the input video(s) should be specified via `input_uri`.
+   * If set, `input_uri` should be unset.
+   * 
+ * + * bytes input_content = 6; + */ + com.google.protobuf.ByteString getInputContent(); + + /** + *
+   * Requested video annotation features.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + java.util.List getFeaturesList(); + /** + *
+   * Requested video annotation features.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + int getFeaturesCount(); + /** + *
+   * Requested video annotation features.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + com.google.cloud.videointelligence.v1p2beta1.Feature getFeatures(int index); + /** + *
+   * Requested video annotation features.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + java.util.List + getFeaturesValueList(); + /** + *
+   * Requested video annotation features.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Feature features = 2; + */ + int getFeaturesValue(int index); + + /** + *
+   * Additional video context and/or feature-specific parameters.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + boolean hasVideoContext(); + /** + *
+   * Additional video context and/or feature-specific parameters.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoContext getVideoContext(); + /** + *
+   * Additional video context and/or feature-specific parameters.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoContext video_context = 3; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoContextOrBuilder getVideoContextOrBuilder(); + + /** + *
+   * 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).
+   * 
+ * + * string output_uri = 4; + */ + java.lang.String getOutputUri(); + /** + *
+   * 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).
+   * 
+ * + * string output_uri = 4; + */ + com.google.protobuf.ByteString + getOutputUriBytes(); + + /** + *
+   * 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.
+   * 
+ * + * string location_id = 5; + */ + java.lang.String getLocationId(); + /** + *
+   * 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.
+   * 
+ * + * string location_id = 5; + */ + com.google.protobuf.ByteString + getLocationIdBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoResponse.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoResponse.java new file mode 100644 index 000000000000..8e5e4782cc8a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoResponse.java @@ -0,0 +1,863 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Video annotation response. Included in the `response`
+ * field of the `Operation` returned by the `GetOperation`
+ * call of the `google::longrunning::Operations` service.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse} + */ +public final class AnnotateVideoResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse) + AnnotateVideoResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use AnnotateVideoResponse.newBuilder() to construct. + private AnnotateVideoResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AnnotateVideoResponse() { + annotationResults_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AnnotateVideoResponse( + 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: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotationResults_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + annotationResults_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + annotationResults_ = java.util.Collections.unmodifiableList(annotationResults_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.class, com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.Builder.class); + } + + public static final int ANNOTATION_RESULTS_FIELD_NUMBER = 1; + private java.util.List annotationResults_; + /** + *
+   * Annotation results for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public java.util.List getAnnotationResultsList() { + return annotationResults_; + } + /** + *
+   * Annotation results for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public java.util.List + getAnnotationResultsOrBuilderList() { + return annotationResults_; + } + /** + *
+   * Annotation results for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public int getAnnotationResultsCount() { + return annotationResults_.size(); + } + /** + *
+   * Annotation results for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults getAnnotationResults(int index) { + return annotationResults_.get(index); + } + /** + *
+   * Annotation results for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResultsOrBuilder getAnnotationResultsOrBuilder( + int index) { + return annotationResults_.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 { + for (int i = 0; i < annotationResults_.size(); i++) { + output.writeMessage(1, annotationResults_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < annotationResults_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, annotationResults_.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.videointelligence.v1p2beta1.AnnotateVideoResponse)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse other = (com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse) obj; + + boolean result = true; + result = result && getAnnotationResultsList() + .equals(other.getAnnotationResultsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAnnotationResultsCount() > 0) { + hash = (37 * hash) + ANNOTATION_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getAnnotationResultsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse 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.videointelligence.v1p2beta1.AnnotateVideoResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse 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.videointelligence.v1p2beta1.AnnotateVideoResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse 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.videointelligence.v1p2beta1.AnnotateVideoResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse 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.videointelligence.v1p2beta1.AnnotateVideoResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse 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.videointelligence.v1p2beta1.AnnotateVideoResponse 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; + } + /** + *
+   * Video annotation response. Included in the `response`
+   * field of the `Operation` returned by the `GetOperation`
+   * call of the `google::longrunning::Operations` service.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse) + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.class, com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAnnotationResultsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (annotationResultsBuilder_ == null) { + annotationResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + annotationResultsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse build() { + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse result = new com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse(this); + int from_bitField0_ = bitField0_; + if (annotationResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + annotationResults_ = java.util.Collections.unmodifiableList(annotationResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.annotationResults_ = annotationResults_; + } else { + result.annotationResults_ = annotationResultsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.getDefaultInstance()) return this; + if (annotationResultsBuilder_ == null) { + if (!other.annotationResults_.isEmpty()) { + if (annotationResults_.isEmpty()) { + annotationResults_ = other.annotationResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAnnotationResultsIsMutable(); + annotationResults_.addAll(other.annotationResults_); + } + onChanged(); + } + } else { + if (!other.annotationResults_.isEmpty()) { + if (annotationResultsBuilder_.isEmpty()) { + annotationResultsBuilder_.dispose(); + annotationResultsBuilder_ = null; + annotationResults_ = other.annotationResults_; + bitField0_ = (bitField0_ & ~0x00000001); + annotationResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAnnotationResultsFieldBuilder() : null; + } else { + annotationResultsBuilder_.addAllMessages(other.annotationResults_); + } + } + } + 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.videointelligence.v1p2beta1.AnnotateVideoResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List annotationResults_ = + java.util.Collections.emptyList(); + private void ensureAnnotationResultsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + annotationResults_ = new java.util.ArrayList(annotationResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResultsOrBuilder> annotationResultsBuilder_; + + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public java.util.List getAnnotationResultsList() { + if (annotationResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(annotationResults_); + } else { + return annotationResultsBuilder_.getMessageList(); + } + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public int getAnnotationResultsCount() { + if (annotationResultsBuilder_ == null) { + return annotationResults_.size(); + } else { + return annotationResultsBuilder_.getCount(); + } + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults getAnnotationResults(int index) { + if (annotationResultsBuilder_ == null) { + return annotationResults_.get(index); + } else { + return annotationResultsBuilder_.getMessage(index); + } + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public Builder setAnnotationResults( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults value) { + if (annotationResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationResultsIsMutable(); + annotationResults_.set(index, value); + onChanged(); + } else { + annotationResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public Builder setAnnotationResults( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.Builder builderForValue) { + if (annotationResultsBuilder_ == null) { + ensureAnnotationResultsIsMutable(); + annotationResults_.set(index, builderForValue.build()); + onChanged(); + } else { + annotationResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public Builder addAnnotationResults(com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults value) { + if (annotationResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationResultsIsMutable(); + annotationResults_.add(value); + onChanged(); + } else { + annotationResultsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public Builder addAnnotationResults( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults value) { + if (annotationResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAnnotationResultsIsMutable(); + annotationResults_.add(index, value); + onChanged(); + } else { + annotationResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public Builder addAnnotationResults( + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.Builder builderForValue) { + if (annotationResultsBuilder_ == null) { + ensureAnnotationResultsIsMutable(); + annotationResults_.add(builderForValue.build()); + onChanged(); + } else { + annotationResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public Builder addAnnotationResults( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.Builder builderForValue) { + if (annotationResultsBuilder_ == null) { + ensureAnnotationResultsIsMutable(); + annotationResults_.add(index, builderForValue.build()); + onChanged(); + } else { + annotationResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public Builder addAllAnnotationResults( + java.lang.Iterable values) { + if (annotationResultsBuilder_ == null) { + ensureAnnotationResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, annotationResults_); + onChanged(); + } else { + annotationResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public Builder clearAnnotationResults() { + if (annotationResultsBuilder_ == null) { + annotationResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + annotationResultsBuilder_.clear(); + } + return this; + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public Builder removeAnnotationResults(int index) { + if (annotationResultsBuilder_ == null) { + ensureAnnotationResultsIsMutable(); + annotationResults_.remove(index); + onChanged(); + } else { + annotationResultsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.Builder getAnnotationResultsBuilder( + int index) { + return getAnnotationResultsFieldBuilder().getBuilder(index); + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResultsOrBuilder getAnnotationResultsOrBuilder( + int index) { + if (annotationResultsBuilder_ == null) { + return annotationResults_.get(index); } else { + return annotationResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public java.util.List + getAnnotationResultsOrBuilderList() { + if (annotationResultsBuilder_ != null) { + return annotationResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(annotationResults_); + } + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.Builder addAnnotationResultsBuilder() { + return getAnnotationResultsFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.getDefaultInstance()); + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.Builder addAnnotationResultsBuilder( + int index) { + return getAnnotationResultsFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.getDefaultInstance()); + } + /** + *
+     * Annotation results for all videos specified in `AnnotateVideoRequest`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + public java.util.List + getAnnotationResultsBuilderList() { + return getAnnotationResultsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResultsOrBuilder> + getAnnotationResultsFieldBuilder() { + if (annotationResultsBuilder_ == null) { + annotationResultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResultsOrBuilder>( + annotationResults_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + annotationResults_ = null; + } + return annotationResultsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.AnnotateVideoResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse) + private static final com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AnnotateVideoResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AnnotateVideoResponse(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.videointelligence.v1p2beta1.AnnotateVideoResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoResponseOrBuilder.java new file mode 100644 index 000000000000..04695f6ee2b0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/AnnotateVideoResponseOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface AnnotateVideoResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Annotation results for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + java.util.List + getAnnotationResultsList(); + /** + *
+   * Annotation results for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults getAnnotationResults(int index); + /** + *
+   * Annotation results for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + int getAnnotationResultsCount(); + /** + *
+   * Annotation results for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + java.util.List + getAnnotationResultsOrBuilderList(); + /** + *
+   * Annotation results for all videos specified in `AnnotateVideoRequest`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults annotation_results = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResultsOrBuilder getAnnotationResultsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/Entity.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/Entity.java new file mode 100644 index 000000000000..014dc22e121b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/Entity.java @@ -0,0 +1,901 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Detected entity from video analysis.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.Entity} + */ +public final class Entity extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.Entity) + EntityOrBuilder { +private static final long serialVersionUID = 0L; + // Use Entity.newBuilder() to construct. + private Entity(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Entity() { + entityId_ = ""; + description_ = ""; + languageCode_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Entity( + 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: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + languageCode_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_Entity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_Entity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.Entity.class, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder.class); + } + + public static final int ENTITY_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object entityId_; + /** + *
+   * Opaque entity ID. Some IDs may be available in
+   * [Google Knowledge Graph Search
+   * API](https://developers.google.com/knowledge-graph/).
+   * 
+ * + * string entity_id = 1; + */ + 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; + } + } + /** + *
+   * Opaque entity ID. Some IDs may be available in
+   * [Google Knowledge Graph Search
+   * API](https://developers.google.com/knowledge-graph/).
+   * 
+ * + * string entity_id = 1; + */ + 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 DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + *
+   * Textual description, e.g. `Fixed-gear bicycle`.
+   * 
+ * + * string description = 2; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + 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(); + description_ = s; + return s; + } + } + /** + *
+   * Textual description, e.g. `Fixed-gear bicycle`.
+   * 
+ * + * string description = 2; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 3; + private volatile java.lang.Object languageCode_; + /** + *
+   * Language code for `description` in BCP-47 format.
+   * 
+ * + * string language_code = 3; + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + 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(); + languageCode_ = s; + return s; + } + } + /** + *
+   * Language code for `description` in BCP-47 format.
+   * 
+ * + * string language_code = 3; + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getEntityIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, entityId_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (!getLanguageCodeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languageCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getEntityIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, entityId_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (!getLanguageCodeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, languageCode_); + } + 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.videointelligence.v1p2beta1.Entity)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.Entity other = (com.google.cloud.videointelligence.v1p2beta1.Entity) obj; + + boolean result = true; + result = result && getEntityId() + .equals(other.getEntityId()); + result = result && getDescription() + .equals(other.getDescription()); + result = result && getLanguageCode() + .equals(other.getLanguageCode()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.Entity parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.Entity 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.videointelligence.v1p2beta1.Entity parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.Entity 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.videointelligence.v1p2beta1.Entity parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.Entity parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.Entity parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.Entity 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.videointelligence.v1p2beta1.Entity parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.Entity 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.videointelligence.v1p2beta1.Entity parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.Entity 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.videointelligence.v1p2beta1.Entity 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; + } + /** + *
+   * Detected entity from video analysis.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.Entity} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.Entity) + com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_Entity_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_Entity_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.Entity.class, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.Entity.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_ = ""; + + description_ = ""; + + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_Entity_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.Entity getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.Entity.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.Entity build() { + com.google.cloud.videointelligence.v1p2beta1.Entity result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.Entity buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.Entity result = new com.google.cloud.videointelligence.v1p2beta1.Entity(this); + result.entityId_ = entityId_; + result.description_ = description_; + result.languageCode_ = languageCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.Entity) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.Entity)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.Entity other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.Entity.getDefaultInstance()) return this; + if (!other.getEntityId().isEmpty()) { + entityId_ = other.entityId_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + 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.videointelligence.v1p2beta1.Entity parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.Entity) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object entityId_ = ""; + /** + *
+     * Opaque entity ID. Some IDs may be available in
+     * [Google Knowledge Graph Search
+     * API](https://developers.google.com/knowledge-graph/).
+     * 
+ * + * string entity_id = 1; + */ + 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; + } + } + /** + *
+     * Opaque entity ID. Some IDs may be available in
+     * [Google Knowledge Graph Search
+     * API](https://developers.google.com/knowledge-graph/).
+     * 
+ * + * string entity_id = 1; + */ + 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; + } + } + /** + *
+     * Opaque entity ID. Some IDs may be available in
+     * [Google Knowledge Graph Search
+     * API](https://developers.google.com/knowledge-graph/).
+     * 
+ * + * string entity_id = 1; + */ + public Builder setEntityId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + entityId_ = value; + onChanged(); + return this; + } + /** + *
+     * Opaque entity ID. Some IDs may be available in
+     * [Google Knowledge Graph Search
+     * API](https://developers.google.com/knowledge-graph/).
+     * 
+ * + * string entity_id = 1; + */ + public Builder clearEntityId() { + + entityId_ = getDefaultInstance().getEntityId(); + onChanged(); + return this; + } + /** + *
+     * Opaque entity ID. Some IDs may be available in
+     * [Google Knowledge Graph Search
+     * API](https://developers.google.com/knowledge-graph/).
+     * 
+ * + * string entity_id = 1; + */ + public Builder setEntityIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + entityId_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * Textual description, e.g. `Fixed-gear bicycle`.
+     * 
+ * + * string description = 2; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Textual description, e.g. `Fixed-gear bicycle`.
+     * 
+ * + * string description = 2; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Textual description, e.g. `Fixed-gear bicycle`.
+     * 
+ * + * string description = 2; + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * Textual description, e.g. `Fixed-gear bicycle`.
+     * 
+ * + * string description = 2; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * Textual description, e.g. `Fixed-gear bicycle`.
+     * 
+ * + * string description = 2; + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + *
+     * Language code for `description` in BCP-47 format.
+     * 
+ * + * string language_code = 3; + */ + public java.lang.String getLanguageCode() { + java.lang.Object ref = languageCode_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + languageCode_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Language code for `description` in BCP-47 format.
+     * 
+ * + * string language_code = 3; + */ + public com.google.protobuf.ByteString + getLanguageCodeBytes() { + java.lang.Object ref = languageCode_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + languageCode_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Language code for `description` in BCP-47 format.
+     * 
+ * + * string language_code = 3; + */ + public Builder setLanguageCode( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + languageCode_ = value; + onChanged(); + return this; + } + /** + *
+     * Language code for `description` in BCP-47 format.
+     * 
+ * + * string language_code = 3; + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + *
+     * Language code for `description` in BCP-47 format.
+     * 
+ * + * string language_code = 3; + */ + public Builder setLanguageCodeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + languageCode_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.Entity) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.Entity) + private static final com.google.cloud.videointelligence.v1p2beta1.Entity DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.Entity(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.Entity getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Entity parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Entity(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.videointelligence.v1p2beta1.Entity getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/EntityOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/EntityOrBuilder.java new file mode 100644 index 000000000000..2038c4093b60 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/EntityOrBuilder.java @@ -0,0 +1,67 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface EntityOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.Entity) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Opaque entity ID. Some IDs may be available in
+   * [Google Knowledge Graph Search
+   * API](https://developers.google.com/knowledge-graph/).
+   * 
+ * + * string entity_id = 1; + */ + java.lang.String getEntityId(); + /** + *
+   * Opaque entity ID. Some IDs may be available in
+   * [Google Knowledge Graph Search
+   * API](https://developers.google.com/knowledge-graph/).
+   * 
+ * + * string entity_id = 1; + */ + com.google.protobuf.ByteString + getEntityIdBytes(); + + /** + *
+   * Textual description, e.g. `Fixed-gear bicycle`.
+   * 
+ * + * string description = 2; + */ + java.lang.String getDescription(); + /** + *
+   * Textual description, e.g. `Fixed-gear bicycle`.
+   * 
+ * + * string description = 2; + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * Language code for `description` in BCP-47 format.
+   * 
+ * + * string language_code = 3; + */ + java.lang.String getLanguageCode(); + /** + *
+   * Language code for `description` in BCP-47 format.
+   * 
+ * + * string language_code = 3; + */ + com.google.protobuf.ByteString + getLanguageCodeBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentAnnotation.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentAnnotation.java new file mode 100644 index 000000000000..ecc8b18bbcc5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentAnnotation.java @@ -0,0 +1,863 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Explicit content annotation (based on per-frame visual signals only).
+ * If no explicit content has been detected in a frame, no annotations are
+ * present for that frame.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation} + */ +public final class ExplicitContentAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation) + ExplicitContentAnnotationOrBuilder { +private static final long serialVersionUID = 0L; + // Use ExplicitContentAnnotation.newBuilder() to construct. + private ExplicitContentAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ExplicitContentAnnotation() { + frames_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ExplicitContentAnnotation( + 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: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + frames_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + frames_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + frames_ = java.util.Collections.unmodifiableList(frames_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.class, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.Builder.class); + } + + public static final int FRAMES_FIELD_NUMBER = 1; + private java.util.List frames_; + /** + *
+   * All video frames where explicit content was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public java.util.List getFramesList() { + return frames_; + } + /** + *
+   * All video frames where explicit content was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public java.util.List + getFramesOrBuilderList() { + return frames_; + } + /** + *
+   * All video frames where explicit content was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public int getFramesCount() { + return frames_.size(); + } + /** + *
+   * All video frames where explicit content was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame getFrames(int index) { + return frames_.get(index); + } + /** + *
+   * All video frames where explicit content was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrameOrBuilder getFramesOrBuilder( + int index) { + return frames_.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 { + for (int i = 0; i < frames_.size(); i++) { + output.writeMessage(1, frames_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < frames_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, frames_.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.videointelligence.v1p2beta1.ExplicitContentAnnotation)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation other = (com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation) obj; + + boolean result = true; + result = result && getFramesList() + .equals(other.getFramesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFramesCount() > 0) { + hash = (37 * hash) + FRAMES_FIELD_NUMBER; + hash = (53 * hash) + getFramesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation 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.videointelligence.v1p2beta1.ExplicitContentAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation 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.videointelligence.v1p2beta1.ExplicitContentAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation 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.videointelligence.v1p2beta1.ExplicitContentAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation 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.videointelligence.v1p2beta1.ExplicitContentAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation 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.videointelligence.v1p2beta1.ExplicitContentAnnotation 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; + } + /** + *
+   * Explicit content annotation (based on per-frame visual signals only).
+   * If no explicit content has been detected in a frame, no annotations are
+   * present for that frame.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation) + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.class, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getFramesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (framesBuilder_ == null) { + frames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + framesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation build() { + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation result = new com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation(this); + int from_bitField0_ = bitField0_; + if (framesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + frames_ = java.util.Collections.unmodifiableList(frames_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.frames_ = frames_; + } else { + result.frames_ = framesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.getDefaultInstance()) return this; + if (framesBuilder_ == null) { + if (!other.frames_.isEmpty()) { + if (frames_.isEmpty()) { + frames_ = other.frames_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFramesIsMutable(); + frames_.addAll(other.frames_); + } + onChanged(); + } + } else { + if (!other.frames_.isEmpty()) { + if (framesBuilder_.isEmpty()) { + framesBuilder_.dispose(); + framesBuilder_ = null; + frames_ = other.frames_; + bitField0_ = (bitField0_ & ~0x00000001); + framesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFramesFieldBuilder() : null; + } else { + framesBuilder_.addAllMessages(other.frames_); + } + } + } + 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.videointelligence.v1p2beta1.ExplicitContentAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List frames_ = + java.util.Collections.emptyList(); + private void ensureFramesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + frames_ = new java.util.ArrayList(frames_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.Builder, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrameOrBuilder> framesBuilder_; + + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public java.util.List getFramesList() { + if (framesBuilder_ == null) { + return java.util.Collections.unmodifiableList(frames_); + } else { + return framesBuilder_.getMessageList(); + } + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public int getFramesCount() { + if (framesBuilder_ == null) { + return frames_.size(); + } else { + return framesBuilder_.getCount(); + } + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame getFrames(int index) { + if (framesBuilder_ == null) { + return frames_.get(index); + } else { + return framesBuilder_.getMessage(index); + } + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public Builder setFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame value) { + if (framesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFramesIsMutable(); + frames_.set(index, value); + onChanged(); + } else { + framesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public Builder setFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.Builder builderForValue) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.set(index, builderForValue.build()); + onChanged(); + } else { + framesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public Builder addFrames(com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame value) { + if (framesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFramesIsMutable(); + frames_.add(value); + onChanged(); + } else { + framesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public Builder addFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame value) { + if (framesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFramesIsMutable(); + frames_.add(index, value); + onChanged(); + } else { + framesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public Builder addFrames( + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.Builder builderForValue) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.add(builderForValue.build()); + onChanged(); + } else { + framesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public Builder addFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.Builder builderForValue) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.add(index, builderForValue.build()); + onChanged(); + } else { + framesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public Builder addAllFrames( + java.lang.Iterable values) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, frames_); + onChanged(); + } else { + framesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public Builder clearFrames() { + if (framesBuilder_ == null) { + frames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + framesBuilder_.clear(); + } + return this; + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public Builder removeFrames(int index) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.remove(index); + onChanged(); + } else { + framesBuilder_.remove(index); + } + return this; + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.Builder getFramesBuilder( + int index) { + return getFramesFieldBuilder().getBuilder(index); + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrameOrBuilder getFramesOrBuilder( + int index) { + if (framesBuilder_ == null) { + return frames_.get(index); } else { + return framesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public java.util.List + getFramesOrBuilderList() { + if (framesBuilder_ != null) { + return framesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(frames_); + } + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.Builder addFramesBuilder() { + return getFramesFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.getDefaultInstance()); + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.Builder addFramesBuilder( + int index) { + return getFramesFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.getDefaultInstance()); + } + /** + *
+     * All video frames where explicit content was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + public java.util.List + getFramesBuilderList() { + return getFramesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.Builder, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrameOrBuilder> + getFramesFieldBuilder() { + if (framesBuilder_ == null) { + framesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.Builder, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrameOrBuilder>( + frames_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + frames_ = null; + } + return framesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.ExplicitContentAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation) + private static final com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplicitContentAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExplicitContentAnnotation(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.videointelligence.v1p2beta1.ExplicitContentAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentAnnotationOrBuilder.java new file mode 100644 index 000000000000..9ef530ce4187 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentAnnotationOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface ExplicitContentAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * All video frames where explicit content was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + java.util.List + getFramesList(); + /** + *
+   * All video frames where explicit content was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame getFrames(int index); + /** + *
+   * All video frames where explicit content was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + int getFramesCount(); + /** + *
+   * All video frames where explicit content was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + java.util.List + getFramesOrBuilderList(); + /** + *
+   * All video frames where explicit content was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame frames = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrameOrBuilder getFramesOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentDetectionConfig.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentDetectionConfig.java new file mode 100644 index 000000000000..4e0f14ee3898 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentDetectionConfig.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Config for EXPLICIT_CONTENT_DETECTION.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig} + */ +public final class ExplicitContentDetectionConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig) + ExplicitContentDetectionConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use ExplicitContentDetectionConfig.newBuilder() to construct. + private ExplicitContentDetectionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ExplicitContentDetectionConfig() { + model_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ExplicitContentDetectionConfig( + 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(); + + model_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentDetectionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentDetectionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.class, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.Builder.class); + } + + public static final int MODEL_FIELD_NUMBER = 1; + private volatile java.lang.Object model_; + /** + *
+   * Model to use for explicit content detection.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 1; + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + 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(); + model_ = s; + return s; + } + } + /** + *
+   * Model to use for explicit content detection.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 1; + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getModelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, model_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getModelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, model_); + } + 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.videointelligence.v1p2beta1.ExplicitContentDetectionConfig)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig other = (com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig) obj; + + boolean result = true; + result = result && getModel() + .equals(other.getModel()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig 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.videointelligence.v1p2beta1.ExplicitContentDetectionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig 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.videointelligence.v1p2beta1.ExplicitContentDetectionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig 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.videointelligence.v1p2beta1.ExplicitContentDetectionConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig 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.videointelligence.v1p2beta1.ExplicitContentDetectionConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig 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.videointelligence.v1p2beta1.ExplicitContentDetectionConfig 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; + } + /** + *
+   * Config for EXPLICIT_CONTENT_DETECTION.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig) + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentDetectionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentDetectionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.class, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.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(); + model_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentDetectionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig build() { + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig result = new com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig(this); + result.model_ = model_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.getDefaultInstance()) return this; + if (!other.getModel().isEmpty()) { + model_ = other.model_; + onChanged(); + } + 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.videointelligence.v1p2beta1.ExplicitContentDetectionConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object model_ = ""; + /** + *
+     * Model to use for explicit content detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 1; + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Model to use for explicit content detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 1; + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Model to use for explicit content detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 1; + */ + public Builder setModel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + model_ = value; + onChanged(); + return this; + } + /** + *
+     * Model to use for explicit content detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 1; + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + *
+     * Model to use for explicit content detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 1; + */ + public Builder setModelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + model_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.ExplicitContentDetectionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig) + private static final com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplicitContentDetectionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExplicitContentDetectionConfig(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.videointelligence.v1p2beta1.ExplicitContentDetectionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentDetectionConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentDetectionConfigOrBuilder.java new file mode 100644 index 000000000000..000f0bd1a3d5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentDetectionConfigOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface ExplicitContentDetectionConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Model to use for explicit content detection.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 1; + */ + java.lang.String getModel(); + /** + *
+   * Model to use for explicit content detection.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 1; + */ + com.google.protobuf.ByteString + getModelBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentFrame.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentFrame.java new file mode 100644 index 000000000000..38a95482cacb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentFrame.java @@ -0,0 +1,776 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Video frame level annotation results for explicit content.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame} + */ +public final class ExplicitContentFrame extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame) + ExplicitContentFrameOrBuilder { +private static final long serialVersionUID = 0L; + // Use ExplicitContentFrame.newBuilder() to construct. + private ExplicitContentFrame(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ExplicitContentFrame() { + pornographyLikelihood_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ExplicitContentFrame( + 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: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (timeOffset_ != null) { + subBuilder = timeOffset_.toBuilder(); + } + timeOffset_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timeOffset_); + timeOffset_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + int rawValue = input.readEnum(); + + pornographyLikelihood_ = rawValue; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentFrame_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentFrame_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.class, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.Builder.class); + } + + public static final int TIME_OFFSET_FIELD_NUMBER = 1; + private com.google.protobuf.Duration timeOffset_; + /** + *
+   * Time-offset, relative to the beginning of the video, corresponding to the
+   * video frame for this location.
+   * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public boolean hasTimeOffset() { + return timeOffset_ != null; + } + /** + *
+   * Time-offset, relative to the beginning of the video, corresponding to the
+   * video frame for this location.
+   * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public com.google.protobuf.Duration getTimeOffset() { + return timeOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeOffset_; + } + /** + *
+   * Time-offset, relative to the beginning of the video, corresponding to the
+   * video frame for this location.
+   * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public com.google.protobuf.DurationOrBuilder getTimeOffsetOrBuilder() { + return getTimeOffset(); + } + + public static final int PORNOGRAPHY_LIKELIHOOD_FIELD_NUMBER = 2; + private int pornographyLikelihood_; + /** + *
+   * Likelihood of the pornography content..
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Likelihood pornography_likelihood = 2; + */ + public int getPornographyLikelihoodValue() { + return pornographyLikelihood_; + } + /** + *
+   * Likelihood of the pornography content..
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Likelihood pornography_likelihood = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.Likelihood getPornographyLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.videointelligence.v1p2beta1.Likelihood result = com.google.cloud.videointelligence.v1p2beta1.Likelihood.valueOf(pornographyLikelihood_); + return result == null ? com.google.cloud.videointelligence.v1p2beta1.Likelihood.UNRECOGNIZED : result; + } + + 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 (timeOffset_ != null) { + output.writeMessage(1, getTimeOffset()); + } + if (pornographyLikelihood_ != com.google.cloud.videointelligence.v1p2beta1.Likelihood.LIKELIHOOD_UNSPECIFIED.getNumber()) { + output.writeEnum(2, pornographyLikelihood_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (timeOffset_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTimeOffset()); + } + if (pornographyLikelihood_ != com.google.cloud.videointelligence.v1p2beta1.Likelihood.LIKELIHOOD_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, pornographyLikelihood_); + } + 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.videointelligence.v1p2beta1.ExplicitContentFrame)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame other = (com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame) obj; + + boolean result = true; + result = result && (hasTimeOffset() == other.hasTimeOffset()); + if (hasTimeOffset()) { + result = result && getTimeOffset() + .equals(other.getTimeOffset()); + } + result = result && pornographyLikelihood_ == other.pornographyLikelihood_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTimeOffset()) { + hash = (37 * hash) + TIME_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getTimeOffset().hashCode(); + } + hash = (37 * hash) + PORNOGRAPHY_LIKELIHOOD_FIELD_NUMBER; + hash = (53 * hash) + pornographyLikelihood_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame 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.videointelligence.v1p2beta1.ExplicitContentFrame parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame 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.videointelligence.v1p2beta1.ExplicitContentFrame parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame 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.videointelligence.v1p2beta1.ExplicitContentFrame parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame 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.videointelligence.v1p2beta1.ExplicitContentFrame parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame 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.videointelligence.v1p2beta1.ExplicitContentFrame 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; + } + /** + *
+   * Video frame level annotation results for explicit content.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame) + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrameOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentFrame_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentFrame_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.class, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.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(); + if (timeOffsetBuilder_ == null) { + timeOffset_ = null; + } else { + timeOffset_ = null; + timeOffsetBuilder_ = null; + } + pornographyLikelihood_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentFrame_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame build() { + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame result = new com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame(this); + if (timeOffsetBuilder_ == null) { + result.timeOffset_ = timeOffset_; + } else { + result.timeOffset_ = timeOffsetBuilder_.build(); + } + result.pornographyLikelihood_ = pornographyLikelihood_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.getDefaultInstance()) return this; + if (other.hasTimeOffset()) { + mergeTimeOffset(other.getTimeOffset()); + } + if (other.pornographyLikelihood_ != 0) { + setPornographyLikelihoodValue(other.getPornographyLikelihoodValue()); + } + 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.videointelligence.v1p2beta1.ExplicitContentFrame parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Duration timeOffset_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> timeOffsetBuilder_; + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public boolean hasTimeOffset() { + return timeOffsetBuilder_ != null || timeOffset_ != null; + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public com.google.protobuf.Duration getTimeOffset() { + if (timeOffsetBuilder_ == null) { + return timeOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeOffset_; + } else { + return timeOffsetBuilder_.getMessage(); + } + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public Builder setTimeOffset(com.google.protobuf.Duration value) { + if (timeOffsetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeOffset_ = value; + onChanged(); + } else { + timeOffsetBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public Builder setTimeOffset( + com.google.protobuf.Duration.Builder builderForValue) { + if (timeOffsetBuilder_ == null) { + timeOffset_ = builderForValue.build(); + onChanged(); + } else { + timeOffsetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public Builder mergeTimeOffset(com.google.protobuf.Duration value) { + if (timeOffsetBuilder_ == null) { + if (timeOffset_ != null) { + timeOffset_ = + com.google.protobuf.Duration.newBuilder(timeOffset_).mergeFrom(value).buildPartial(); + } else { + timeOffset_ = value; + } + onChanged(); + } else { + timeOffsetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public Builder clearTimeOffset() { + if (timeOffsetBuilder_ == null) { + timeOffset_ = null; + onChanged(); + } else { + timeOffset_ = null; + timeOffsetBuilder_ = null; + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public com.google.protobuf.Duration.Builder getTimeOffsetBuilder() { + + onChanged(); + return getTimeOffsetFieldBuilder().getBuilder(); + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public com.google.protobuf.DurationOrBuilder getTimeOffsetOrBuilder() { + if (timeOffsetBuilder_ != null) { + return timeOffsetBuilder_.getMessageOrBuilder(); + } else { + return timeOffset_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : timeOffset_; + } + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getTimeOffsetFieldBuilder() { + if (timeOffsetBuilder_ == null) { + timeOffsetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getTimeOffset(), + getParentForChildren(), + isClean()); + timeOffset_ = null; + } + return timeOffsetBuilder_; + } + + private int pornographyLikelihood_ = 0; + /** + *
+     * Likelihood of the pornography content..
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Likelihood pornography_likelihood = 2; + */ + public int getPornographyLikelihoodValue() { + return pornographyLikelihood_; + } + /** + *
+     * Likelihood of the pornography content..
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Likelihood pornography_likelihood = 2; + */ + public Builder setPornographyLikelihoodValue(int value) { + pornographyLikelihood_ = value; + onChanged(); + return this; + } + /** + *
+     * Likelihood of the pornography content..
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Likelihood pornography_likelihood = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.Likelihood getPornographyLikelihood() { + @SuppressWarnings("deprecation") + com.google.cloud.videointelligence.v1p2beta1.Likelihood result = com.google.cloud.videointelligence.v1p2beta1.Likelihood.valueOf(pornographyLikelihood_); + return result == null ? com.google.cloud.videointelligence.v1p2beta1.Likelihood.UNRECOGNIZED : result; + } + /** + *
+     * Likelihood of the pornography content..
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Likelihood pornography_likelihood = 2; + */ + public Builder setPornographyLikelihood(com.google.cloud.videointelligence.v1p2beta1.Likelihood value) { + if (value == null) { + throw new NullPointerException(); + } + + pornographyLikelihood_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Likelihood of the pornography content..
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Likelihood pornography_likelihood = 2; + */ + public Builder clearPornographyLikelihood() { + + pornographyLikelihood_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.ExplicitContentFrame) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame) + private static final com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExplicitContentFrame parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExplicitContentFrame(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.videointelligence.v1p2beta1.ExplicitContentFrame getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentFrameOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentFrameOrBuilder.java new file mode 100644 index 000000000000..632b4ab3591b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ExplicitContentFrameOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface ExplicitContentFrameOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Time-offset, relative to the beginning of the video, corresponding to the
+   * video frame for this location.
+   * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + boolean hasTimeOffset(); + /** + *
+   * Time-offset, relative to the beginning of the video, corresponding to the
+   * video frame for this location.
+   * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + com.google.protobuf.Duration getTimeOffset(); + /** + *
+   * Time-offset, relative to the beginning of the video, corresponding to the
+   * video frame for this location.
+   * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + com.google.protobuf.DurationOrBuilder getTimeOffsetOrBuilder(); + + /** + *
+   * Likelihood of the pornography content..
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Likelihood pornography_likelihood = 2; + */ + int getPornographyLikelihoodValue(); + /** + *
+   * Likelihood of the pornography content..
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Likelihood pornography_likelihood = 2; + */ + com.google.cloud.videointelligence.v1p2beta1.Likelihood getPornographyLikelihood(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/Feature.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/Feature.java new file mode 100644 index 000000000000..426574fbb8c2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/Feature.java @@ -0,0 +1,191 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Video annotation feature.
+ * 
+ * + * Protobuf enum {@code google.cloud.videointelligence.v1p2beta1.Feature} + */ +public enum Feature + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Unspecified.
+   * 
+ * + * FEATURE_UNSPECIFIED = 0; + */ + FEATURE_UNSPECIFIED(0), + /** + *
+   * Label detection. Detect objects, such as dog or flower.
+   * 
+ * + * LABEL_DETECTION = 1; + */ + LABEL_DETECTION(1), + /** + *
+   * Shot change detection.
+   * 
+ * + * SHOT_CHANGE_DETECTION = 2; + */ + SHOT_CHANGE_DETECTION(2), + /** + *
+   * Explicit content detection.
+   * 
+ * + * EXPLICIT_CONTENT_DETECTION = 3; + */ + EXPLICIT_CONTENT_DETECTION(3), + /** + *
+   * OCR text detection and tracking.
+   * 
+ * + * TEXT_DETECTION = 7; + */ + TEXT_DETECTION(7), + /** + *
+   * Object detection and tracking.
+   * 
+ * + * OBJECT_TRACKING = 9; + */ + OBJECT_TRACKING(9), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Unspecified.
+   * 
+ * + * FEATURE_UNSPECIFIED = 0; + */ + public static final int FEATURE_UNSPECIFIED_VALUE = 0; + /** + *
+   * Label detection. Detect objects, such as dog or flower.
+   * 
+ * + * LABEL_DETECTION = 1; + */ + public static final int LABEL_DETECTION_VALUE = 1; + /** + *
+   * Shot change detection.
+   * 
+ * + * SHOT_CHANGE_DETECTION = 2; + */ + public static final int SHOT_CHANGE_DETECTION_VALUE = 2; + /** + *
+   * Explicit content detection.
+   * 
+ * + * EXPLICIT_CONTENT_DETECTION = 3; + */ + public static final int EXPLICIT_CONTENT_DETECTION_VALUE = 3; + /** + *
+   * OCR text detection and tracking.
+   * 
+ * + * TEXT_DETECTION = 7; + */ + public static final int TEXT_DETECTION_VALUE = 7; + /** + *
+   * Object detection and tracking.
+   * 
+ * + * OBJECT_TRACKING = 9; + */ + public static final int OBJECT_TRACKING_VALUE = 9; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Feature valueOf(int value) { + return forNumber(value); + } + + public static Feature forNumber(int value) { + switch (value) { + case 0: return FEATURE_UNSPECIFIED; + case 1: return LABEL_DETECTION; + case 2: return SHOT_CHANGE_DETECTION; + case 3: return EXPLICIT_CONTENT_DETECTION; + case 7: return TEXT_DETECTION; + case 9: return OBJECT_TRACKING; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Feature> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Feature findValueByNumber(int number) { + return Feature.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Feature[] VALUES = values(); + + public static Feature valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Feature(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.videointelligence.v1p2beta1.Feature) +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelAnnotation.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelAnnotation.java new file mode 100644 index 000000000000..c873be51e742 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelAnnotation.java @@ -0,0 +1,2030 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Label annotation.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.LabelAnnotation} + */ +public final class LabelAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.LabelAnnotation) + LabelAnnotationOrBuilder { +private static final long serialVersionUID = 0L; + // Use LabelAnnotation.newBuilder() to construct. + private LabelAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LabelAnnotation() { + categoryEntities_ = java.util.Collections.emptyList(); + segments_ = java.util.Collections.emptyList(); + frames_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LabelAnnotation( + 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: { + com.google.cloud.videointelligence.v1p2beta1.Entity.Builder subBuilder = null; + if (entity_ != null) { + subBuilder = entity_.toBuilder(); + } + entity_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.Entity.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(entity_); + entity_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + categoryEntities_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + categoryEntities_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.Entity.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + segments_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + segments_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.LabelSegment.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + frames_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + frames_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.LabelFrame.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + categoryEntities_ = java.util.Collections.unmodifiableList(categoryEntities_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + segments_ = java.util.Collections.unmodifiableList(segments_); + } + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + frames_ = java.util.Collections.unmodifiableList(frames_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.class, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder.class); + } + + private int bitField0_; + public static final int ENTITY_FIELD_NUMBER = 1; + private com.google.cloud.videointelligence.v1p2beta1.Entity entity_; + /** + *
+   * Detected entity.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public boolean hasEntity() { + return entity_ != null; + } + /** + *
+   * Detected entity.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.Entity getEntity() { + return entity_ == null ? com.google.cloud.videointelligence.v1p2beta1.Entity.getDefaultInstance() : entity_; + } + /** + *
+   * Detected entity.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder getEntityOrBuilder() { + return getEntity(); + } + + public static final int CATEGORY_ENTITIES_FIELD_NUMBER = 2; + private java.util.List categoryEntities_; + /** + *
+   * Common categories for the detected entity.
+   * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+   * cases there might be more than one categories e.g. `Terrier` could also be
+   * a `pet`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public java.util.List getCategoryEntitiesList() { + return categoryEntities_; + } + /** + *
+   * Common categories for the detected entity.
+   * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+   * cases there might be more than one categories e.g. `Terrier` could also be
+   * a `pet`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public java.util.List + getCategoryEntitiesOrBuilderList() { + return categoryEntities_; + } + /** + *
+   * Common categories for the detected entity.
+   * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+   * cases there might be more than one categories e.g. `Terrier` could also be
+   * a `pet`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public int getCategoryEntitiesCount() { + return categoryEntities_.size(); + } + /** + *
+   * Common categories for the detected entity.
+   * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+   * cases there might be more than one categories e.g. `Terrier` could also be
+   * a `pet`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.Entity getCategoryEntities(int index) { + return categoryEntities_.get(index); + } + /** + *
+   * Common categories for the detected entity.
+   * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+   * cases there might be more than one categories e.g. `Terrier` could also be
+   * a `pet`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder getCategoryEntitiesOrBuilder( + int index) { + return categoryEntities_.get(index); + } + + public static final int SEGMENTS_FIELD_NUMBER = 3; + private java.util.List segments_; + /** + *
+   * All video segments where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public java.util.List getSegmentsList() { + return segments_; + } + /** + *
+   * All video segments where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public java.util.List + getSegmentsOrBuilderList() { + return segments_; + } + /** + *
+   * All video segments where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public int getSegmentsCount() { + return segments_.size(); + } + /** + *
+   * All video segments where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelSegment getSegments(int index) { + return segments_.get(index); + } + /** + *
+   * All video segments where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelSegmentOrBuilder getSegmentsOrBuilder( + int index) { + return segments_.get(index); + } + + public static final int FRAMES_FIELD_NUMBER = 4; + private java.util.List frames_; + /** + *
+   * All video frames where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public java.util.List getFramesList() { + return frames_; + } + /** + *
+   * All video frames where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public java.util.List + getFramesOrBuilderList() { + return frames_; + } + /** + *
+   * All video frames where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public int getFramesCount() { + return frames_.size(); + } + /** + *
+   * All video frames where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelFrame getFrames(int index) { + return frames_.get(index); + } + /** + *
+   * All video frames where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelFrameOrBuilder getFramesOrBuilder( + int index) { + return frames_.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 (entity_ != null) { + output.writeMessage(1, getEntity()); + } + for (int i = 0; i < categoryEntities_.size(); i++) { + output.writeMessage(2, categoryEntities_.get(i)); + } + for (int i = 0; i < segments_.size(); i++) { + output.writeMessage(3, segments_.get(i)); + } + for (int i = 0; i < frames_.size(); i++) { + output.writeMessage(4, frames_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (entity_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEntity()); + } + for (int i = 0; i < categoryEntities_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, categoryEntities_.get(i)); + } + for (int i = 0; i < segments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, segments_.get(i)); + } + for (int i = 0; i < frames_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, frames_.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.videointelligence.v1p2beta1.LabelAnnotation)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation other = (com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation) obj; + + boolean result = true; + result = result && (hasEntity() == other.hasEntity()); + if (hasEntity()) { + result = result && getEntity() + .equals(other.getEntity()); + } + result = result && getCategoryEntitiesList() + .equals(other.getCategoryEntitiesList()); + result = result && getSegmentsList() + .equals(other.getSegmentsList()); + result = result && getFramesList() + .equals(other.getFramesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEntity()) { + hash = (37 * hash) + ENTITY_FIELD_NUMBER; + hash = (53 * hash) + getEntity().hashCode(); + } + if (getCategoryEntitiesCount() > 0) { + hash = (37 * hash) + CATEGORY_ENTITIES_FIELD_NUMBER; + hash = (53 * hash) + getCategoryEntitiesList().hashCode(); + } + if (getSegmentsCount() > 0) { + hash = (37 * hash) + SEGMENTS_FIELD_NUMBER; + hash = (53 * hash) + getSegmentsList().hashCode(); + } + if (getFramesCount() > 0) { + hash = (37 * hash) + FRAMES_FIELD_NUMBER; + hash = (53 * hash) + getFramesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation 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.videointelligence.v1p2beta1.LabelAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation 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.videointelligence.v1p2beta1.LabelAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation 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.videointelligence.v1p2beta1.LabelAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation 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.videointelligence.v1p2beta1.LabelAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation 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.videointelligence.v1p2beta1.LabelAnnotation 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; + } + /** + *
+   * Label annotation.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.LabelAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.LabelAnnotation) + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.class, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getCategoryEntitiesFieldBuilder(); + getSegmentsFieldBuilder(); + getFramesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (entityBuilder_ == null) { + entity_ = null; + } else { + entity_ = null; + entityBuilder_ = null; + } + if (categoryEntitiesBuilder_ == null) { + categoryEntities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + categoryEntitiesBuilder_.clear(); + } + if (segmentsBuilder_ == null) { + segments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + segmentsBuilder_.clear(); + } + if (framesBuilder_ == null) { + frames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + framesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation build() { + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation result = new com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (entityBuilder_ == null) { + result.entity_ = entity_; + } else { + result.entity_ = entityBuilder_.build(); + } + if (categoryEntitiesBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + categoryEntities_ = java.util.Collections.unmodifiableList(categoryEntities_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.categoryEntities_ = categoryEntities_; + } else { + result.categoryEntities_ = categoryEntitiesBuilder_.build(); + } + if (segmentsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + segments_ = java.util.Collections.unmodifiableList(segments_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.segments_ = segments_; + } else { + result.segments_ = segmentsBuilder_.build(); + } + if (framesBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + frames_ = java.util.Collections.unmodifiableList(frames_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.frames_ = frames_; + } else { + result.frames_ = framesBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.getDefaultInstance()) return this; + if (other.hasEntity()) { + mergeEntity(other.getEntity()); + } + if (categoryEntitiesBuilder_ == null) { + if (!other.categoryEntities_.isEmpty()) { + if (categoryEntities_.isEmpty()) { + categoryEntities_ = other.categoryEntities_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureCategoryEntitiesIsMutable(); + categoryEntities_.addAll(other.categoryEntities_); + } + onChanged(); + } + } else { + if (!other.categoryEntities_.isEmpty()) { + if (categoryEntitiesBuilder_.isEmpty()) { + categoryEntitiesBuilder_.dispose(); + categoryEntitiesBuilder_ = null; + categoryEntities_ = other.categoryEntities_; + bitField0_ = (bitField0_ & ~0x00000002); + categoryEntitiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getCategoryEntitiesFieldBuilder() : null; + } else { + categoryEntitiesBuilder_.addAllMessages(other.categoryEntities_); + } + } + } + if (segmentsBuilder_ == null) { + if (!other.segments_.isEmpty()) { + if (segments_.isEmpty()) { + segments_ = other.segments_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureSegmentsIsMutable(); + segments_.addAll(other.segments_); + } + onChanged(); + } + } else { + if (!other.segments_.isEmpty()) { + if (segmentsBuilder_.isEmpty()) { + segmentsBuilder_.dispose(); + segmentsBuilder_ = null; + segments_ = other.segments_; + bitField0_ = (bitField0_ & ~0x00000004); + segmentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSegmentsFieldBuilder() : null; + } else { + segmentsBuilder_.addAllMessages(other.segments_); + } + } + } + if (framesBuilder_ == null) { + if (!other.frames_.isEmpty()) { + if (frames_.isEmpty()) { + frames_ = other.frames_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureFramesIsMutable(); + frames_.addAll(other.frames_); + } + onChanged(); + } + } else { + if (!other.frames_.isEmpty()) { + if (framesBuilder_.isEmpty()) { + framesBuilder_.dispose(); + framesBuilder_ = null; + frames_ = other.frames_; + bitField0_ = (bitField0_ & ~0x00000008); + framesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFramesFieldBuilder() : null; + } else { + framesBuilder_.addAllMessages(other.frames_); + } + } + } + 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.videointelligence.v1p2beta1.LabelAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.videointelligence.v1p2beta1.Entity entity_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.Entity, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder, com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder> entityBuilder_; + /** + *
+     * Detected entity.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public boolean hasEntity() { + return entityBuilder_ != null || entity_ != null; + } + /** + *
+     * Detected entity.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.Entity getEntity() { + if (entityBuilder_ == null) { + return entity_ == null ? com.google.cloud.videointelligence.v1p2beta1.Entity.getDefaultInstance() : entity_; + } else { + return entityBuilder_.getMessage(); + } + } + /** + *
+     * Detected entity.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public Builder setEntity(com.google.cloud.videointelligence.v1p2beta1.Entity value) { + if (entityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + entity_ = value; + onChanged(); + } else { + entityBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Detected entity.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public Builder setEntity( + com.google.cloud.videointelligence.v1p2beta1.Entity.Builder builderForValue) { + if (entityBuilder_ == null) { + entity_ = builderForValue.build(); + onChanged(); + } else { + entityBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Detected entity.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public Builder mergeEntity(com.google.cloud.videointelligence.v1p2beta1.Entity value) { + if (entityBuilder_ == null) { + if (entity_ != null) { + entity_ = + com.google.cloud.videointelligence.v1p2beta1.Entity.newBuilder(entity_).mergeFrom(value).buildPartial(); + } else { + entity_ = value; + } + onChanged(); + } else { + entityBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Detected entity.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public Builder clearEntity() { + if (entityBuilder_ == null) { + entity_ = null; + onChanged(); + } else { + entity_ = null; + entityBuilder_ = null; + } + + return this; + } + /** + *
+     * Detected entity.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.Entity.Builder getEntityBuilder() { + + onChanged(); + return getEntityFieldBuilder().getBuilder(); + } + /** + *
+     * Detected entity.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder getEntityOrBuilder() { + if (entityBuilder_ != null) { + return entityBuilder_.getMessageOrBuilder(); + } else { + return entity_ == null ? + com.google.cloud.videointelligence.v1p2beta1.Entity.getDefaultInstance() : entity_; + } + } + /** + *
+     * Detected entity.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.Entity, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder, com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder> + getEntityFieldBuilder() { + if (entityBuilder_ == null) { + entityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.Entity, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder, com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder>( + getEntity(), + getParentForChildren(), + isClean()); + entity_ = null; + } + return entityBuilder_; + } + + private java.util.List categoryEntities_ = + java.util.Collections.emptyList(); + private void ensureCategoryEntitiesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + categoryEntities_ = new java.util.ArrayList(categoryEntities_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.Entity, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder, com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder> categoryEntitiesBuilder_; + + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public java.util.List getCategoryEntitiesList() { + if (categoryEntitiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(categoryEntities_); + } else { + return categoryEntitiesBuilder_.getMessageList(); + } + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public int getCategoryEntitiesCount() { + if (categoryEntitiesBuilder_ == null) { + return categoryEntities_.size(); + } else { + return categoryEntitiesBuilder_.getCount(); + } + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.Entity getCategoryEntities(int index) { + if (categoryEntitiesBuilder_ == null) { + return categoryEntities_.get(index); + } else { + return categoryEntitiesBuilder_.getMessage(index); + } + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public Builder setCategoryEntities( + int index, com.google.cloud.videointelligence.v1p2beta1.Entity value) { + if (categoryEntitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoryEntitiesIsMutable(); + categoryEntities_.set(index, value); + onChanged(); + } else { + categoryEntitiesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public Builder setCategoryEntities( + int index, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder builderForValue) { + if (categoryEntitiesBuilder_ == null) { + ensureCategoryEntitiesIsMutable(); + categoryEntities_.set(index, builderForValue.build()); + onChanged(); + } else { + categoryEntitiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public Builder addCategoryEntities(com.google.cloud.videointelligence.v1p2beta1.Entity value) { + if (categoryEntitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoryEntitiesIsMutable(); + categoryEntities_.add(value); + onChanged(); + } else { + categoryEntitiesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public Builder addCategoryEntities( + int index, com.google.cloud.videointelligence.v1p2beta1.Entity value) { + if (categoryEntitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoryEntitiesIsMutable(); + categoryEntities_.add(index, value); + onChanged(); + } else { + categoryEntitiesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public Builder addCategoryEntities( + com.google.cloud.videointelligence.v1p2beta1.Entity.Builder builderForValue) { + if (categoryEntitiesBuilder_ == null) { + ensureCategoryEntitiesIsMutable(); + categoryEntities_.add(builderForValue.build()); + onChanged(); + } else { + categoryEntitiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public Builder addCategoryEntities( + int index, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder builderForValue) { + if (categoryEntitiesBuilder_ == null) { + ensureCategoryEntitiesIsMutable(); + categoryEntities_.add(index, builderForValue.build()); + onChanged(); + } else { + categoryEntitiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public Builder addAllCategoryEntities( + java.lang.Iterable values) { + if (categoryEntitiesBuilder_ == null) { + ensureCategoryEntitiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, categoryEntities_); + onChanged(); + } else { + categoryEntitiesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public Builder clearCategoryEntities() { + if (categoryEntitiesBuilder_ == null) { + categoryEntities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + categoryEntitiesBuilder_.clear(); + } + return this; + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public Builder removeCategoryEntities(int index) { + if (categoryEntitiesBuilder_ == null) { + ensureCategoryEntitiesIsMutable(); + categoryEntities_.remove(index); + onChanged(); + } else { + categoryEntitiesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.Entity.Builder getCategoryEntitiesBuilder( + int index) { + return getCategoryEntitiesFieldBuilder().getBuilder(index); + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder getCategoryEntitiesOrBuilder( + int index) { + if (categoryEntitiesBuilder_ == null) { + return categoryEntities_.get(index); } else { + return categoryEntitiesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public java.util.List + getCategoryEntitiesOrBuilderList() { + if (categoryEntitiesBuilder_ != null) { + return categoryEntitiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(categoryEntities_); + } + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.Entity.Builder addCategoryEntitiesBuilder() { + return getCategoryEntitiesFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.Entity.getDefaultInstance()); + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.Entity.Builder addCategoryEntitiesBuilder( + int index) { + return getCategoryEntitiesFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.Entity.getDefaultInstance()); + } + /** + *
+     * Common categories for the detected entity.
+     * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+     * cases there might be more than one categories e.g. `Terrier` could also be
+     * a `pet`.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + public java.util.List + getCategoryEntitiesBuilderList() { + return getCategoryEntitiesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.Entity, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder, com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder> + getCategoryEntitiesFieldBuilder() { + if (categoryEntitiesBuilder_ == null) { + categoryEntitiesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.Entity, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder, com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder>( + categoryEntities_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + categoryEntities_ = null; + } + return categoryEntitiesBuilder_; + } + + private java.util.List segments_ = + java.util.Collections.emptyList(); + private void ensureSegmentsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + segments_ = new java.util.ArrayList(segments_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelSegment, com.google.cloud.videointelligence.v1p2beta1.LabelSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelSegmentOrBuilder> segmentsBuilder_; + + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public java.util.List getSegmentsList() { + if (segmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(segments_); + } else { + return segmentsBuilder_.getMessageList(); + } + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public int getSegmentsCount() { + if (segmentsBuilder_ == null) { + return segments_.size(); + } else { + return segmentsBuilder_.getCount(); + } + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelSegment getSegments(int index) { + if (segmentsBuilder_ == null) { + return segments_.get(index); + } else { + return segmentsBuilder_.getMessage(index); + } + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public Builder setSegments( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelSegment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.set(index, value); + onChanged(); + } else { + segmentsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public Builder setSegments( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelSegment.Builder builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.set(index, builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public Builder addSegments(com.google.cloud.videointelligence.v1p2beta1.LabelSegment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.add(value); + onChanged(); + } else { + segmentsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public Builder addSegments( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelSegment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.add(index, value); + onChanged(); + } else { + segmentsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public Builder addSegments( + com.google.cloud.videointelligence.v1p2beta1.LabelSegment.Builder builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public Builder addSegments( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelSegment.Builder builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(index, builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public Builder addAllSegments( + java.lang.Iterable values) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, segments_); + onChanged(); + } else { + segmentsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public Builder clearSegments() { + if (segmentsBuilder_ == null) { + segments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + segmentsBuilder_.clear(); + } + return this; + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public Builder removeSegments(int index) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.remove(index); + onChanged(); + } else { + segmentsBuilder_.remove(index); + } + return this; + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelSegment.Builder getSegmentsBuilder( + int index) { + return getSegmentsFieldBuilder().getBuilder(index); + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelSegmentOrBuilder getSegmentsOrBuilder( + int index) { + if (segmentsBuilder_ == null) { + return segments_.get(index); } else { + return segmentsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public java.util.List + getSegmentsOrBuilderList() { + if (segmentsBuilder_ != null) { + return segmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(segments_); + } + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelSegment.Builder addSegmentsBuilder() { + return getSegmentsFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.LabelSegment.getDefaultInstance()); + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelSegment.Builder addSegmentsBuilder( + int index) { + return getSegmentsFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.LabelSegment.getDefaultInstance()); + } + /** + *
+     * All video segments where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + public java.util.List + getSegmentsBuilderList() { + return getSegmentsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelSegment, com.google.cloud.videointelligence.v1p2beta1.LabelSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelSegmentOrBuilder> + getSegmentsFieldBuilder() { + if (segmentsBuilder_ == null) { + segmentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelSegment, com.google.cloud.videointelligence.v1p2beta1.LabelSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelSegmentOrBuilder>( + segments_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + segments_ = null; + } + return segmentsBuilder_; + } + + private java.util.List frames_ = + java.util.Collections.emptyList(); + private void ensureFramesIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + frames_ = new java.util.ArrayList(frames_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelFrame, com.google.cloud.videointelligence.v1p2beta1.LabelFrame.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelFrameOrBuilder> framesBuilder_; + + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public java.util.List getFramesList() { + if (framesBuilder_ == null) { + return java.util.Collections.unmodifiableList(frames_); + } else { + return framesBuilder_.getMessageList(); + } + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public int getFramesCount() { + if (framesBuilder_ == null) { + return frames_.size(); + } else { + return framesBuilder_.getCount(); + } + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelFrame getFrames(int index) { + if (framesBuilder_ == null) { + return frames_.get(index); + } else { + return framesBuilder_.getMessage(index); + } + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public Builder setFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelFrame value) { + if (framesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFramesIsMutable(); + frames_.set(index, value); + onChanged(); + } else { + framesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public Builder setFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelFrame.Builder builderForValue) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.set(index, builderForValue.build()); + onChanged(); + } else { + framesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public Builder addFrames(com.google.cloud.videointelligence.v1p2beta1.LabelFrame value) { + if (framesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFramesIsMutable(); + frames_.add(value); + onChanged(); + } else { + framesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public Builder addFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelFrame value) { + if (framesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFramesIsMutable(); + frames_.add(index, value); + onChanged(); + } else { + framesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public Builder addFrames( + com.google.cloud.videointelligence.v1p2beta1.LabelFrame.Builder builderForValue) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.add(builderForValue.build()); + onChanged(); + } else { + framesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public Builder addFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelFrame.Builder builderForValue) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.add(index, builderForValue.build()); + onChanged(); + } else { + framesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public Builder addAllFrames( + java.lang.Iterable values) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, frames_); + onChanged(); + } else { + framesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public Builder clearFrames() { + if (framesBuilder_ == null) { + frames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + framesBuilder_.clear(); + } + return this; + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public Builder removeFrames(int index) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.remove(index); + onChanged(); + } else { + framesBuilder_.remove(index); + } + return this; + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelFrame.Builder getFramesBuilder( + int index) { + return getFramesFieldBuilder().getBuilder(index); + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelFrameOrBuilder getFramesOrBuilder( + int index) { + if (framesBuilder_ == null) { + return frames_.get(index); } else { + return framesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public java.util.List + getFramesOrBuilderList() { + if (framesBuilder_ != null) { + return framesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(frames_); + } + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelFrame.Builder addFramesBuilder() { + return getFramesFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.LabelFrame.getDefaultInstance()); + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelFrame.Builder addFramesBuilder( + int index) { + return getFramesFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.LabelFrame.getDefaultInstance()); + } + /** + *
+     * All video frames where a label was detected.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + public java.util.List + getFramesBuilderList() { + return getFramesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelFrame, com.google.cloud.videointelligence.v1p2beta1.LabelFrame.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelFrameOrBuilder> + getFramesFieldBuilder() { + if (framesBuilder_ == null) { + framesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelFrame, com.google.cloud.videointelligence.v1p2beta1.LabelFrame.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelFrameOrBuilder>( + frames_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + frames_ = null; + } + return framesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.LabelAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.LabelAnnotation) + private static final com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LabelAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LabelAnnotation(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.videointelligence.v1p2beta1.LabelAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelAnnotationOrBuilder.java new file mode 100644 index 000000000000..ef748ecb4e65 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelAnnotationOrBuilder.java @@ -0,0 +1,181 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface LabelAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.LabelAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Detected entity.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + boolean hasEntity(); + /** + *
+   * Detected entity.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.Entity getEntity(); + /** + *
+   * Detected entity.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder getEntityOrBuilder(); + + /** + *
+   * Common categories for the detected entity.
+   * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+   * cases there might be more than one categories e.g. `Terrier` could also be
+   * a `pet`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + java.util.List + getCategoryEntitiesList(); + /** + *
+   * Common categories for the detected entity.
+   * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+   * cases there might be more than one categories e.g. `Terrier` could also be
+   * a `pet`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + com.google.cloud.videointelligence.v1p2beta1.Entity getCategoryEntities(int index); + /** + *
+   * Common categories for the detected entity.
+   * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+   * cases there might be more than one categories e.g. `Terrier` could also be
+   * a `pet`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + int getCategoryEntitiesCount(); + /** + *
+   * Common categories for the detected entity.
+   * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+   * cases there might be more than one categories e.g. `Terrier` could also be
+   * a `pet`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + java.util.List + getCategoryEntitiesOrBuilderList(); + /** + *
+   * Common categories for the detected entity.
+   * E.g. when the label is `Terrier` the category is likely `dog`. And in some
+   * cases there might be more than one categories e.g. `Terrier` could also be
+   * a `pet`.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.Entity category_entities = 2; + */ + com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder getCategoryEntitiesOrBuilder( + int index); + + /** + *
+   * All video segments where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + java.util.List + getSegmentsList(); + /** + *
+   * All video segments where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelSegment getSegments(int index); + /** + *
+   * All video segments where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + int getSegmentsCount(); + /** + *
+   * All video segments where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + java.util.List + getSegmentsOrBuilderList(); + /** + *
+   * All video segments where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelSegment segments = 3; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelSegmentOrBuilder getSegmentsOrBuilder( + int index); + + /** + *
+   * All video frames where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + java.util.List + getFramesList(); + /** + *
+   * All video frames where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelFrame getFrames(int index); + /** + *
+   * All video frames where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + int getFramesCount(); + /** + *
+   * All video frames where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + java.util.List + getFramesOrBuilderList(); + /** + *
+   * All video frames where a label was detected.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelFrame frames = 4; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelFrameOrBuilder getFramesOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelDetectionConfig.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelDetectionConfig.java new file mode 100644 index 000000000000..428b681f7e71 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelDetectionConfig.java @@ -0,0 +1,801 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Config for LABEL_DETECTION.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig} + */ +public final class LabelDetectionConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig) + LabelDetectionConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use LabelDetectionConfig.newBuilder() to construct. + private LabelDetectionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LabelDetectionConfig() { + labelDetectionMode_ = 0; + stationaryCamera_ = false; + model_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LabelDetectionConfig( + 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 8: { + int rawValue = input.readEnum(); + + labelDetectionMode_ = rawValue; + break; + } + case 16: { + + stationaryCamera_ = input.readBool(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + model_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelDetectionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelDetectionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.class, com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.Builder.class); + } + + public static final int LABEL_DETECTION_MODE_FIELD_NUMBER = 1; + private int labelDetectionMode_; + /** + *
+   * What labels should be detected with LABEL_DETECTION, in addition to
+   * video-level labels or segment-level labels.
+   * If unspecified, defaults to `SHOT_MODE`.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionMode label_detection_mode = 1; + */ + public int getLabelDetectionModeValue() { + return labelDetectionMode_; + } + /** + *
+   * What labels should be detected with LABEL_DETECTION, in addition to
+   * video-level labels or segment-level labels.
+   * If unspecified, defaults to `SHOT_MODE`.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionMode label_detection_mode = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode getLabelDetectionMode() { + @SuppressWarnings("deprecation") + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode result = com.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode.valueOf(labelDetectionMode_); + return result == null ? com.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode.UNRECOGNIZED : result; + } + + public static final int STATIONARY_CAMERA_FIELD_NUMBER = 2; + private boolean stationaryCamera_; + /** + *
+   * Whether the video has been shot from a stationary (i.e. non-moving) camera.
+   * When set to true, might improve detection accuracy for moving objects.
+   * Should be used with `SHOT_AND_FRAME_MODE` enabled.
+   * 
+ * + * bool stationary_camera = 2; + */ + public boolean getStationaryCamera() { + return stationaryCamera_; + } + + public static final int MODEL_FIELD_NUMBER = 3; + private volatile java.lang.Object model_; + /** + *
+   * Model to use for label detection.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 3; + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + 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(); + model_ = s; + return s; + } + } + /** + *
+   * Model to use for label detection.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 3; + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (labelDetectionMode_ != com.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode.LABEL_DETECTION_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, labelDetectionMode_); + } + if (stationaryCamera_ != false) { + output.writeBool(2, stationaryCamera_); + } + if (!getModelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, model_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (labelDetectionMode_ != com.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode.LABEL_DETECTION_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, labelDetectionMode_); + } + if (stationaryCamera_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, stationaryCamera_); + } + if (!getModelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, model_); + } + 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.videointelligence.v1p2beta1.LabelDetectionConfig)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig other = (com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig) obj; + + boolean result = true; + result = result && labelDetectionMode_ == other.labelDetectionMode_; + result = result && (getStationaryCamera() + == other.getStationaryCamera()); + result = result && getModel() + .equals(other.getModel()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LABEL_DETECTION_MODE_FIELD_NUMBER; + hash = (53 * hash) + labelDetectionMode_; + hash = (37 * hash) + STATIONARY_CAMERA_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getStationaryCamera()); + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig 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.videointelligence.v1p2beta1.LabelDetectionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig 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.videointelligence.v1p2beta1.LabelDetectionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig 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.videointelligence.v1p2beta1.LabelDetectionConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig 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.videointelligence.v1p2beta1.LabelDetectionConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig 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.videointelligence.v1p2beta1.LabelDetectionConfig 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; + } + /** + *
+   * Config for LABEL_DETECTION.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig) + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelDetectionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelDetectionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.class, com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.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(); + labelDetectionMode_ = 0; + + stationaryCamera_ = false; + + model_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelDetectionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig build() { + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig result = new com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig(this); + result.labelDetectionMode_ = labelDetectionMode_; + result.stationaryCamera_ = stationaryCamera_; + result.model_ = model_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.getDefaultInstance()) return this; + if (other.labelDetectionMode_ != 0) { + setLabelDetectionModeValue(other.getLabelDetectionModeValue()); + } + if (other.getStationaryCamera() != false) { + setStationaryCamera(other.getStationaryCamera()); + } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + onChanged(); + } + 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.videointelligence.v1p2beta1.LabelDetectionConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int labelDetectionMode_ = 0; + /** + *
+     * What labels should be detected with LABEL_DETECTION, in addition to
+     * video-level labels or segment-level labels.
+     * If unspecified, defaults to `SHOT_MODE`.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionMode label_detection_mode = 1; + */ + public int getLabelDetectionModeValue() { + return labelDetectionMode_; + } + /** + *
+     * What labels should be detected with LABEL_DETECTION, in addition to
+     * video-level labels or segment-level labels.
+     * If unspecified, defaults to `SHOT_MODE`.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionMode label_detection_mode = 1; + */ + public Builder setLabelDetectionModeValue(int value) { + labelDetectionMode_ = value; + onChanged(); + return this; + } + /** + *
+     * What labels should be detected with LABEL_DETECTION, in addition to
+     * video-level labels or segment-level labels.
+     * If unspecified, defaults to `SHOT_MODE`.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionMode label_detection_mode = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode getLabelDetectionMode() { + @SuppressWarnings("deprecation") + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode result = com.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode.valueOf(labelDetectionMode_); + return result == null ? com.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode.UNRECOGNIZED : result; + } + /** + *
+     * What labels should be detected with LABEL_DETECTION, in addition to
+     * video-level labels or segment-level labels.
+     * If unspecified, defaults to `SHOT_MODE`.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionMode label_detection_mode = 1; + */ + public Builder setLabelDetectionMode(com.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode value) { + if (value == null) { + throw new NullPointerException(); + } + + labelDetectionMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * What labels should be detected with LABEL_DETECTION, in addition to
+     * video-level labels or segment-level labels.
+     * If unspecified, defaults to `SHOT_MODE`.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionMode label_detection_mode = 1; + */ + public Builder clearLabelDetectionMode() { + + labelDetectionMode_ = 0; + onChanged(); + return this; + } + + private boolean stationaryCamera_ ; + /** + *
+     * Whether the video has been shot from a stationary (i.e. non-moving) camera.
+     * When set to true, might improve detection accuracy for moving objects.
+     * Should be used with `SHOT_AND_FRAME_MODE` enabled.
+     * 
+ * + * bool stationary_camera = 2; + */ + public boolean getStationaryCamera() { + return stationaryCamera_; + } + /** + *
+     * Whether the video has been shot from a stationary (i.e. non-moving) camera.
+     * When set to true, might improve detection accuracy for moving objects.
+     * Should be used with `SHOT_AND_FRAME_MODE` enabled.
+     * 
+ * + * bool stationary_camera = 2; + */ + public Builder setStationaryCamera(boolean value) { + + stationaryCamera_ = value; + onChanged(); + return this; + } + /** + *
+     * Whether the video has been shot from a stationary (i.e. non-moving) camera.
+     * When set to true, might improve detection accuracy for moving objects.
+     * Should be used with `SHOT_AND_FRAME_MODE` enabled.
+     * 
+ * + * bool stationary_camera = 2; + */ + public Builder clearStationaryCamera() { + + stationaryCamera_ = false; + onChanged(); + return this; + } + + private java.lang.Object model_ = ""; + /** + *
+     * Model to use for label detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 3; + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Model to use for label detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 3; + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Model to use for label detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 3; + */ + public Builder setModel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + model_ = value; + onChanged(); + return this; + } + /** + *
+     * Model to use for label detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 3; + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + *
+     * Model to use for label detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 3; + */ + public Builder setModelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + model_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.LabelDetectionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig) + private static final com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LabelDetectionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LabelDetectionConfig(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.videointelligence.v1p2beta1.LabelDetectionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelDetectionConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelDetectionConfigOrBuilder.java new file mode 100644 index 000000000000..8b4fdf55f842 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelDetectionConfigOrBuilder.java @@ -0,0 +1,63 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface LabelDetectionConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * What labels should be detected with LABEL_DETECTION, in addition to
+   * video-level labels or segment-level labels.
+   * If unspecified, defaults to `SHOT_MODE`.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionMode label_detection_mode = 1; + */ + int getLabelDetectionModeValue(); + /** + *
+   * What labels should be detected with LABEL_DETECTION, in addition to
+   * video-level labels or segment-level labels.
+   * If unspecified, defaults to `SHOT_MODE`.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionMode label_detection_mode = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode getLabelDetectionMode(); + + /** + *
+   * Whether the video has been shot from a stationary (i.e. non-moving) camera.
+   * When set to true, might improve detection accuracy for moving objects.
+   * Should be used with `SHOT_AND_FRAME_MODE` enabled.
+   * 
+ * + * bool stationary_camera = 2; + */ + boolean getStationaryCamera(); + + /** + *
+   * Model to use for label detection.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 3; + */ + java.lang.String getModel(); + /** + *
+   * Model to use for label detection.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 3; + */ + com.google.protobuf.ByteString + getModelBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelDetectionMode.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelDetectionMode.java new file mode 100644 index 000000000000..a2d7b2c8e757 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelDetectionMode.java @@ -0,0 +1,157 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Label detection mode.
+ * 
+ * + * Protobuf enum {@code google.cloud.videointelligence.v1p2beta1.LabelDetectionMode} + */ +public enum LabelDetectionMode + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Unspecified.
+   * 
+ * + * LABEL_DETECTION_MODE_UNSPECIFIED = 0; + */ + LABEL_DETECTION_MODE_UNSPECIFIED(0), + /** + *
+   * Detect shot-level labels.
+   * 
+ * + * SHOT_MODE = 1; + */ + SHOT_MODE(1), + /** + *
+   * Detect frame-level labels.
+   * 
+ * + * FRAME_MODE = 2; + */ + FRAME_MODE(2), + /** + *
+   * Detect both shot-level and frame-level labels.
+   * 
+ * + * SHOT_AND_FRAME_MODE = 3; + */ + SHOT_AND_FRAME_MODE(3), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Unspecified.
+   * 
+ * + * LABEL_DETECTION_MODE_UNSPECIFIED = 0; + */ + public static final int LABEL_DETECTION_MODE_UNSPECIFIED_VALUE = 0; + /** + *
+   * Detect shot-level labels.
+   * 
+ * + * SHOT_MODE = 1; + */ + public static final int SHOT_MODE_VALUE = 1; + /** + *
+   * Detect frame-level labels.
+   * 
+ * + * FRAME_MODE = 2; + */ + public static final int FRAME_MODE_VALUE = 2; + /** + *
+   * Detect both shot-level and frame-level labels.
+   * 
+ * + * SHOT_AND_FRAME_MODE = 3; + */ + public static final int SHOT_AND_FRAME_MODE_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static LabelDetectionMode valueOf(int value) { + return forNumber(value); + } + + public static LabelDetectionMode forNumber(int value) { + switch (value) { + case 0: return LABEL_DETECTION_MODE_UNSPECIFIED; + case 1: return SHOT_MODE; + case 2: return FRAME_MODE; + case 3: return SHOT_AND_FRAME_MODE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + LabelDetectionMode> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public LabelDetectionMode findValueByNumber(int number) { + return LabelDetectionMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.getDescriptor().getEnumTypes().get(1); + } + + private static final LabelDetectionMode[] VALUES = values(); + + public static LabelDetectionMode valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private LabelDetectionMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.videointelligence.v1p2beta1.LabelDetectionMode) +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelFrame.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelFrame.java new file mode 100644 index 000000000000..639d0e026080 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelFrame.java @@ -0,0 +1,740 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Video frame level annotation results for label detection.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.LabelFrame} + */ +public final class LabelFrame extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.LabelFrame) + LabelFrameOrBuilder { +private static final long serialVersionUID = 0L; + // Use LabelFrame.newBuilder() to construct. + private LabelFrame(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LabelFrame() { + confidence_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LabelFrame( + 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: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (timeOffset_ != null) { + subBuilder = timeOffset_.toBuilder(); + } + timeOffset_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timeOffset_); + timeOffset_ = subBuilder.buildPartial(); + } + + break; + } + case 21: { + + confidence_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelFrame_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelFrame_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.LabelFrame.class, com.google.cloud.videointelligence.v1p2beta1.LabelFrame.Builder.class); + } + + public static final int TIME_OFFSET_FIELD_NUMBER = 1; + private com.google.protobuf.Duration timeOffset_; + /** + *
+   * Time-offset, relative to the beginning of the video, corresponding to the
+   * video frame for this location.
+   * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public boolean hasTimeOffset() { + return timeOffset_ != null; + } + /** + *
+   * Time-offset, relative to the beginning of the video, corresponding to the
+   * video frame for this location.
+   * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public com.google.protobuf.Duration getTimeOffset() { + return timeOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeOffset_; + } + /** + *
+   * Time-offset, relative to the beginning of the video, corresponding to the
+   * video frame for this location.
+   * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public com.google.protobuf.DurationOrBuilder getTimeOffsetOrBuilder() { + return getTimeOffset(); + } + + public static final int CONFIDENCE_FIELD_NUMBER = 2; + private float confidence_; + /** + *
+   * Confidence that the label is accurate. Range: [0, 1].
+   * 
+ * + * float confidence = 2; + */ + public float getConfidence() { + return confidence_; + } + + 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 (timeOffset_ != null) { + output.writeMessage(1, getTimeOffset()); + } + if (confidence_ != 0F) { + output.writeFloat(2, confidence_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (timeOffset_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTimeOffset()); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, confidence_); + } + 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.videointelligence.v1p2beta1.LabelFrame)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.LabelFrame other = (com.google.cloud.videointelligence.v1p2beta1.LabelFrame) obj; + + boolean result = true; + result = result && (hasTimeOffset() == other.hasTimeOffset()); + if (hasTimeOffset()) { + result = result && getTimeOffset() + .equals(other.getTimeOffset()); + } + result = result && ( + java.lang.Float.floatToIntBits(getConfidence()) + == java.lang.Float.floatToIntBits( + other.getConfidence())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTimeOffset()) { + hash = (37 * hash) + TIME_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getTimeOffset().hashCode(); + } + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.LabelFrame parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelFrame 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.videointelligence.v1p2beta1.LabelFrame parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelFrame 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.videointelligence.v1p2beta1.LabelFrame parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelFrame parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelFrame parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelFrame 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.videointelligence.v1p2beta1.LabelFrame parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelFrame 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.videointelligence.v1p2beta1.LabelFrame parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelFrame 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.videointelligence.v1p2beta1.LabelFrame 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; + } + /** + *
+   * Video frame level annotation results for label detection.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.LabelFrame} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.LabelFrame) + com.google.cloud.videointelligence.v1p2beta1.LabelFrameOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelFrame_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelFrame_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.LabelFrame.class, com.google.cloud.videointelligence.v1p2beta1.LabelFrame.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.LabelFrame.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(); + if (timeOffsetBuilder_ == null) { + timeOffset_ = null; + } else { + timeOffset_ = null; + timeOffsetBuilder_ = null; + } + confidence_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelFrame_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.LabelFrame getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.LabelFrame.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.LabelFrame build() { + com.google.cloud.videointelligence.v1p2beta1.LabelFrame result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.LabelFrame buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.LabelFrame result = new com.google.cloud.videointelligence.v1p2beta1.LabelFrame(this); + if (timeOffsetBuilder_ == null) { + result.timeOffset_ = timeOffset_; + } else { + result.timeOffset_ = timeOffsetBuilder_.build(); + } + result.confidence_ = confidence_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.LabelFrame) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.LabelFrame)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.LabelFrame other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.LabelFrame.getDefaultInstance()) return this; + if (other.hasTimeOffset()) { + mergeTimeOffset(other.getTimeOffset()); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + 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.videointelligence.v1p2beta1.LabelFrame parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.LabelFrame) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Duration timeOffset_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> timeOffsetBuilder_; + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public boolean hasTimeOffset() { + return timeOffsetBuilder_ != null || timeOffset_ != null; + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public com.google.protobuf.Duration getTimeOffset() { + if (timeOffsetBuilder_ == null) { + return timeOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeOffset_; + } else { + return timeOffsetBuilder_.getMessage(); + } + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public Builder setTimeOffset(com.google.protobuf.Duration value) { + if (timeOffsetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeOffset_ = value; + onChanged(); + } else { + timeOffsetBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public Builder setTimeOffset( + com.google.protobuf.Duration.Builder builderForValue) { + if (timeOffsetBuilder_ == null) { + timeOffset_ = builderForValue.build(); + onChanged(); + } else { + timeOffsetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public Builder mergeTimeOffset(com.google.protobuf.Duration value) { + if (timeOffsetBuilder_ == null) { + if (timeOffset_ != null) { + timeOffset_ = + com.google.protobuf.Duration.newBuilder(timeOffset_).mergeFrom(value).buildPartial(); + } else { + timeOffset_ = value; + } + onChanged(); + } else { + timeOffsetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public Builder clearTimeOffset() { + if (timeOffsetBuilder_ == null) { + timeOffset_ = null; + onChanged(); + } else { + timeOffset_ = null; + timeOffsetBuilder_ = null; + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public com.google.protobuf.Duration.Builder getTimeOffsetBuilder() { + + onChanged(); + return getTimeOffsetFieldBuilder().getBuilder(); + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + public com.google.protobuf.DurationOrBuilder getTimeOffsetOrBuilder() { + if (timeOffsetBuilder_ != null) { + return timeOffsetBuilder_.getMessageOrBuilder(); + } else { + return timeOffset_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : timeOffset_; + } + } + /** + *
+     * Time-offset, relative to the beginning of the video, corresponding to the
+     * video frame for this location.
+     * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getTimeOffsetFieldBuilder() { + if (timeOffsetBuilder_ == null) { + timeOffsetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getTimeOffset(), + getParentForChildren(), + isClean()); + timeOffset_ = null; + } + return timeOffsetBuilder_; + } + + private float confidence_ ; + /** + *
+     * Confidence that the label is accurate. Range: [0, 1].
+     * 
+ * + * float confidence = 2; + */ + public float getConfidence() { + return confidence_; + } + /** + *
+     * Confidence that the label is accurate. Range: [0, 1].
+     * 
+ * + * float confidence = 2; + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * Confidence that the label is accurate. Range: [0, 1].
+     * 
+ * + * float confidence = 2; + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.LabelFrame) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.LabelFrame) + private static final com.google.cloud.videointelligence.v1p2beta1.LabelFrame DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.LabelFrame(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.LabelFrame getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LabelFrame parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LabelFrame(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.videointelligence.v1p2beta1.LabelFrame getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelFrameOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelFrameOrBuilder.java new file mode 100644 index 000000000000..ed19b9318721 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelFrameOrBuilder.java @@ -0,0 +1,46 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface LabelFrameOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.LabelFrame) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Time-offset, relative to the beginning of the video, corresponding to the
+   * video frame for this location.
+   * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + boolean hasTimeOffset(); + /** + *
+   * Time-offset, relative to the beginning of the video, corresponding to the
+   * video frame for this location.
+   * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + com.google.protobuf.Duration getTimeOffset(); + /** + *
+   * Time-offset, relative to the beginning of the video, corresponding to the
+   * video frame for this location.
+   * 
+ * + * .google.protobuf.Duration time_offset = 1; + */ + com.google.protobuf.DurationOrBuilder getTimeOffsetOrBuilder(); + + /** + *
+   * Confidence that the label is accurate. Range: [0, 1].
+   * 
+ * + * float confidence = 2; + */ + float getConfidence(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelSegment.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelSegment.java new file mode 100644 index 000000000000..1d7ce7cd7ffd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelSegment.java @@ -0,0 +1,728 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Video segment level annotation results for label detection.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.LabelSegment} + */ +public final class LabelSegment extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.LabelSegment) + LabelSegmentOrBuilder { +private static final long serialVersionUID = 0L; + // Use LabelSegment.newBuilder() to construct. + private LabelSegment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LabelSegment() { + confidence_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LabelSegment( + 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: { + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder subBuilder = null; + if (segment_ != null) { + subBuilder = segment_.toBuilder(); + } + segment_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.VideoSegment.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(segment_); + segment_ = subBuilder.buildPartial(); + } + + break; + } + case 21: { + + confidence_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelSegment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelSegment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.LabelSegment.class, com.google.cloud.videointelligence.v1p2beta1.LabelSegment.Builder.class); + } + + public static final int SEGMENT_FIELD_NUMBER = 1; + private com.google.cloud.videointelligence.v1p2beta1.VideoSegment segment_; + /** + *
+   * Video segment where a label was detected.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public boolean hasSegment() { + return segment_ != null; + } + /** + *
+   * Video segment where a label was detected.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegment() { + return segment_ == null ? com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance() : segment_; + } + /** + *
+   * Video segment where a label was detected.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getSegmentOrBuilder() { + return getSegment(); + } + + public static final int CONFIDENCE_FIELD_NUMBER = 2; + private float confidence_; + /** + *
+   * Confidence that the label is accurate. Range: [0, 1].
+   * 
+ * + * float confidence = 2; + */ + public float getConfidence() { + return confidence_; + } + + 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 (segment_ != null) { + output.writeMessage(1, getSegment()); + } + if (confidence_ != 0F) { + output.writeFloat(2, confidence_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (segment_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getSegment()); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, confidence_); + } + 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.videointelligence.v1p2beta1.LabelSegment)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.LabelSegment other = (com.google.cloud.videointelligence.v1p2beta1.LabelSegment) obj; + + boolean result = true; + result = result && (hasSegment() == other.hasSegment()); + if (hasSegment()) { + result = result && getSegment() + .equals(other.getSegment()); + } + result = result && ( + java.lang.Float.floatToIntBits(getConfidence()) + == java.lang.Float.floatToIntBits( + other.getConfidence())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSegment()) { + hash = (37 * hash) + SEGMENT_FIELD_NUMBER; + hash = (53 * hash) + getSegment().hashCode(); + } + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.LabelSegment parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelSegment 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.videointelligence.v1p2beta1.LabelSegment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelSegment 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.videointelligence.v1p2beta1.LabelSegment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelSegment parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelSegment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelSegment 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.videointelligence.v1p2beta1.LabelSegment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelSegment 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.videointelligence.v1p2beta1.LabelSegment parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.LabelSegment 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.videointelligence.v1p2beta1.LabelSegment 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; + } + /** + *
+   * Video segment level annotation results for label detection.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.LabelSegment} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.LabelSegment) + com.google.cloud.videointelligence.v1p2beta1.LabelSegmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelSegment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelSegment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.LabelSegment.class, com.google.cloud.videointelligence.v1p2beta1.LabelSegment.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.LabelSegment.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(); + if (segmentBuilder_ == null) { + segment_ = null; + } else { + segment_ = null; + segmentBuilder_ = null; + } + confidence_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_LabelSegment_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.LabelSegment getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.LabelSegment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.LabelSegment build() { + com.google.cloud.videointelligence.v1p2beta1.LabelSegment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.LabelSegment buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.LabelSegment result = new com.google.cloud.videointelligence.v1p2beta1.LabelSegment(this); + if (segmentBuilder_ == null) { + result.segment_ = segment_; + } else { + result.segment_ = segmentBuilder_.build(); + } + result.confidence_ = confidence_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.LabelSegment) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.LabelSegment)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.LabelSegment other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.LabelSegment.getDefaultInstance()) return this; + if (other.hasSegment()) { + mergeSegment(other.getSegment()); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + 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.videointelligence.v1p2beta1.LabelSegment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.LabelSegment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.videointelligence.v1p2beta1.VideoSegment segment_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder> segmentBuilder_; + /** + *
+     * Video segment where a label was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public boolean hasSegment() { + return segmentBuilder_ != null || segment_ != null; + } + /** + *
+     * Video segment where a label was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegment() { + if (segmentBuilder_ == null) { + return segment_ == null ? com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance() : segment_; + } else { + return segmentBuilder_.getMessage(); + } + } + /** + *
+     * Video segment where a label was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public Builder setSegment(com.google.cloud.videointelligence.v1p2beta1.VideoSegment value) { + if (segmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + segment_ = value; + onChanged(); + } else { + segmentBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Video segment where a label was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public Builder setSegment( + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder builderForValue) { + if (segmentBuilder_ == null) { + segment_ = builderForValue.build(); + onChanged(); + } else { + segmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Video segment where a label was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public Builder mergeSegment(com.google.cloud.videointelligence.v1p2beta1.VideoSegment value) { + if (segmentBuilder_ == null) { + if (segment_ != null) { + segment_ = + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.newBuilder(segment_).mergeFrom(value).buildPartial(); + } else { + segment_ = value; + } + onChanged(); + } else { + segmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Video segment where a label was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public Builder clearSegment() { + if (segmentBuilder_ == null) { + segment_ = null; + onChanged(); + } else { + segment_ = null; + segmentBuilder_ = null; + } + + return this; + } + /** + *
+     * Video segment where a label was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder getSegmentBuilder() { + + onChanged(); + return getSegmentFieldBuilder().getBuilder(); + } + /** + *
+     * Video segment where a label was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getSegmentOrBuilder() { + if (segmentBuilder_ != null) { + return segmentBuilder_.getMessageOrBuilder(); + } else { + return segment_ == null ? + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance() : segment_; + } + } + /** + *
+     * Video segment where a label was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder> + getSegmentFieldBuilder() { + if (segmentBuilder_ == null) { + segmentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder>( + getSegment(), + getParentForChildren(), + isClean()); + segment_ = null; + } + return segmentBuilder_; + } + + private float confidence_ ; + /** + *
+     * Confidence that the label is accurate. Range: [0, 1].
+     * 
+ * + * float confidence = 2; + */ + public float getConfidence() { + return confidence_; + } + /** + *
+     * Confidence that the label is accurate. Range: [0, 1].
+     * 
+ * + * float confidence = 2; + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * Confidence that the label is accurate. Range: [0, 1].
+     * 
+ * + * float confidence = 2; + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.LabelSegment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.LabelSegment) + private static final com.google.cloud.videointelligence.v1p2beta1.LabelSegment DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.LabelSegment(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.LabelSegment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LabelSegment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LabelSegment(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.videointelligence.v1p2beta1.LabelSegment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelSegmentOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelSegmentOrBuilder.java new file mode 100644 index 000000000000..009a828c5ea3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/LabelSegmentOrBuilder.java @@ -0,0 +1,43 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface LabelSegmentOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.LabelSegment) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Video segment where a label was detected.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + boolean hasSegment(); + /** + *
+   * Video segment where a label was detected.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegment(); + /** + *
+   * Video segment where a label was detected.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getSegmentOrBuilder(); + + /** + *
+   * Confidence that the label is accurate. Range: [0, 1].
+   * 
+ * + * float confidence = 2; + */ + float getConfidence(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/Likelihood.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/Likelihood.java new file mode 100644 index 000000000000..3268643e8624 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/Likelihood.java @@ -0,0 +1,191 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Bucketized representation of likelihood.
+ * 
+ * + * Protobuf enum {@code google.cloud.videointelligence.v1p2beta1.Likelihood} + */ +public enum Likelihood + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Unspecified likelihood.
+   * 
+ * + * LIKELIHOOD_UNSPECIFIED = 0; + */ + LIKELIHOOD_UNSPECIFIED(0), + /** + *
+   * Very unlikely.
+   * 
+ * + * VERY_UNLIKELY = 1; + */ + VERY_UNLIKELY(1), + /** + *
+   * Unlikely.
+   * 
+ * + * UNLIKELY = 2; + */ + UNLIKELY(2), + /** + *
+   * Possible.
+   * 
+ * + * POSSIBLE = 3; + */ + POSSIBLE(3), + /** + *
+   * Likely.
+   * 
+ * + * LIKELY = 4; + */ + LIKELY(4), + /** + *
+   * Very likely.
+   * 
+ * + * VERY_LIKELY = 5; + */ + VERY_LIKELY(5), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Unspecified likelihood.
+   * 
+ * + * LIKELIHOOD_UNSPECIFIED = 0; + */ + public static final int LIKELIHOOD_UNSPECIFIED_VALUE = 0; + /** + *
+   * Very unlikely.
+   * 
+ * + * VERY_UNLIKELY = 1; + */ + public static final int VERY_UNLIKELY_VALUE = 1; + /** + *
+   * Unlikely.
+   * 
+ * + * UNLIKELY = 2; + */ + public static final int UNLIKELY_VALUE = 2; + /** + *
+   * Possible.
+   * 
+ * + * POSSIBLE = 3; + */ + public static final int POSSIBLE_VALUE = 3; + /** + *
+   * Likely.
+   * 
+ * + * LIKELY = 4; + */ + public static final int LIKELY_VALUE = 4; + /** + *
+   * Very likely.
+   * 
+ * + * VERY_LIKELY = 5; + */ + public static final int VERY_LIKELY_VALUE = 5; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Likelihood valueOf(int value) { + return forNumber(value); + } + + public static Likelihood forNumber(int value) { + switch (value) { + case 0: return LIKELIHOOD_UNSPECIFIED; + case 1: return VERY_UNLIKELY; + case 2: return UNLIKELY; + case 3: return POSSIBLE; + case 4: return LIKELY; + case 5: return VERY_LIKELY; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Likelihood> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Likelihood findValueByNumber(int number) { + return Likelihood.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.getDescriptor().getEnumTypes().get(2); + } + + private static final Likelihood[] VALUES = values(); + + public static Likelihood valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Likelihood(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.videointelligence.v1p2beta1.Likelihood) +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingBox.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingBox.java new file mode 100644 index 000000000000..5c1f67b4d5e7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingBox.java @@ -0,0 +1,734 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Normalized bounding box.
+ * The normalized vertex coordinates are relative to the original image.
+ * Range: [0, 1].
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox} + */ +public final class NormalizedBoundingBox extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox) + NormalizedBoundingBoxOrBuilder { +private static final long serialVersionUID = 0L; + // Use NormalizedBoundingBox.newBuilder() to construct. + private NormalizedBoundingBox(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private NormalizedBoundingBox() { + left_ = 0F; + top_ = 0F; + right_ = 0F; + bottom_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private NormalizedBoundingBox( + 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 13: { + + left_ = input.readFloat(); + break; + } + case 21: { + + top_ = input.readFloat(); + break; + } + case 29: { + + right_ = input.readFloat(); + break; + } + case 37: { + + bottom_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingBox_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingBox_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.class, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.Builder.class); + } + + public static final int LEFT_FIELD_NUMBER = 1; + private float left_; + /** + *
+   * Left X coordinate.
+   * 
+ * + * float left = 1; + */ + public float getLeft() { + return left_; + } + + public static final int TOP_FIELD_NUMBER = 2; + private float top_; + /** + *
+   * Top Y coordinate.
+   * 
+ * + * float top = 2; + */ + public float getTop() { + return top_; + } + + public static final int RIGHT_FIELD_NUMBER = 3; + private float right_; + /** + *
+   * Right X coordinate.
+   * 
+ * + * float right = 3; + */ + public float getRight() { + return right_; + } + + public static final int BOTTOM_FIELD_NUMBER = 4; + private float bottom_; + /** + *
+   * Bottom Y coordinate.
+   * 
+ * + * float bottom = 4; + */ + public float getBottom() { + return bottom_; + } + + 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 (left_ != 0F) { + output.writeFloat(1, left_); + } + if (top_ != 0F) { + output.writeFloat(2, top_); + } + if (right_ != 0F) { + output.writeFloat(3, right_); + } + if (bottom_ != 0F) { + output.writeFloat(4, bottom_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (left_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, left_); + } + if (top_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, top_); + } + if (right_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, right_); + } + if (bottom_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, bottom_); + } + 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.videointelligence.v1p2beta1.NormalizedBoundingBox)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox other = (com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox) obj; + + boolean result = true; + result = result && ( + java.lang.Float.floatToIntBits(getLeft()) + == java.lang.Float.floatToIntBits( + other.getLeft())); + result = result && ( + java.lang.Float.floatToIntBits(getTop()) + == java.lang.Float.floatToIntBits( + other.getTop())); + result = result && ( + java.lang.Float.floatToIntBits(getRight()) + == java.lang.Float.floatToIntBits( + other.getRight())); + result = result && ( + java.lang.Float.floatToIntBits(getBottom()) + == java.lang.Float.floatToIntBits( + other.getBottom())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LEFT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getLeft()); + hash = (37 * hash) + TOP_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getTop()); + hash = (37 * hash) + RIGHT_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getRight()); + hash = (37 * hash) + BOTTOM_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getBottom()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox 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.videointelligence.v1p2beta1.NormalizedBoundingBox parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox 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.videointelligence.v1p2beta1.NormalizedBoundingBox parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox 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.videointelligence.v1p2beta1.NormalizedBoundingBox parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox 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.videointelligence.v1p2beta1.NormalizedBoundingBox parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox 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.videointelligence.v1p2beta1.NormalizedBoundingBox 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; + } + /** + *
+   * Normalized bounding box.
+   * The normalized vertex coordinates are relative to the original image.
+   * Range: [0, 1].
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox) + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBoxOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingBox_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingBox_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.class, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.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(); + left_ = 0F; + + top_ = 0F; + + right_ = 0F; + + bottom_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingBox_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox build() { + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox result = new com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox(this); + result.left_ = left_; + result.top_ = top_; + result.right_ = right_; + result.bottom_ = bottom_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.getDefaultInstance()) return this; + if (other.getLeft() != 0F) { + setLeft(other.getLeft()); + } + if (other.getTop() != 0F) { + setTop(other.getTop()); + } + if (other.getRight() != 0F) { + setRight(other.getRight()); + } + if (other.getBottom() != 0F) { + setBottom(other.getBottom()); + } + 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.videointelligence.v1p2beta1.NormalizedBoundingBox parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float left_ ; + /** + *
+     * Left X coordinate.
+     * 
+ * + * float left = 1; + */ + public float getLeft() { + return left_; + } + /** + *
+     * Left X coordinate.
+     * 
+ * + * float left = 1; + */ + public Builder setLeft(float value) { + + left_ = value; + onChanged(); + return this; + } + /** + *
+     * Left X coordinate.
+     * 
+ * + * float left = 1; + */ + public Builder clearLeft() { + + left_ = 0F; + onChanged(); + return this; + } + + private float top_ ; + /** + *
+     * Top Y coordinate.
+     * 
+ * + * float top = 2; + */ + public float getTop() { + return top_; + } + /** + *
+     * Top Y coordinate.
+     * 
+ * + * float top = 2; + */ + public Builder setTop(float value) { + + top_ = value; + onChanged(); + return this; + } + /** + *
+     * Top Y coordinate.
+     * 
+ * + * float top = 2; + */ + public Builder clearTop() { + + top_ = 0F; + onChanged(); + return this; + } + + private float right_ ; + /** + *
+     * Right X coordinate.
+     * 
+ * + * float right = 3; + */ + public float getRight() { + return right_; + } + /** + *
+     * Right X coordinate.
+     * 
+ * + * float right = 3; + */ + public Builder setRight(float value) { + + right_ = value; + onChanged(); + return this; + } + /** + *
+     * Right X coordinate.
+     * 
+ * + * float right = 3; + */ + public Builder clearRight() { + + right_ = 0F; + onChanged(); + return this; + } + + private float bottom_ ; + /** + *
+     * Bottom Y coordinate.
+     * 
+ * + * float bottom = 4; + */ + public float getBottom() { + return bottom_; + } + /** + *
+     * Bottom Y coordinate.
+     * 
+ * + * float bottom = 4; + */ + public Builder setBottom(float value) { + + bottom_ = value; + onChanged(); + return this; + } + /** + *
+     * Bottom Y coordinate.
+     * 
+ * + * float bottom = 4; + */ + public Builder clearBottom() { + + bottom_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.NormalizedBoundingBox) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox) + private static final com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NormalizedBoundingBox parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NormalizedBoundingBox(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.videointelligence.v1p2beta1.NormalizedBoundingBox getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingBoxOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingBoxOrBuilder.java new file mode 100644 index 000000000000..afdfdc570936 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingBoxOrBuilder.java @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface NormalizedBoundingBoxOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Left X coordinate.
+   * 
+ * + * float left = 1; + */ + float getLeft(); + + /** + *
+   * Top Y coordinate.
+   * 
+ * + * float top = 2; + */ + float getTop(); + + /** + *
+   * Right X coordinate.
+   * 
+ * + * float right = 3; + */ + float getRight(); + + /** + *
+   * Bottom Y coordinate.
+   * 
+ * + * float bottom = 4; + */ + float getBottom(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingPoly.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingPoly.java new file mode 100644 index 000000000000..c472af163a90 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingPoly.java @@ -0,0 +1,887 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Normalized bounding polygon for text (that might not be aligned with axis).
+ * Contains list of the corner points in clockwise order starting from
+ * top-left corner. For example, for a rectangular bounding box:
+ * When the text is horizontal it might look like:
+ *         0----1
+ *         |    |
+ *         3----2
+ * When it's clockwise rotated 180 degrees around the top-left corner it
+ * becomes:
+ *         2----3
+ *         |    |
+ *         1----0
+ * and the vertex order will still be (0, 1, 2, 3). Note that values can be less
+ * than 0, or greater than 1 due to trignometric calculations for location of
+ * the box.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly} + */ +public final class NormalizedBoundingPoly extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly) + NormalizedBoundingPolyOrBuilder { +private static final long serialVersionUID = 0L; + // Use NormalizedBoundingPoly.newBuilder() to construct. + private NormalizedBoundingPoly(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private NormalizedBoundingPoly() { + vertices_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private NormalizedBoundingPoly( + 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: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + vertices_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + vertices_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + vertices_ = java.util.Collections.unmodifiableList(vertices_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingPoly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.class, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.Builder.class); + } + + public static final int VERTICES_FIELD_NUMBER = 1; + private java.util.List vertices_; + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public java.util.List getVerticesList() { + return vertices_; + } + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public java.util.List + getVerticesOrBuilderList() { + return vertices_; + } + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public int getVerticesCount() { + return vertices_.size(); + } + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex getVertices(int index) { + return vertices_.get(index); + } + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedVertexOrBuilder getVerticesOrBuilder( + int index) { + return vertices_.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 { + for (int i = 0; i < vertices_.size(); i++) { + output.writeMessage(1, vertices_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < vertices_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, vertices_.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.videointelligence.v1p2beta1.NormalizedBoundingPoly)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly other = (com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly) obj; + + boolean result = true; + result = result && getVerticesList() + .equals(other.getVerticesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getVerticesCount() > 0) { + hash = (37 * hash) + VERTICES_FIELD_NUMBER; + hash = (53 * hash) + getVerticesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly 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.videointelligence.v1p2beta1.NormalizedBoundingPoly parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly 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.videointelligence.v1p2beta1.NormalizedBoundingPoly parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly 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.videointelligence.v1p2beta1.NormalizedBoundingPoly parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly 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.videointelligence.v1p2beta1.NormalizedBoundingPoly parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly 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.videointelligence.v1p2beta1.NormalizedBoundingPoly 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; + } + /** + *
+   * Normalized bounding polygon for text (that might not be aligned with axis).
+   * Contains list of the corner points in clockwise order starting from
+   * top-left corner. For example, for a rectangular bounding box:
+   * When the text is horizontal it might look like:
+   *         0----1
+   *         |    |
+   *         3----2
+   * When it's clockwise rotated 180 degrees around the top-left corner it
+   * becomes:
+   *         2----3
+   *         |    |
+   *         1----0
+   * and the vertex order will still be (0, 1, 2, 3). Note that values can be less
+   * than 0, or greater than 1 due to trignometric calculations for location of
+   * the box.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly) + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPolyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingPoly_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingPoly_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.class, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getVerticesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (verticesBuilder_ == null) { + vertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + verticesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingPoly_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly build() { + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly result = new com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly(this); + int from_bitField0_ = bitField0_; + if (verticesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + vertices_ = java.util.Collections.unmodifiableList(vertices_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.vertices_ = vertices_; + } else { + result.vertices_ = verticesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.getDefaultInstance()) return this; + if (verticesBuilder_ == null) { + if (!other.vertices_.isEmpty()) { + if (vertices_.isEmpty()) { + vertices_ = other.vertices_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVerticesIsMutable(); + vertices_.addAll(other.vertices_); + } + onChanged(); + } + } else { + if (!other.vertices_.isEmpty()) { + if (verticesBuilder_.isEmpty()) { + verticesBuilder_.dispose(); + verticesBuilder_ = null; + vertices_ = other.vertices_; + bitField0_ = (bitField0_ & ~0x00000001); + verticesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getVerticesFieldBuilder() : null; + } else { + verticesBuilder_.addAllMessages(other.vertices_); + } + } + } + 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.videointelligence.v1p2beta1.NormalizedBoundingPoly parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List vertices_ = + java.util.Collections.emptyList(); + private void ensureVerticesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + vertices_ = new java.util.ArrayList(vertices_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.Builder, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertexOrBuilder> verticesBuilder_; + + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public java.util.List getVerticesList() { + if (verticesBuilder_ == null) { + return java.util.Collections.unmodifiableList(vertices_); + } else { + return verticesBuilder_.getMessageList(); + } + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public int getVerticesCount() { + if (verticesBuilder_ == null) { + return vertices_.size(); + } else { + return verticesBuilder_.getCount(); + } + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex getVertices(int index) { + if (verticesBuilder_ == null) { + return vertices_.get(index); + } else { + return verticesBuilder_.getMessage(index); + } + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public Builder setVertices( + int index, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.set(index, value); + onChanged(); + } else { + verticesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public Builder setVertices( + int index, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.set(index, builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public Builder addVertices(com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.add(value); + onChanged(); + } else { + verticesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public Builder addVertices( + int index, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex value) { + if (verticesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVerticesIsMutable(); + vertices_.add(index, value); + onChanged(); + } else { + verticesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public Builder addVertices( + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.add(builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public Builder addVertices( + int index, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.Builder builderForValue) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.add(index, builderForValue.build()); + onChanged(); + } else { + verticesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public Builder addAllVertices( + java.lang.Iterable values) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, vertices_); + onChanged(); + } else { + verticesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public Builder clearVertices() { + if (verticesBuilder_ == null) { + vertices_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + verticesBuilder_.clear(); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public Builder removeVertices(int index) { + if (verticesBuilder_ == null) { + ensureVerticesIsMutable(); + vertices_.remove(index); + onChanged(); + } else { + verticesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.Builder getVerticesBuilder( + int index) { + return getVerticesFieldBuilder().getBuilder(index); + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedVertexOrBuilder getVerticesOrBuilder( + int index) { + if (verticesBuilder_ == null) { + return vertices_.get(index); } else { + return verticesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public java.util.List + getVerticesOrBuilderList() { + if (verticesBuilder_ != null) { + return verticesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(vertices_); + } + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.Builder addVerticesBuilder() { + return getVerticesFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.getDefaultInstance()); + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.Builder addVerticesBuilder( + int index) { + return getVerticesFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.getDefaultInstance()); + } + /** + *
+     * Normalized vertices of the bounding polygon.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + public java.util.List + getVerticesBuilderList() { + return getVerticesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.Builder, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertexOrBuilder> + getVerticesFieldBuilder() { + if (verticesBuilder_ == null) { + verticesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.Builder, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertexOrBuilder>( + vertices_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + vertices_ = null; + } + return verticesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.NormalizedBoundingPoly) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly) + private static final com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NormalizedBoundingPoly parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NormalizedBoundingPoly(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.videointelligence.v1p2beta1.NormalizedBoundingPoly getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingPolyOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingPolyOrBuilder.java new file mode 100644 index 000000000000..336e5e438fce --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedBoundingPolyOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface NormalizedBoundingPolyOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + java.util.List + getVerticesList(); + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex getVertices(int index); + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + int getVerticesCount(); + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + java.util.List + getVerticesOrBuilderList(); + /** + *
+   * Normalized vertices of the bounding polygon.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.NormalizedVertex vertices = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertexOrBuilder getVerticesOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedVertex.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedVertex.java new file mode 100644 index 000000000000..bde50c245434 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedVertex.java @@ -0,0 +1,580 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * A vertex represents a 2D point in the image.
+ * NOTE: the normalized vertex coordinates are relative to the original image
+ * and range from 0 to 1.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.NormalizedVertex} + */ +public final class NormalizedVertex extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.NormalizedVertex) + NormalizedVertexOrBuilder { +private static final long serialVersionUID = 0L; + // Use NormalizedVertex.newBuilder() to construct. + private NormalizedVertex(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private NormalizedVertex() { + x_ = 0F; + y_ = 0F; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private NormalizedVertex( + 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 13: { + + x_ = input.readFloat(); + break; + } + case 21: { + + y_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedVertex_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedVertex_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.class, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.Builder.class); + } + + public static final int X_FIELD_NUMBER = 1; + private float x_; + /** + *
+   * X coordinate.
+   * 
+ * + * float x = 1; + */ + public float getX() { + return x_; + } + + public static final int Y_FIELD_NUMBER = 2; + private float y_; + /** + *
+   * Y coordinate.
+   * 
+ * + * float y = 2; + */ + public float getY() { + return y_; + } + + 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 (x_ != 0F) { + output.writeFloat(1, x_); + } + if (y_ != 0F) { + output.writeFloat(2, y_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (x_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, x_); + } + if (y_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, y_); + } + 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.videointelligence.v1p2beta1.NormalizedVertex)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex other = (com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex) obj; + + boolean result = true; + result = result && ( + java.lang.Float.floatToIntBits(getX()) + == java.lang.Float.floatToIntBits( + other.getX())); + result = result && ( + java.lang.Float.floatToIntBits(getY()) + == java.lang.Float.floatToIntBits( + other.getY())); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + X_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getX()); + hash = (37 * hash) + Y_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getY()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex 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.videointelligence.v1p2beta1.NormalizedVertex parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex 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.videointelligence.v1p2beta1.NormalizedVertex parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex 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.videointelligence.v1p2beta1.NormalizedVertex parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex 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.videointelligence.v1p2beta1.NormalizedVertex parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex 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.videointelligence.v1p2beta1.NormalizedVertex 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; + } + /** + *
+   * A vertex represents a 2D point in the image.
+   * NOTE: the normalized vertex coordinates are relative to the original image
+   * and range from 0 to 1.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.NormalizedVertex} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.NormalizedVertex) + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertexOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedVertex_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedVertex_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.class, com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.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(); + x_ = 0F; + + y_ = 0F; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedVertex_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex build() { + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex result = new com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex(this); + result.x_ = x_; + result.y_ = y_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex.getDefaultInstance()) return this; + if (other.getX() != 0F) { + setX(other.getX()); + } + if (other.getY() != 0F) { + setY(other.getY()); + } + 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.videointelligence.v1p2beta1.NormalizedVertex parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float x_ ; + /** + *
+     * X coordinate.
+     * 
+ * + * float x = 1; + */ + public float getX() { + return x_; + } + /** + *
+     * X coordinate.
+     * 
+ * + * float x = 1; + */ + public Builder setX(float value) { + + x_ = value; + onChanged(); + return this; + } + /** + *
+     * X coordinate.
+     * 
+ * + * float x = 1; + */ + public Builder clearX() { + + x_ = 0F; + onChanged(); + return this; + } + + private float y_ ; + /** + *
+     * Y coordinate.
+     * 
+ * + * float y = 2; + */ + public float getY() { + return y_; + } + /** + *
+     * Y coordinate.
+     * 
+ * + * float y = 2; + */ + public Builder setY(float value) { + + y_ = value; + onChanged(); + return this; + } + /** + *
+     * Y coordinate.
+     * 
+ * + * float y = 2; + */ + public Builder clearY() { + + y_ = 0F; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.NormalizedVertex) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.NormalizedVertex) + private static final com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.NormalizedVertex getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NormalizedVertex parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new NormalizedVertex(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.videointelligence.v1p2beta1.NormalizedVertex getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedVertexOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedVertexOrBuilder.java new file mode 100644 index 000000000000..890b6c54696c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/NormalizedVertexOrBuilder.java @@ -0,0 +1,27 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface NormalizedVertexOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.NormalizedVertex) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * X coordinate.
+   * 
+ * + * float x = 1; + */ + float getX(); + + /** + *
+   * Y coordinate.
+   * 
+ * + * float y = 2; + */ + float getY(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingAnnotation.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingAnnotation.java new file mode 100644 index 000000000000..10ada7fc2407 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingAnnotation.java @@ -0,0 +1,1397 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Annotations corresponding to one tracked object.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation} + */ +public final class ObjectTrackingAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation) + ObjectTrackingAnnotationOrBuilder { +private static final long serialVersionUID = 0L; + // Use ObjectTrackingAnnotation.newBuilder() to construct. + private ObjectTrackingAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ObjectTrackingAnnotation() { + confidence_ = 0F; + frames_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ObjectTrackingAnnotation( + 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: { + com.google.cloud.videointelligence.v1p2beta1.Entity.Builder subBuilder = null; + if (entity_ != null) { + subBuilder = entity_.toBuilder(); + } + entity_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.Entity.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(entity_); + entity_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + frames_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + frames_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.parser(), extensionRegistry)); + break; + } + case 26: { + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder subBuilder = null; + if (segment_ != null) { + subBuilder = segment_.toBuilder(); + } + segment_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.VideoSegment.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(segment_); + segment_ = subBuilder.buildPartial(); + } + + break; + } + case 37: { + + confidence_ = input.readFloat(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + frames_ = java.util.Collections.unmodifiableList(frames_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.class, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.Builder.class); + } + + private int bitField0_; + public static final int ENTITY_FIELD_NUMBER = 1; + private com.google.cloud.videointelligence.v1p2beta1.Entity entity_; + /** + *
+   * Entity to specify the object category that this track is labeled as.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public boolean hasEntity() { + return entity_ != null; + } + /** + *
+   * Entity to specify the object category that this track is labeled as.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.Entity getEntity() { + return entity_ == null ? com.google.cloud.videointelligence.v1p2beta1.Entity.getDefaultInstance() : entity_; + } + /** + *
+   * Entity to specify the object category that this track is labeled as.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder getEntityOrBuilder() { + return getEntity(); + } + + public static final int CONFIDENCE_FIELD_NUMBER = 4; + private float confidence_; + /** + *
+   * Object category's labeling confidence of this track.
+   * 
+ * + * float confidence = 4; + */ + public float getConfidence() { + return confidence_; + } + + public static final int FRAMES_FIELD_NUMBER = 2; + private java.util.List frames_; + /** + *
+   * Information corresponding to all frames where this object track appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public java.util.List getFramesList() { + return frames_; + } + /** + *
+   * Information corresponding to all frames where this object track appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public java.util.List + getFramesOrBuilderList() { + return frames_; + } + /** + *
+   * Information corresponding to all frames where this object track appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public int getFramesCount() { + return frames_.size(); + } + /** + *
+   * Information corresponding to all frames where this object track appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame getFrames(int index) { + return frames_.get(index); + } + /** + *
+   * Information corresponding to all frames where this object track appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrameOrBuilder getFramesOrBuilder( + int index) { + return frames_.get(index); + } + + public static final int SEGMENT_FIELD_NUMBER = 3; + private com.google.cloud.videointelligence.v1p2beta1.VideoSegment segment_; + /** + *
+   * Each object track corresponds to one video segment where it appears.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + public boolean hasSegment() { + return segment_ != null; + } + /** + *
+   * Each object track corresponds to one video segment where it appears.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegment() { + return segment_ == null ? com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance() : segment_; + } + /** + *
+   * Each object track corresponds to one video segment where it appears.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getSegmentOrBuilder() { + return getSegment(); + } + + 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 (entity_ != null) { + output.writeMessage(1, getEntity()); + } + for (int i = 0; i < frames_.size(); i++) { + output.writeMessage(2, frames_.get(i)); + } + if (segment_ != null) { + output.writeMessage(3, getSegment()); + } + if (confidence_ != 0F) { + output.writeFloat(4, confidence_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (entity_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getEntity()); + } + for (int i = 0; i < frames_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, frames_.get(i)); + } + if (segment_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getSegment()); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(4, confidence_); + } + 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.videointelligence.v1p2beta1.ObjectTrackingAnnotation)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation other = (com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation) obj; + + boolean result = true; + result = result && (hasEntity() == other.hasEntity()); + if (hasEntity()) { + result = result && getEntity() + .equals(other.getEntity()); + } + result = result && ( + java.lang.Float.floatToIntBits(getConfidence()) + == java.lang.Float.floatToIntBits( + other.getConfidence())); + result = result && getFramesList() + .equals(other.getFramesList()); + result = result && (hasSegment() == other.hasSegment()); + if (hasSegment()) { + result = result && getSegment() + .equals(other.getSegment()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasEntity()) { + hash = (37 * hash) + ENTITY_FIELD_NUMBER; + hash = (53 * hash) + getEntity().hashCode(); + } + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + if (getFramesCount() > 0) { + hash = (37 * hash) + FRAMES_FIELD_NUMBER; + hash = (53 * hash) + getFramesList().hashCode(); + } + if (hasSegment()) { + hash = (37 * hash) + SEGMENT_FIELD_NUMBER; + hash = (53 * hash) + getSegment().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation 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.videointelligence.v1p2beta1.ObjectTrackingAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation 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.videointelligence.v1p2beta1.ObjectTrackingAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation 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.videointelligence.v1p2beta1.ObjectTrackingAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation 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.videointelligence.v1p2beta1.ObjectTrackingAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation 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.videointelligence.v1p2beta1.ObjectTrackingAnnotation 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; + } + /** + *
+   * Annotations corresponding to one tracked object.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation) + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.class, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getFramesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (entityBuilder_ == null) { + entity_ = null; + } else { + entity_ = null; + entityBuilder_ = null; + } + confidence_ = 0F; + + if (framesBuilder_ == null) { + frames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + framesBuilder_.clear(); + } + if (segmentBuilder_ == null) { + segment_ = null; + } else { + segment_ = null; + segmentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation build() { + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation result = new com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (entityBuilder_ == null) { + result.entity_ = entity_; + } else { + result.entity_ = entityBuilder_.build(); + } + result.confidence_ = confidence_; + if (framesBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + frames_ = java.util.Collections.unmodifiableList(frames_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.frames_ = frames_; + } else { + result.frames_ = framesBuilder_.build(); + } + if (segmentBuilder_ == null) { + result.segment_ = segment_; + } else { + result.segment_ = segmentBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.getDefaultInstance()) return this; + if (other.hasEntity()) { + mergeEntity(other.getEntity()); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + if (framesBuilder_ == null) { + if (!other.frames_.isEmpty()) { + if (frames_.isEmpty()) { + frames_ = other.frames_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureFramesIsMutable(); + frames_.addAll(other.frames_); + } + onChanged(); + } + } else { + if (!other.frames_.isEmpty()) { + if (framesBuilder_.isEmpty()) { + framesBuilder_.dispose(); + framesBuilder_ = null; + frames_ = other.frames_; + bitField0_ = (bitField0_ & ~0x00000004); + framesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFramesFieldBuilder() : null; + } else { + framesBuilder_.addAllMessages(other.frames_); + } + } + } + if (other.hasSegment()) { + mergeSegment(other.getSegment()); + } + 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.videointelligence.v1p2beta1.ObjectTrackingAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.cloud.videointelligence.v1p2beta1.Entity entity_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.Entity, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder, com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder> entityBuilder_; + /** + *
+     * Entity to specify the object category that this track is labeled as.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public boolean hasEntity() { + return entityBuilder_ != null || entity_ != null; + } + /** + *
+     * Entity to specify the object category that this track is labeled as.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.Entity getEntity() { + if (entityBuilder_ == null) { + return entity_ == null ? com.google.cloud.videointelligence.v1p2beta1.Entity.getDefaultInstance() : entity_; + } else { + return entityBuilder_.getMessage(); + } + } + /** + *
+     * Entity to specify the object category that this track is labeled as.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public Builder setEntity(com.google.cloud.videointelligence.v1p2beta1.Entity value) { + if (entityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + entity_ = value; + onChanged(); + } else { + entityBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Entity to specify the object category that this track is labeled as.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public Builder setEntity( + com.google.cloud.videointelligence.v1p2beta1.Entity.Builder builderForValue) { + if (entityBuilder_ == null) { + entity_ = builderForValue.build(); + onChanged(); + } else { + entityBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Entity to specify the object category that this track is labeled as.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public Builder mergeEntity(com.google.cloud.videointelligence.v1p2beta1.Entity value) { + if (entityBuilder_ == null) { + if (entity_ != null) { + entity_ = + com.google.cloud.videointelligence.v1p2beta1.Entity.newBuilder(entity_).mergeFrom(value).buildPartial(); + } else { + entity_ = value; + } + onChanged(); + } else { + entityBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Entity to specify the object category that this track is labeled as.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public Builder clearEntity() { + if (entityBuilder_ == null) { + entity_ = null; + onChanged(); + } else { + entity_ = null; + entityBuilder_ = null; + } + + return this; + } + /** + *
+     * Entity to specify the object category that this track is labeled as.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.Entity.Builder getEntityBuilder() { + + onChanged(); + return getEntityFieldBuilder().getBuilder(); + } + /** + *
+     * Entity to specify the object category that this track is labeled as.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder getEntityOrBuilder() { + if (entityBuilder_ != null) { + return entityBuilder_.getMessageOrBuilder(); + } else { + return entity_ == null ? + com.google.cloud.videointelligence.v1p2beta1.Entity.getDefaultInstance() : entity_; + } + } + /** + *
+     * Entity to specify the object category that this track is labeled as.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.Entity, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder, com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder> + getEntityFieldBuilder() { + if (entityBuilder_ == null) { + entityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.Entity, com.google.cloud.videointelligence.v1p2beta1.Entity.Builder, com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder>( + getEntity(), + getParentForChildren(), + isClean()); + entity_ = null; + } + return entityBuilder_; + } + + private float confidence_ ; + /** + *
+     * Object category's labeling confidence of this track.
+     * 
+ * + * float confidence = 4; + */ + public float getConfidence() { + return confidence_; + } + /** + *
+     * Object category's labeling confidence of this track.
+     * 
+ * + * float confidence = 4; + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * Object category's labeling confidence of this track.
+     * 
+ * + * float confidence = 4; + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + + private java.util.List frames_ = + java.util.Collections.emptyList(); + private void ensureFramesIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + frames_ = new java.util.ArrayList(frames_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.Builder, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrameOrBuilder> framesBuilder_; + + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public java.util.List getFramesList() { + if (framesBuilder_ == null) { + return java.util.Collections.unmodifiableList(frames_); + } else { + return framesBuilder_.getMessageList(); + } + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public int getFramesCount() { + if (framesBuilder_ == null) { + return frames_.size(); + } else { + return framesBuilder_.getCount(); + } + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame getFrames(int index) { + if (framesBuilder_ == null) { + return frames_.get(index); + } else { + return framesBuilder_.getMessage(index); + } + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public Builder setFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame value) { + if (framesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFramesIsMutable(); + frames_.set(index, value); + onChanged(); + } else { + framesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public Builder setFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.Builder builderForValue) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.set(index, builderForValue.build()); + onChanged(); + } else { + framesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public Builder addFrames(com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame value) { + if (framesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFramesIsMutable(); + frames_.add(value); + onChanged(); + } else { + framesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public Builder addFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame value) { + if (framesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFramesIsMutable(); + frames_.add(index, value); + onChanged(); + } else { + framesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public Builder addFrames( + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.Builder builderForValue) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.add(builderForValue.build()); + onChanged(); + } else { + framesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public Builder addFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.Builder builderForValue) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.add(index, builderForValue.build()); + onChanged(); + } else { + framesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public Builder addAllFrames( + java.lang.Iterable values) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, frames_); + onChanged(); + } else { + framesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public Builder clearFrames() { + if (framesBuilder_ == null) { + frames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + framesBuilder_.clear(); + } + return this; + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public Builder removeFrames(int index) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.remove(index); + onChanged(); + } else { + framesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.Builder getFramesBuilder( + int index) { + return getFramesFieldBuilder().getBuilder(index); + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrameOrBuilder getFramesOrBuilder( + int index) { + if (framesBuilder_ == null) { + return frames_.get(index); } else { + return framesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public java.util.List + getFramesOrBuilderList() { + if (framesBuilder_ != null) { + return framesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(frames_); + } + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.Builder addFramesBuilder() { + return getFramesFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.getDefaultInstance()); + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.Builder addFramesBuilder( + int index) { + return getFramesFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.getDefaultInstance()); + } + /** + *
+     * Information corresponding to all frames where this object track appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + public java.util.List + getFramesBuilderList() { + return getFramesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.Builder, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrameOrBuilder> + getFramesFieldBuilder() { + if (framesBuilder_ == null) { + framesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.Builder, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrameOrBuilder>( + frames_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + frames_ = null; + } + return framesBuilder_; + } + + private com.google.cloud.videointelligence.v1p2beta1.VideoSegment segment_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder> segmentBuilder_; + /** + *
+     * Each object track corresponds to one video segment where it appears.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + public boolean hasSegment() { + return segmentBuilder_ != null || segment_ != null; + } + /** + *
+     * Each object track corresponds to one video segment where it appears.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegment() { + if (segmentBuilder_ == null) { + return segment_ == null ? com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance() : segment_; + } else { + return segmentBuilder_.getMessage(); + } + } + /** + *
+     * Each object track corresponds to one video segment where it appears.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + public Builder setSegment(com.google.cloud.videointelligence.v1p2beta1.VideoSegment value) { + if (segmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + segment_ = value; + onChanged(); + } else { + segmentBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Each object track corresponds to one video segment where it appears.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + public Builder setSegment( + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder builderForValue) { + if (segmentBuilder_ == null) { + segment_ = builderForValue.build(); + onChanged(); + } else { + segmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Each object track corresponds to one video segment where it appears.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + public Builder mergeSegment(com.google.cloud.videointelligence.v1p2beta1.VideoSegment value) { + if (segmentBuilder_ == null) { + if (segment_ != null) { + segment_ = + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.newBuilder(segment_).mergeFrom(value).buildPartial(); + } else { + segment_ = value; + } + onChanged(); + } else { + segmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Each object track corresponds to one video segment where it appears.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + public Builder clearSegment() { + if (segmentBuilder_ == null) { + segment_ = null; + onChanged(); + } else { + segment_ = null; + segmentBuilder_ = null; + } + + return this; + } + /** + *
+     * Each object track corresponds to one video segment where it appears.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder getSegmentBuilder() { + + onChanged(); + return getSegmentFieldBuilder().getBuilder(); + } + /** + *
+     * Each object track corresponds to one video segment where it appears.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getSegmentOrBuilder() { + if (segmentBuilder_ != null) { + return segmentBuilder_.getMessageOrBuilder(); + } else { + return segment_ == null ? + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance() : segment_; + } + } + /** + *
+     * Each object track corresponds to one video segment where it appears.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder> + getSegmentFieldBuilder() { + if (segmentBuilder_ == null) { + segmentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder>( + getSegment(), + getParentForChildren(), + isClean()); + segment_ = null; + } + return segmentBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.ObjectTrackingAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation) + private static final com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ObjectTrackingAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ObjectTrackingAnnotation(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.videointelligence.v1p2beta1.ObjectTrackingAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingAnnotationOrBuilder.java new file mode 100644 index 000000000000..75cf4a78f7cf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingAnnotationOrBuilder.java @@ -0,0 +1,112 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface ObjectTrackingAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Entity to specify the object category that this track is labeled as.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + boolean hasEntity(); + /** + *
+   * Entity to specify the object category that this track is labeled as.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.Entity getEntity(); + /** + *
+   * Entity to specify the object category that this track is labeled as.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.Entity entity = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.EntityOrBuilder getEntityOrBuilder(); + + /** + *
+   * Object category's labeling confidence of this track.
+   * 
+ * + * float confidence = 4; + */ + float getConfidence(); + + /** + *
+   * Information corresponding to all frames where this object track appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + java.util.List + getFramesList(); + /** + *
+   * Information corresponding to all frames where this object track appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame getFrames(int index); + /** + *
+   * Information corresponding to all frames where this object track appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + int getFramesCount(); + /** + *
+   * Information corresponding to all frames where this object track appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + java.util.List + getFramesOrBuilderList(); + /** + *
+   * Information corresponding to all frames where this object track appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame frames = 2; + */ + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrameOrBuilder getFramesOrBuilder( + int index); + + /** + *
+   * Each object track corresponds to one video segment where it appears.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + boolean hasSegment(); + /** + *
+   * Each object track corresponds to one video segment where it appears.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegment(); + /** + *
+   * Each object track corresponds to one video segment where it appears.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 3; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getSegmentOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingFrame.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingFrame.java new file mode 100644 index 000000000000..4a591fc3b22f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingFrame.java @@ -0,0 +1,882 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Video frame level annotations for object detection and tracking. This field
+ * stores per frame location, time offset, and confidence.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame} + */ +public final class ObjectTrackingFrame extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame) + ObjectTrackingFrameOrBuilder { +private static final long serialVersionUID = 0L; + // Use ObjectTrackingFrame.newBuilder() to construct. + private ObjectTrackingFrame(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ObjectTrackingFrame() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ObjectTrackingFrame( + 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: { + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.Builder subBuilder = null; + if (normalizedBoundingBox_ != null) { + subBuilder = normalizedBoundingBox_.toBuilder(); + } + normalizedBoundingBox_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(normalizedBoundingBox_); + normalizedBoundingBox_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (timeOffset_ != null) { + subBuilder = timeOffset_.toBuilder(); + } + timeOffset_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timeOffset_); + timeOffset_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingFrame_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingFrame_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.class, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.Builder.class); + } + + public static final int NORMALIZED_BOUNDING_BOX_FIELD_NUMBER = 1; + private com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalizedBoundingBox_; + /** + *
+   * The normalized bounding box location of this object track for the frame.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + public boolean hasNormalizedBoundingBox() { + return normalizedBoundingBox_ != null; + } + /** + *
+   * The normalized bounding box location of this object track for the frame.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox getNormalizedBoundingBox() { + return normalizedBoundingBox_ == null ? com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.getDefaultInstance() : normalizedBoundingBox_; + } + /** + *
+   * The normalized bounding box location of this object track for the frame.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBoxOrBuilder getNormalizedBoundingBoxOrBuilder() { + return getNormalizedBoundingBox(); + } + + public static final int TIME_OFFSET_FIELD_NUMBER = 2; + private com.google.protobuf.Duration timeOffset_; + /** + *
+   * The timestamp of the frame in microseconds.
+   * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public boolean hasTimeOffset() { + return timeOffset_ != null; + } + /** + *
+   * The timestamp of the frame in microseconds.
+   * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public com.google.protobuf.Duration getTimeOffset() { + return timeOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeOffset_; + } + /** + *
+   * The timestamp of the frame in microseconds.
+   * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public com.google.protobuf.DurationOrBuilder getTimeOffsetOrBuilder() { + return getTimeOffset(); + } + + 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 (normalizedBoundingBox_ != null) { + output.writeMessage(1, getNormalizedBoundingBox()); + } + if (timeOffset_ != null) { + output.writeMessage(2, getTimeOffset()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (normalizedBoundingBox_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getNormalizedBoundingBox()); + } + if (timeOffset_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTimeOffset()); + } + 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.videointelligence.v1p2beta1.ObjectTrackingFrame)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame other = (com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame) obj; + + boolean result = true; + result = result && (hasNormalizedBoundingBox() == other.hasNormalizedBoundingBox()); + if (hasNormalizedBoundingBox()) { + result = result && getNormalizedBoundingBox() + .equals(other.getNormalizedBoundingBox()); + } + result = result && (hasTimeOffset() == other.hasTimeOffset()); + if (hasTimeOffset()) { + result = result && getTimeOffset() + .equals(other.getTimeOffset()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasNormalizedBoundingBox()) { + hash = (37 * hash) + NORMALIZED_BOUNDING_BOX_FIELD_NUMBER; + hash = (53 * hash) + getNormalizedBoundingBox().hashCode(); + } + if (hasTimeOffset()) { + hash = (37 * hash) + TIME_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getTimeOffset().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame 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.videointelligence.v1p2beta1.ObjectTrackingFrame parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame 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.videointelligence.v1p2beta1.ObjectTrackingFrame parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame 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.videointelligence.v1p2beta1.ObjectTrackingFrame parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame 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.videointelligence.v1p2beta1.ObjectTrackingFrame parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame 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.videointelligence.v1p2beta1.ObjectTrackingFrame 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; + } + /** + *
+   * Video frame level annotations for object detection and tracking. This field
+   * stores per frame location, time offset, and confidence.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame) + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrameOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingFrame_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingFrame_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.class, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.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(); + if (normalizedBoundingBoxBuilder_ == null) { + normalizedBoundingBox_ = null; + } else { + normalizedBoundingBox_ = null; + normalizedBoundingBoxBuilder_ = null; + } + if (timeOffsetBuilder_ == null) { + timeOffset_ = null; + } else { + timeOffset_ = null; + timeOffsetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingFrame_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame build() { + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame result = new com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame(this); + if (normalizedBoundingBoxBuilder_ == null) { + result.normalizedBoundingBox_ = normalizedBoundingBox_; + } else { + result.normalizedBoundingBox_ = normalizedBoundingBoxBuilder_.build(); + } + if (timeOffsetBuilder_ == null) { + result.timeOffset_ = timeOffset_; + } else { + result.timeOffset_ = timeOffsetBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.getDefaultInstance()) return this; + if (other.hasNormalizedBoundingBox()) { + mergeNormalizedBoundingBox(other.getNormalizedBoundingBox()); + } + if (other.hasTimeOffset()) { + mergeTimeOffset(other.getTimeOffset()); + } + 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.videointelligence.v1p2beta1.ObjectTrackingFrame parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalizedBoundingBox_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.Builder, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBoxOrBuilder> normalizedBoundingBoxBuilder_; + /** + *
+     * The normalized bounding box location of this object track for the frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + public boolean hasNormalizedBoundingBox() { + return normalizedBoundingBoxBuilder_ != null || normalizedBoundingBox_ != null; + } + /** + *
+     * The normalized bounding box location of this object track for the frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox getNormalizedBoundingBox() { + if (normalizedBoundingBoxBuilder_ == null) { + return normalizedBoundingBox_ == null ? com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.getDefaultInstance() : normalizedBoundingBox_; + } else { + return normalizedBoundingBoxBuilder_.getMessage(); + } + } + /** + *
+     * The normalized bounding box location of this object track for the frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + public Builder setNormalizedBoundingBox(com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox value) { + if (normalizedBoundingBoxBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + normalizedBoundingBox_ = value; + onChanged(); + } else { + normalizedBoundingBoxBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The normalized bounding box location of this object track for the frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + public Builder setNormalizedBoundingBox( + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.Builder builderForValue) { + if (normalizedBoundingBoxBuilder_ == null) { + normalizedBoundingBox_ = builderForValue.build(); + onChanged(); + } else { + normalizedBoundingBoxBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The normalized bounding box location of this object track for the frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + public Builder mergeNormalizedBoundingBox(com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox value) { + if (normalizedBoundingBoxBuilder_ == null) { + if (normalizedBoundingBox_ != null) { + normalizedBoundingBox_ = + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.newBuilder(normalizedBoundingBox_).mergeFrom(value).buildPartial(); + } else { + normalizedBoundingBox_ = value; + } + onChanged(); + } else { + normalizedBoundingBoxBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The normalized bounding box location of this object track for the frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + public Builder clearNormalizedBoundingBox() { + if (normalizedBoundingBoxBuilder_ == null) { + normalizedBoundingBox_ = null; + onChanged(); + } else { + normalizedBoundingBox_ = null; + normalizedBoundingBoxBuilder_ = null; + } + + return this; + } + /** + *
+     * The normalized bounding box location of this object track for the frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.Builder getNormalizedBoundingBoxBuilder() { + + onChanged(); + return getNormalizedBoundingBoxFieldBuilder().getBuilder(); + } + /** + *
+     * The normalized bounding box location of this object track for the frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBoxOrBuilder getNormalizedBoundingBoxOrBuilder() { + if (normalizedBoundingBoxBuilder_ != null) { + return normalizedBoundingBoxBuilder_.getMessageOrBuilder(); + } else { + return normalizedBoundingBox_ == null ? + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.getDefaultInstance() : normalizedBoundingBox_; + } + } + /** + *
+     * The normalized bounding box location of this object track for the frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.Builder, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBoxOrBuilder> + getNormalizedBoundingBoxFieldBuilder() { + if (normalizedBoundingBoxBuilder_ == null) { + normalizedBoundingBoxBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.Builder, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBoxOrBuilder>( + getNormalizedBoundingBox(), + getParentForChildren(), + isClean()); + normalizedBoundingBox_ = null; + } + return normalizedBoundingBoxBuilder_; + } + + private com.google.protobuf.Duration timeOffset_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> timeOffsetBuilder_; + /** + *
+     * The timestamp of the frame in microseconds.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public boolean hasTimeOffset() { + return timeOffsetBuilder_ != null || timeOffset_ != null; + } + /** + *
+     * The timestamp of the frame in microseconds.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public com.google.protobuf.Duration getTimeOffset() { + if (timeOffsetBuilder_ == null) { + return timeOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeOffset_; + } else { + return timeOffsetBuilder_.getMessage(); + } + } + /** + *
+     * The timestamp of the frame in microseconds.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public Builder setTimeOffset(com.google.protobuf.Duration value) { + if (timeOffsetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeOffset_ = value; + onChanged(); + } else { + timeOffsetBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The timestamp of the frame in microseconds.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public Builder setTimeOffset( + com.google.protobuf.Duration.Builder builderForValue) { + if (timeOffsetBuilder_ == null) { + timeOffset_ = builderForValue.build(); + onChanged(); + } else { + timeOffsetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The timestamp of the frame in microseconds.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public Builder mergeTimeOffset(com.google.protobuf.Duration value) { + if (timeOffsetBuilder_ == null) { + if (timeOffset_ != null) { + timeOffset_ = + com.google.protobuf.Duration.newBuilder(timeOffset_).mergeFrom(value).buildPartial(); + } else { + timeOffset_ = value; + } + onChanged(); + } else { + timeOffsetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The timestamp of the frame in microseconds.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public Builder clearTimeOffset() { + if (timeOffsetBuilder_ == null) { + timeOffset_ = null; + onChanged(); + } else { + timeOffset_ = null; + timeOffsetBuilder_ = null; + } + + return this; + } + /** + *
+     * The timestamp of the frame in microseconds.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public com.google.protobuf.Duration.Builder getTimeOffsetBuilder() { + + onChanged(); + return getTimeOffsetFieldBuilder().getBuilder(); + } + /** + *
+     * The timestamp of the frame in microseconds.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public com.google.protobuf.DurationOrBuilder getTimeOffsetOrBuilder() { + if (timeOffsetBuilder_ != null) { + return timeOffsetBuilder_.getMessageOrBuilder(); + } else { + return timeOffset_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : timeOffset_; + } + } + /** + *
+     * The timestamp of the frame in microseconds.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getTimeOffsetFieldBuilder() { + if (timeOffsetBuilder_ == null) { + timeOffsetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getTimeOffset(), + getParentForChildren(), + isClean()); + timeOffset_ = null; + } + return timeOffsetBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.ObjectTrackingFrame) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame) + private static final com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ObjectTrackingFrame parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ObjectTrackingFrame(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.videointelligence.v1p2beta1.ObjectTrackingFrame getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingFrameOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingFrameOrBuilder.java new file mode 100644 index 000000000000..fce2cb9b6e20 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ObjectTrackingFrameOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface ObjectTrackingFrameOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The normalized bounding box location of this object track for the frame.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + boolean hasNormalizedBoundingBox(); + /** + *
+   * The normalized bounding box location of this object track for the frame.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox getNormalizedBoundingBox(); + /** + *
+   * The normalized bounding box location of this object track for the frame.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBoxOrBuilder getNormalizedBoundingBoxOrBuilder(); + + /** + *
+   * The timestamp of the frame in microseconds.
+   * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + boolean hasTimeOffset(); + /** + *
+   * The timestamp of the frame in microseconds.
+   * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + com.google.protobuf.Duration getTimeOffset(); + /** + *
+   * The timestamp of the frame in microseconds.
+   * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + com.google.protobuf.DurationOrBuilder getTimeOffsetOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ShotChangeDetectionConfig.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ShotChangeDetectionConfig.java new file mode 100644 index 000000000000..bf6f63ffca9a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ShotChangeDetectionConfig.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Config for SHOT_CHANGE_DETECTION.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig} + */ +public final class ShotChangeDetectionConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig) + ShotChangeDetectionConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use ShotChangeDetectionConfig.newBuilder() to construct. + private ShotChangeDetectionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ShotChangeDetectionConfig() { + model_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ShotChangeDetectionConfig( + 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(); + + model_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ShotChangeDetectionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ShotChangeDetectionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.class, com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.Builder.class); + } + + public static final int MODEL_FIELD_NUMBER = 1; + private volatile java.lang.Object model_; + /** + *
+   * Model to use for shot change detection.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 1; + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + 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(); + model_ = s; + return s; + } + } + /** + *
+   * Model to use for shot change detection.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 1; + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 (!getModelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, model_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getModelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, model_); + } + 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.videointelligence.v1p2beta1.ShotChangeDetectionConfig)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig other = (com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig) obj; + + boolean result = true; + result = result && getModel() + .equals(other.getModel()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig 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.videointelligence.v1p2beta1.ShotChangeDetectionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig 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.videointelligence.v1p2beta1.ShotChangeDetectionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig 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.videointelligence.v1p2beta1.ShotChangeDetectionConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig 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.videointelligence.v1p2beta1.ShotChangeDetectionConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig 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.videointelligence.v1p2beta1.ShotChangeDetectionConfig 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; + } + /** + *
+   * Config for SHOT_CHANGE_DETECTION.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig) + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ShotChangeDetectionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ShotChangeDetectionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.class, com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.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(); + model_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_ShotChangeDetectionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig build() { + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig result = new com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig(this); + result.model_ = model_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.getDefaultInstance()) return this; + if (!other.getModel().isEmpty()) { + model_ = other.model_; + onChanged(); + } + 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.videointelligence.v1p2beta1.ShotChangeDetectionConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object model_ = ""; + /** + *
+     * Model to use for shot change detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 1; + */ + public java.lang.String getModel() { + java.lang.Object ref = model_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + model_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Model to use for shot change detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 1; + */ + public com.google.protobuf.ByteString + getModelBytes() { + java.lang.Object ref = model_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + model_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Model to use for shot change detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 1; + */ + public Builder setModel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + model_ = value; + onChanged(); + return this; + } + /** + *
+     * Model to use for shot change detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 1; + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + *
+     * Model to use for shot change detection.
+     * Supported values: "builtin/stable" (the default if unset) and
+     * "builtin/latest".
+     * 
+ * + * string model = 1; + */ + public Builder setModelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + model_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.ShotChangeDetectionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig) + private static final com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ShotChangeDetectionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ShotChangeDetectionConfig(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.videointelligence.v1p2beta1.ShotChangeDetectionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ShotChangeDetectionConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ShotChangeDetectionConfigOrBuilder.java new file mode 100644 index 000000000000..e38a4f5af45f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/ShotChangeDetectionConfigOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface ShotChangeDetectionConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Model to use for shot change detection.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 1; + */ + java.lang.String getModel(); + /** + *
+   * Model to use for shot change detection.
+   * Supported values: "builtin/stable" (the default if unset) and
+   * "builtin/latest".
+   * 
+ * + * string model = 1; + */ + com.google.protobuf.ByteString + getModelBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextAnnotation.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextAnnotation.java new file mode 100644 index 000000000000..409b0c1adbc4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextAnnotation.java @@ -0,0 +1,1537 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Annotations related to one detected OCR text snippet. This will contain the
+ * corresponding text, confidence value, and frame level information for each
+ * detection.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.TextAnnotation} + */ +public final class TextAnnotation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.TextAnnotation) + TextAnnotationOrBuilder { +private static final long serialVersionUID = 0L; + // Use TextAnnotation.newBuilder() to construct. + private TextAnnotation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextAnnotation() { + text_ = ""; + confidence_ = 0F; + frames_ = java.util.Collections.emptyList(); + segments_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TextAnnotation( + 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(); + + text_ = s; + break; + } + case 21: { + + confidence_ = input.readFloat(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + frames_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + frames_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.TextFrame.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + segments_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + segments_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.TextSegment.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + frames_ = java.util.Collections.unmodifiableList(frames_); + } + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + segments_ = java.util.Collections.unmodifiableList(segments_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.class, com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.Builder.class); + } + + private int bitField0_; + public static final int TEXT_FIELD_NUMBER = 1; + private volatile java.lang.Object text_; + /** + *
+   * The detected text.
+   * 
+ * + * string text = 1; + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + 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(); + text_ = s; + return s; + } + } + /** + *
+   * The detected text.
+   * 
+ * + * string text = 1; + */ + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIDENCE_FIELD_NUMBER = 2; + private float confidence_; + /** + *
+   * Confidence for the track of detected text. It is calculated as the highest
+   * over all frames where OCR detected text appears.
+   * 
+ * + * float confidence = 2; + */ + public float getConfidence() { + return confidence_; + } + + public static final int FRAMES_FIELD_NUMBER = 3; + private java.util.List frames_; + /** + *
+   * Information related to the frames where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public java.util.List getFramesList() { + return frames_; + } + /** + *
+   * Information related to the frames where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public java.util.List + getFramesOrBuilderList() { + return frames_; + } + /** + *
+   * Information related to the frames where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public int getFramesCount() { + return frames_.size(); + } + /** + *
+   * Information related to the frames where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextFrame getFrames(int index) { + return frames_.get(index); + } + /** + *
+   * Information related to the frames where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextFrameOrBuilder getFramesOrBuilder( + int index) { + return frames_.get(index); + } + + public static final int SEGMENTS_FIELD_NUMBER = 4; + private java.util.List segments_; + /** + *
+   * All video segments where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public java.util.List getSegmentsList() { + return segments_; + } + /** + *
+   * All video segments where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public java.util.List + getSegmentsOrBuilderList() { + return segments_; + } + /** + *
+   * All video segments where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public int getSegmentsCount() { + return segments_.size(); + } + /** + *
+   * All video segments where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextSegment getSegments(int index) { + return segments_.get(index); + } + /** + *
+   * All video segments where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextSegmentOrBuilder getSegmentsOrBuilder( + int index) { + return segments_.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 (!getTextBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_); + } + if (confidence_ != 0F) { + output.writeFloat(2, confidence_); + } + for (int i = 0; i < frames_.size(); i++) { + output.writeMessage(3, frames_.get(i)); + } + for (int i = 0; i < segments_.size(); i++) { + output.writeMessage(4, segments_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTextBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, text_); + } + if (confidence_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, confidence_); + } + for (int i = 0; i < frames_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, frames_.get(i)); + } + for (int i = 0; i < segments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, segments_.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.videointelligence.v1p2beta1.TextAnnotation)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.TextAnnotation other = (com.google.cloud.videointelligence.v1p2beta1.TextAnnotation) obj; + + boolean result = true; + result = result && getText() + .equals(other.getText()); + result = result && ( + java.lang.Float.floatToIntBits(getConfidence()) + == java.lang.Float.floatToIntBits( + other.getConfidence())); + result = result && getFramesList() + .equals(other.getFramesList()); + result = result && getSegmentsList() + .equals(other.getSegmentsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TEXT_FIELD_NUMBER; + hash = (53 * hash) + getText().hashCode(); + hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getConfidence()); + if (getFramesCount() > 0) { + hash = (37 * hash) + FRAMES_FIELD_NUMBER; + hash = (53 * hash) + getFramesList().hashCode(); + } + if (getSegmentsCount() > 0) { + hash = (37 * hash) + SEGMENTS_FIELD_NUMBER; + hash = (53 * hash) + getSegmentsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.TextAnnotation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextAnnotation 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.videointelligence.v1p2beta1.TextAnnotation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextAnnotation 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.videointelligence.v1p2beta1.TextAnnotation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextAnnotation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextAnnotation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextAnnotation 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.videointelligence.v1p2beta1.TextAnnotation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextAnnotation 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.videointelligence.v1p2beta1.TextAnnotation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextAnnotation 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.videointelligence.v1p2beta1.TextAnnotation 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; + } + /** + *
+   * Annotations related to one detected OCR text snippet. This will contain the
+   * corresponding text, confidence value, and frame level information for each
+   * detection.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.TextAnnotation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.TextAnnotation) + com.google.cloud.videointelligence.v1p2beta1.TextAnnotationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextAnnotation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextAnnotation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.class, com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getFramesFieldBuilder(); + getSegmentsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + text_ = ""; + + confidence_ = 0F; + + if (framesBuilder_ == null) { + frames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + framesBuilder_.clear(); + } + if (segmentsBuilder_ == null) { + segments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + segmentsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextAnnotation_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.TextAnnotation getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.TextAnnotation build() { + com.google.cloud.videointelligence.v1p2beta1.TextAnnotation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.TextAnnotation buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.TextAnnotation result = new com.google.cloud.videointelligence.v1p2beta1.TextAnnotation(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.text_ = text_; + result.confidence_ = confidence_; + if (framesBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + frames_ = java.util.Collections.unmodifiableList(frames_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.frames_ = frames_; + } else { + result.frames_ = framesBuilder_.build(); + } + if (segmentsBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + segments_ = java.util.Collections.unmodifiableList(segments_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.segments_ = segments_; + } else { + result.segments_ = segmentsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.TextAnnotation) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.TextAnnotation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.TextAnnotation other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.getDefaultInstance()) return this; + if (!other.getText().isEmpty()) { + text_ = other.text_; + onChanged(); + } + if (other.getConfidence() != 0F) { + setConfidence(other.getConfidence()); + } + if (framesBuilder_ == null) { + if (!other.frames_.isEmpty()) { + if (frames_.isEmpty()) { + frames_ = other.frames_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureFramesIsMutable(); + frames_.addAll(other.frames_); + } + onChanged(); + } + } else { + if (!other.frames_.isEmpty()) { + if (framesBuilder_.isEmpty()) { + framesBuilder_.dispose(); + framesBuilder_ = null; + frames_ = other.frames_; + bitField0_ = (bitField0_ & ~0x00000004); + framesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFramesFieldBuilder() : null; + } else { + framesBuilder_.addAllMessages(other.frames_); + } + } + } + if (segmentsBuilder_ == null) { + if (!other.segments_.isEmpty()) { + if (segments_.isEmpty()) { + segments_ = other.segments_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureSegmentsIsMutable(); + segments_.addAll(other.segments_); + } + onChanged(); + } + } else { + if (!other.segments_.isEmpty()) { + if (segmentsBuilder_.isEmpty()) { + segmentsBuilder_.dispose(); + segmentsBuilder_ = null; + segments_ = other.segments_; + bitField0_ = (bitField0_ & ~0x00000008); + segmentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSegmentsFieldBuilder() : null; + } else { + segmentsBuilder_.addAllMessages(other.segments_); + } + } + } + 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.videointelligence.v1p2beta1.TextAnnotation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.TextAnnotation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object text_ = ""; + /** + *
+     * The detected text.
+     * 
+ * + * string text = 1; + */ + public java.lang.String getText() { + java.lang.Object ref = text_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + text_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The detected text.
+     * 
+ * + * string text = 1; + */ + public com.google.protobuf.ByteString + getTextBytes() { + java.lang.Object ref = text_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + text_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The detected text.
+     * 
+ * + * string text = 1; + */ + public Builder setText( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + text_ = value; + onChanged(); + return this; + } + /** + *
+     * The detected text.
+     * 
+ * + * string text = 1; + */ + public Builder clearText() { + + text_ = getDefaultInstance().getText(); + onChanged(); + return this; + } + /** + *
+     * The detected text.
+     * 
+ * + * string text = 1; + */ + public Builder setTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + text_ = value; + onChanged(); + return this; + } + + private float confidence_ ; + /** + *
+     * Confidence for the track of detected text. It is calculated as the highest
+     * over all frames where OCR detected text appears.
+     * 
+ * + * float confidence = 2; + */ + public float getConfidence() { + return confidence_; + } + /** + *
+     * Confidence for the track of detected text. It is calculated as the highest
+     * over all frames where OCR detected text appears.
+     * 
+ * + * float confidence = 2; + */ + public Builder setConfidence(float value) { + + confidence_ = value; + onChanged(); + return this; + } + /** + *
+     * Confidence for the track of detected text. It is calculated as the highest
+     * over all frames where OCR detected text appears.
+     * 
+ * + * float confidence = 2; + */ + public Builder clearConfidence() { + + confidence_ = 0F; + onChanged(); + return this; + } + + private java.util.List frames_ = + java.util.Collections.emptyList(); + private void ensureFramesIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + frames_ = new java.util.ArrayList(frames_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.TextFrame, com.google.cloud.videointelligence.v1p2beta1.TextFrame.Builder, com.google.cloud.videointelligence.v1p2beta1.TextFrameOrBuilder> framesBuilder_; + + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public java.util.List getFramesList() { + if (framesBuilder_ == null) { + return java.util.Collections.unmodifiableList(frames_); + } else { + return framesBuilder_.getMessageList(); + } + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public int getFramesCount() { + if (framesBuilder_ == null) { + return frames_.size(); + } else { + return framesBuilder_.getCount(); + } + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextFrame getFrames(int index) { + if (framesBuilder_ == null) { + return frames_.get(index); + } else { + return framesBuilder_.getMessage(index); + } + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public Builder setFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.TextFrame value) { + if (framesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFramesIsMutable(); + frames_.set(index, value); + onChanged(); + } else { + framesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public Builder setFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.TextFrame.Builder builderForValue) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.set(index, builderForValue.build()); + onChanged(); + } else { + framesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public Builder addFrames(com.google.cloud.videointelligence.v1p2beta1.TextFrame value) { + if (framesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFramesIsMutable(); + frames_.add(value); + onChanged(); + } else { + framesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public Builder addFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.TextFrame value) { + if (framesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFramesIsMutable(); + frames_.add(index, value); + onChanged(); + } else { + framesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public Builder addFrames( + com.google.cloud.videointelligence.v1p2beta1.TextFrame.Builder builderForValue) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.add(builderForValue.build()); + onChanged(); + } else { + framesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public Builder addFrames( + int index, com.google.cloud.videointelligence.v1p2beta1.TextFrame.Builder builderForValue) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.add(index, builderForValue.build()); + onChanged(); + } else { + framesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public Builder addAllFrames( + java.lang.Iterable values) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, frames_); + onChanged(); + } else { + framesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public Builder clearFrames() { + if (framesBuilder_ == null) { + frames_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + framesBuilder_.clear(); + } + return this; + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public Builder removeFrames(int index) { + if (framesBuilder_ == null) { + ensureFramesIsMutable(); + frames_.remove(index); + onChanged(); + } else { + framesBuilder_.remove(index); + } + return this; + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextFrame.Builder getFramesBuilder( + int index) { + return getFramesFieldBuilder().getBuilder(index); + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextFrameOrBuilder getFramesOrBuilder( + int index) { + if (framesBuilder_ == null) { + return frames_.get(index); } else { + return framesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public java.util.List + getFramesOrBuilderList() { + if (framesBuilder_ != null) { + return framesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(frames_); + } + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextFrame.Builder addFramesBuilder() { + return getFramesFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.TextFrame.getDefaultInstance()); + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextFrame.Builder addFramesBuilder( + int index) { + return getFramesFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.TextFrame.getDefaultInstance()); + } + /** + *
+     * Information related to the frames where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + public java.util.List + getFramesBuilderList() { + return getFramesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.TextFrame, com.google.cloud.videointelligence.v1p2beta1.TextFrame.Builder, com.google.cloud.videointelligence.v1p2beta1.TextFrameOrBuilder> + getFramesFieldBuilder() { + if (framesBuilder_ == null) { + framesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.TextFrame, com.google.cloud.videointelligence.v1p2beta1.TextFrame.Builder, com.google.cloud.videointelligence.v1p2beta1.TextFrameOrBuilder>( + frames_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + frames_ = null; + } + return framesBuilder_; + } + + private java.util.List segments_ = + java.util.Collections.emptyList(); + private void ensureSegmentsIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + segments_ = new java.util.ArrayList(segments_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.TextSegment, com.google.cloud.videointelligence.v1p2beta1.TextSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.TextSegmentOrBuilder> segmentsBuilder_; + + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public java.util.List getSegmentsList() { + if (segmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(segments_); + } else { + return segmentsBuilder_.getMessageList(); + } + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public int getSegmentsCount() { + if (segmentsBuilder_ == null) { + return segments_.size(); + } else { + return segmentsBuilder_.getCount(); + } + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextSegment getSegments(int index) { + if (segmentsBuilder_ == null) { + return segments_.get(index); + } else { + return segmentsBuilder_.getMessage(index); + } + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public Builder setSegments( + int index, com.google.cloud.videointelligence.v1p2beta1.TextSegment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.set(index, value); + onChanged(); + } else { + segmentsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public Builder setSegments( + int index, com.google.cloud.videointelligence.v1p2beta1.TextSegment.Builder builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.set(index, builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public Builder addSegments(com.google.cloud.videointelligence.v1p2beta1.TextSegment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.add(value); + onChanged(); + } else { + segmentsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public Builder addSegments( + int index, com.google.cloud.videointelligence.v1p2beta1.TextSegment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.add(index, value); + onChanged(); + } else { + segmentsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public Builder addSegments( + com.google.cloud.videointelligence.v1p2beta1.TextSegment.Builder builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public Builder addSegments( + int index, com.google.cloud.videointelligence.v1p2beta1.TextSegment.Builder builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(index, builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public Builder addAllSegments( + java.lang.Iterable values) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, segments_); + onChanged(); + } else { + segmentsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public Builder clearSegments() { + if (segmentsBuilder_ == null) { + segments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + segmentsBuilder_.clear(); + } + return this; + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public Builder removeSegments(int index) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.remove(index); + onChanged(); + } else { + segmentsBuilder_.remove(index); + } + return this; + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextSegment.Builder getSegmentsBuilder( + int index) { + return getSegmentsFieldBuilder().getBuilder(index); + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextSegmentOrBuilder getSegmentsOrBuilder( + int index) { + if (segmentsBuilder_ == null) { + return segments_.get(index); } else { + return segmentsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public java.util.List + getSegmentsOrBuilderList() { + if (segmentsBuilder_ != null) { + return segmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(segments_); + } + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextSegment.Builder addSegmentsBuilder() { + return getSegmentsFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.TextSegment.getDefaultInstance()); + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextSegment.Builder addSegmentsBuilder( + int index) { + return getSegmentsFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.TextSegment.getDefaultInstance()); + } + /** + *
+     * All video segments where OCR detected text appears.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + public java.util.List + getSegmentsBuilderList() { + return getSegmentsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.TextSegment, com.google.cloud.videointelligence.v1p2beta1.TextSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.TextSegmentOrBuilder> + getSegmentsFieldBuilder() { + if (segmentsBuilder_ == null) { + segmentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.TextSegment, com.google.cloud.videointelligence.v1p2beta1.TextSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.TextSegmentOrBuilder>( + segments_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + segments_ = null; + } + return segmentsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.TextAnnotation) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.TextAnnotation) + private static final com.google.cloud.videointelligence.v1p2beta1.TextAnnotation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.TextAnnotation(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.TextAnnotation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextAnnotation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextAnnotation(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.videointelligence.v1p2beta1.TextAnnotation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextAnnotationOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextAnnotationOrBuilder.java new file mode 100644 index 000000000000..c9f1f91600eb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextAnnotationOrBuilder.java @@ -0,0 +1,125 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface TextAnnotationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.TextAnnotation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The detected text.
+   * 
+ * + * string text = 1; + */ + java.lang.String getText(); + /** + *
+   * The detected text.
+   * 
+ * + * string text = 1; + */ + com.google.protobuf.ByteString + getTextBytes(); + + /** + *
+   * Confidence for the track of detected text. It is calculated as the highest
+   * over all frames where OCR detected text appears.
+   * 
+ * + * float confidence = 2; + */ + float getConfidence(); + + /** + *
+   * Information related to the frames where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + java.util.List + getFramesList(); + /** + *
+   * Information related to the frames where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + com.google.cloud.videointelligence.v1p2beta1.TextFrame getFrames(int index); + /** + *
+   * Information related to the frames where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + int getFramesCount(); + /** + *
+   * Information related to the frames where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + java.util.List + getFramesOrBuilderList(); + /** + *
+   * Information related to the frames where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextFrame frames = 3; + */ + com.google.cloud.videointelligence.v1p2beta1.TextFrameOrBuilder getFramesOrBuilder( + int index); + + /** + *
+   * All video segments where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + java.util.List + getSegmentsList(); + /** + *
+   * All video segments where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + com.google.cloud.videointelligence.v1p2beta1.TextSegment getSegments(int index); + /** + *
+   * All video segments where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + int getSegmentsCount(); + /** + *
+   * All video segments where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + java.util.List + getSegmentsOrBuilderList(); + /** + *
+   * All video segments where OCR detected text appears.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextSegment segments = 4; + */ + com.google.cloud.videointelligence.v1p2beta1.TextSegmentOrBuilder getSegmentsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextDetectionConfig.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextDetectionConfig.java new file mode 100644 index 000000000000..1d2b87ae6da8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextDetectionConfig.java @@ -0,0 +1,685 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Config for TEXT_DETECTION.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.TextDetectionConfig} + */ +public final class TextDetectionConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.TextDetectionConfig) + TextDetectionConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use TextDetectionConfig.newBuilder() to construct. + private TextDetectionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextDetectionConfig() { + languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TextDetectionConfig( + 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(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + languageHints_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + languageHints_.add(s); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + languageHints_ = languageHints_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextDetectionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextDetectionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.class, com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.Builder.class); + } + + public static final int LANGUAGE_HINTS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList languageHints_; + /** + *
+   * Language hint can be specified if the language to be detected is known a
+   * priori. It can increase the accuracy of the detection. Language hint must
+   * be language code in BCP-47 format.
+   * Automatic language detection is performed if no hint is provided.
+   * 
+ * + * repeated string language_hints = 1; + */ + public com.google.protobuf.ProtocolStringList + getLanguageHintsList() { + return languageHints_; + } + /** + *
+   * Language hint can be specified if the language to be detected is known a
+   * priori. It can increase the accuracy of the detection. Language hint must
+   * be language code in BCP-47 format.
+   * Automatic language detection is performed if no hint is provided.
+   * 
+ * + * repeated string language_hints = 1; + */ + public int getLanguageHintsCount() { + return languageHints_.size(); + } + /** + *
+   * Language hint can be specified if the language to be detected is known a
+   * priori. It can increase the accuracy of the detection. Language hint must
+   * be language code in BCP-47 format.
+   * Automatic language detection is performed if no hint is provided.
+   * 
+ * + * repeated string language_hints = 1; + */ + public java.lang.String getLanguageHints(int index) { + return languageHints_.get(index); + } + /** + *
+   * Language hint can be specified if the language to be detected is known a
+   * priori. It can increase the accuracy of the detection. Language hint must
+   * be language code in BCP-47 format.
+   * Automatic language detection is performed if no hint is provided.
+   * 
+ * + * repeated string language_hints = 1; + */ + public com.google.protobuf.ByteString + getLanguageHintsBytes(int index) { + return languageHints_.getByteString(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 { + for (int i = 0; i < languageHints_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, languageHints_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < languageHints_.size(); i++) { + dataSize += computeStringSizeNoTag(languageHints_.getRaw(i)); + } + size += dataSize; + size += 1 * getLanguageHintsList().size(); + } + 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.videointelligence.v1p2beta1.TextDetectionConfig)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig other = (com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig) obj; + + boolean result = true; + result = result && getLanguageHintsList() + .equals(other.getLanguageHintsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLanguageHintsCount() > 0) { + hash = (37 * hash) + LANGUAGE_HINTS_FIELD_NUMBER; + hash = (53 * hash) + getLanguageHintsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig 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.videointelligence.v1p2beta1.TextDetectionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig 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.videointelligence.v1p2beta1.TextDetectionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig 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.videointelligence.v1p2beta1.TextDetectionConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig 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.videointelligence.v1p2beta1.TextDetectionConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig 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.videointelligence.v1p2beta1.TextDetectionConfig 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; + } + /** + *
+   * Config for TEXT_DETECTION.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.TextDetectionConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.TextDetectionConfig) + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextDetectionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextDetectionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.class, com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.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(); + languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextDetectionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig build() { + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig result = new com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + languageHints_ = languageHints_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.languageHints_ = languageHints_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.getDefaultInstance()) return this; + if (!other.languageHints_.isEmpty()) { + if (languageHints_.isEmpty()) { + languageHints_ = other.languageHints_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLanguageHintsIsMutable(); + languageHints_.addAll(other.languageHints_); + } + onChanged(); + } + 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.videointelligence.v1p2beta1.TextDetectionConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureLanguageHintsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + languageHints_ = new com.google.protobuf.LazyStringArrayList(languageHints_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * Language hint can be specified if the language to be detected is known a
+     * priori. It can increase the accuracy of the detection. Language hint must
+     * be language code in BCP-47 format.
+     * Automatic language detection is performed if no hint is provided.
+     * 
+ * + * repeated string language_hints = 1; + */ + public com.google.protobuf.ProtocolStringList + getLanguageHintsList() { + return languageHints_.getUnmodifiableView(); + } + /** + *
+     * Language hint can be specified if the language to be detected is known a
+     * priori. It can increase the accuracy of the detection. Language hint must
+     * be language code in BCP-47 format.
+     * Automatic language detection is performed if no hint is provided.
+     * 
+ * + * repeated string language_hints = 1; + */ + public int getLanguageHintsCount() { + return languageHints_.size(); + } + /** + *
+     * Language hint can be specified if the language to be detected is known a
+     * priori. It can increase the accuracy of the detection. Language hint must
+     * be language code in BCP-47 format.
+     * Automatic language detection is performed if no hint is provided.
+     * 
+ * + * repeated string language_hints = 1; + */ + public java.lang.String getLanguageHints(int index) { + return languageHints_.get(index); + } + /** + *
+     * Language hint can be specified if the language to be detected is known a
+     * priori. It can increase the accuracy of the detection. Language hint must
+     * be language code in BCP-47 format.
+     * Automatic language detection is performed if no hint is provided.
+     * 
+ * + * repeated string language_hints = 1; + */ + public com.google.protobuf.ByteString + getLanguageHintsBytes(int index) { + return languageHints_.getByteString(index); + } + /** + *
+     * Language hint can be specified if the language to be detected is known a
+     * priori. It can increase the accuracy of the detection. Language hint must
+     * be language code in BCP-47 format.
+     * Automatic language detection is performed if no hint is provided.
+     * 
+ * + * repeated string language_hints = 1; + */ + public Builder setLanguageHints( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguageHintsIsMutable(); + languageHints_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Language hint can be specified if the language to be detected is known a
+     * priori. It can increase the accuracy of the detection. Language hint must
+     * be language code in BCP-47 format.
+     * Automatic language detection is performed if no hint is provided.
+     * 
+ * + * repeated string language_hints = 1; + */ + public Builder addLanguageHints( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguageHintsIsMutable(); + languageHints_.add(value); + onChanged(); + return this; + } + /** + *
+     * Language hint can be specified if the language to be detected is known a
+     * priori. It can increase the accuracy of the detection. Language hint must
+     * be language code in BCP-47 format.
+     * Automatic language detection is performed if no hint is provided.
+     * 
+ * + * repeated string language_hints = 1; + */ + public Builder addAllLanguageHints( + java.lang.Iterable values) { + ensureLanguageHintsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, languageHints_); + onChanged(); + return this; + } + /** + *
+     * Language hint can be specified if the language to be detected is known a
+     * priori. It can increase the accuracy of the detection. Language hint must
+     * be language code in BCP-47 format.
+     * Automatic language detection is performed if no hint is provided.
+     * 
+ * + * repeated string language_hints = 1; + */ + public Builder clearLanguageHints() { + languageHints_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * Language hint can be specified if the language to be detected is known a
+     * priori. It can increase the accuracy of the detection. Language hint must
+     * be language code in BCP-47 format.
+     * Automatic language detection is performed if no hint is provided.
+     * 
+ * + * repeated string language_hints = 1; + */ + public Builder addLanguageHintsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLanguageHintsIsMutable(); + languageHints_.add(value); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.TextDetectionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.TextDetectionConfig) + private static final com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextDetectionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextDetectionConfig(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.videointelligence.v1p2beta1.TextDetectionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextDetectionConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextDetectionConfigOrBuilder.java new file mode 100644 index 000000000000..615c5f9fc196 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextDetectionConfigOrBuilder.java @@ -0,0 +1,56 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface TextDetectionConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.TextDetectionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Language hint can be specified if the language to be detected is known a
+   * priori. It can increase the accuracy of the detection. Language hint must
+   * be language code in BCP-47 format.
+   * Automatic language detection is performed if no hint is provided.
+   * 
+ * + * repeated string language_hints = 1; + */ + java.util.List + getLanguageHintsList(); + /** + *
+   * Language hint can be specified if the language to be detected is known a
+   * priori. It can increase the accuracy of the detection. Language hint must
+   * be language code in BCP-47 format.
+   * Automatic language detection is performed if no hint is provided.
+   * 
+ * + * repeated string language_hints = 1; + */ + int getLanguageHintsCount(); + /** + *
+   * Language hint can be specified if the language to be detected is known a
+   * priori. It can increase the accuracy of the detection. Language hint must
+   * be language code in BCP-47 format.
+   * Automatic language detection is performed if no hint is provided.
+   * 
+ * + * repeated string language_hints = 1; + */ + java.lang.String getLanguageHints(int index); + /** + *
+   * Language hint can be specified if the language to be detected is known a
+   * priori. It can increase the accuracy of the detection. Language hint must
+   * be language code in BCP-47 format.
+   * Automatic language detection is performed if no hint is provided.
+   * 
+ * + * repeated string language_hints = 1; + */ + com.google.protobuf.ByteString + getLanguageHintsBytes(int index); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextFrame.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextFrame.java new file mode 100644 index 000000000000..08aef98d335b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextFrame.java @@ -0,0 +1,884 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Video frame level annotation results for text annotation (OCR).
+ * Contains information regarding timestamp and bounding box locations for the
+ * frames containing detected OCR text snippets.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.TextFrame} + */ +public final class TextFrame extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.TextFrame) + TextFrameOrBuilder { +private static final long serialVersionUID = 0L; + // Use TextFrame.newBuilder() to construct. + private TextFrame(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextFrame() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TextFrame( + 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: { + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.Builder subBuilder = null; + if (rotatedBoundingBox_ != null) { + subBuilder = rotatedBoundingBox_.toBuilder(); + } + rotatedBoundingBox_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(rotatedBoundingBox_); + rotatedBoundingBox_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (timeOffset_ != null) { + subBuilder = timeOffset_.toBuilder(); + } + timeOffset_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(timeOffset_); + timeOffset_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextFrame_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextFrame_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.TextFrame.class, com.google.cloud.videointelligence.v1p2beta1.TextFrame.Builder.class); + } + + public static final int ROTATED_BOUNDING_BOX_FIELD_NUMBER = 1; + private com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotatedBoundingBox_; + /** + *
+   * Bounding polygon of the detected text for this frame.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + public boolean hasRotatedBoundingBox() { + return rotatedBoundingBox_ != null; + } + /** + *
+   * Bounding polygon of the detected text for this frame.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly getRotatedBoundingBox() { + return rotatedBoundingBox_ == null ? com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.getDefaultInstance() : rotatedBoundingBox_; + } + /** + *
+   * Bounding polygon of the detected text for this frame.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPolyOrBuilder getRotatedBoundingBoxOrBuilder() { + return getRotatedBoundingBox(); + } + + public static final int TIME_OFFSET_FIELD_NUMBER = 2; + private com.google.protobuf.Duration timeOffset_; + /** + *
+   * Timestamp of this frame.
+   * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public boolean hasTimeOffset() { + return timeOffset_ != null; + } + /** + *
+   * Timestamp of this frame.
+   * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public com.google.protobuf.Duration getTimeOffset() { + return timeOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeOffset_; + } + /** + *
+   * Timestamp of this frame.
+   * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public com.google.protobuf.DurationOrBuilder getTimeOffsetOrBuilder() { + return getTimeOffset(); + } + + 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 (rotatedBoundingBox_ != null) { + output.writeMessage(1, getRotatedBoundingBox()); + } + if (timeOffset_ != null) { + output.writeMessage(2, getTimeOffset()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rotatedBoundingBox_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRotatedBoundingBox()); + } + if (timeOffset_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTimeOffset()); + } + 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.videointelligence.v1p2beta1.TextFrame)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.TextFrame other = (com.google.cloud.videointelligence.v1p2beta1.TextFrame) obj; + + boolean result = true; + result = result && (hasRotatedBoundingBox() == other.hasRotatedBoundingBox()); + if (hasRotatedBoundingBox()) { + result = result && getRotatedBoundingBox() + .equals(other.getRotatedBoundingBox()); + } + result = result && (hasTimeOffset() == other.hasTimeOffset()); + if (hasTimeOffset()) { + result = result && getTimeOffset() + .equals(other.getTimeOffset()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRotatedBoundingBox()) { + hash = (37 * hash) + ROTATED_BOUNDING_BOX_FIELD_NUMBER; + hash = (53 * hash) + getRotatedBoundingBox().hashCode(); + } + if (hasTimeOffset()) { + hash = (37 * hash) + TIME_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getTimeOffset().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.TextFrame parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextFrame 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.videointelligence.v1p2beta1.TextFrame parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextFrame 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.videointelligence.v1p2beta1.TextFrame parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextFrame parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextFrame parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextFrame 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.videointelligence.v1p2beta1.TextFrame parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextFrame 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.videointelligence.v1p2beta1.TextFrame parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextFrame 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.videointelligence.v1p2beta1.TextFrame 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; + } + /** + *
+   * Video frame level annotation results for text annotation (OCR).
+   * Contains information regarding timestamp and bounding box locations for the
+   * frames containing detected OCR text snippets.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.TextFrame} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.TextFrame) + com.google.cloud.videointelligence.v1p2beta1.TextFrameOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextFrame_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextFrame_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.TextFrame.class, com.google.cloud.videointelligence.v1p2beta1.TextFrame.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.TextFrame.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(); + if (rotatedBoundingBoxBuilder_ == null) { + rotatedBoundingBox_ = null; + } else { + rotatedBoundingBox_ = null; + rotatedBoundingBoxBuilder_ = null; + } + if (timeOffsetBuilder_ == null) { + timeOffset_ = null; + } else { + timeOffset_ = null; + timeOffsetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextFrame_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.TextFrame getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.TextFrame.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.TextFrame build() { + com.google.cloud.videointelligence.v1p2beta1.TextFrame result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.TextFrame buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.TextFrame result = new com.google.cloud.videointelligence.v1p2beta1.TextFrame(this); + if (rotatedBoundingBoxBuilder_ == null) { + result.rotatedBoundingBox_ = rotatedBoundingBox_; + } else { + result.rotatedBoundingBox_ = rotatedBoundingBoxBuilder_.build(); + } + if (timeOffsetBuilder_ == null) { + result.timeOffset_ = timeOffset_; + } else { + result.timeOffset_ = timeOffsetBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.TextFrame) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.TextFrame)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.TextFrame other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.TextFrame.getDefaultInstance()) return this; + if (other.hasRotatedBoundingBox()) { + mergeRotatedBoundingBox(other.getRotatedBoundingBox()); + } + if (other.hasTimeOffset()) { + mergeTimeOffset(other.getTimeOffset()); + } + 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.videointelligence.v1p2beta1.TextFrame parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.TextFrame) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotatedBoundingBox_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.Builder, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPolyOrBuilder> rotatedBoundingBoxBuilder_; + /** + *
+     * Bounding polygon of the detected text for this frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + public boolean hasRotatedBoundingBox() { + return rotatedBoundingBoxBuilder_ != null || rotatedBoundingBox_ != null; + } + /** + *
+     * Bounding polygon of the detected text for this frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly getRotatedBoundingBox() { + if (rotatedBoundingBoxBuilder_ == null) { + return rotatedBoundingBox_ == null ? com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.getDefaultInstance() : rotatedBoundingBox_; + } else { + return rotatedBoundingBoxBuilder_.getMessage(); + } + } + /** + *
+     * Bounding polygon of the detected text for this frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + public Builder setRotatedBoundingBox(com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly value) { + if (rotatedBoundingBoxBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rotatedBoundingBox_ = value; + onChanged(); + } else { + rotatedBoundingBoxBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Bounding polygon of the detected text for this frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + public Builder setRotatedBoundingBox( + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.Builder builderForValue) { + if (rotatedBoundingBoxBuilder_ == null) { + rotatedBoundingBox_ = builderForValue.build(); + onChanged(); + } else { + rotatedBoundingBoxBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Bounding polygon of the detected text for this frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + public Builder mergeRotatedBoundingBox(com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly value) { + if (rotatedBoundingBoxBuilder_ == null) { + if (rotatedBoundingBox_ != null) { + rotatedBoundingBox_ = + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.newBuilder(rotatedBoundingBox_).mergeFrom(value).buildPartial(); + } else { + rotatedBoundingBox_ = value; + } + onChanged(); + } else { + rotatedBoundingBoxBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Bounding polygon of the detected text for this frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + public Builder clearRotatedBoundingBox() { + if (rotatedBoundingBoxBuilder_ == null) { + rotatedBoundingBox_ = null; + onChanged(); + } else { + rotatedBoundingBox_ = null; + rotatedBoundingBoxBuilder_ = null; + } + + return this; + } + /** + *
+     * Bounding polygon of the detected text for this frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.Builder getRotatedBoundingBoxBuilder() { + + onChanged(); + return getRotatedBoundingBoxFieldBuilder().getBuilder(); + } + /** + *
+     * Bounding polygon of the detected text for this frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPolyOrBuilder getRotatedBoundingBoxOrBuilder() { + if (rotatedBoundingBoxBuilder_ != null) { + return rotatedBoundingBoxBuilder_.getMessageOrBuilder(); + } else { + return rotatedBoundingBox_ == null ? + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.getDefaultInstance() : rotatedBoundingBox_; + } + } + /** + *
+     * Bounding polygon of the detected text for this frame.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.Builder, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPolyOrBuilder> + getRotatedBoundingBoxFieldBuilder() { + if (rotatedBoundingBoxBuilder_ == null) { + rotatedBoundingBoxBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.Builder, com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPolyOrBuilder>( + getRotatedBoundingBox(), + getParentForChildren(), + isClean()); + rotatedBoundingBox_ = null; + } + return rotatedBoundingBoxBuilder_; + } + + private com.google.protobuf.Duration timeOffset_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> timeOffsetBuilder_; + /** + *
+     * Timestamp of this frame.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public boolean hasTimeOffset() { + return timeOffsetBuilder_ != null || timeOffset_ != null; + } + /** + *
+     * Timestamp of this frame.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public com.google.protobuf.Duration getTimeOffset() { + if (timeOffsetBuilder_ == null) { + return timeOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : timeOffset_; + } else { + return timeOffsetBuilder_.getMessage(); + } + } + /** + *
+     * Timestamp of this frame.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public Builder setTimeOffset(com.google.protobuf.Duration value) { + if (timeOffsetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + timeOffset_ = value; + onChanged(); + } else { + timeOffsetBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Timestamp of this frame.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public Builder setTimeOffset( + com.google.protobuf.Duration.Builder builderForValue) { + if (timeOffsetBuilder_ == null) { + timeOffset_ = builderForValue.build(); + onChanged(); + } else { + timeOffsetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Timestamp of this frame.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public Builder mergeTimeOffset(com.google.protobuf.Duration value) { + if (timeOffsetBuilder_ == null) { + if (timeOffset_ != null) { + timeOffset_ = + com.google.protobuf.Duration.newBuilder(timeOffset_).mergeFrom(value).buildPartial(); + } else { + timeOffset_ = value; + } + onChanged(); + } else { + timeOffsetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Timestamp of this frame.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public Builder clearTimeOffset() { + if (timeOffsetBuilder_ == null) { + timeOffset_ = null; + onChanged(); + } else { + timeOffset_ = null; + timeOffsetBuilder_ = null; + } + + return this; + } + /** + *
+     * Timestamp of this frame.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public com.google.protobuf.Duration.Builder getTimeOffsetBuilder() { + + onChanged(); + return getTimeOffsetFieldBuilder().getBuilder(); + } + /** + *
+     * Timestamp of this frame.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + public com.google.protobuf.DurationOrBuilder getTimeOffsetOrBuilder() { + if (timeOffsetBuilder_ != null) { + return timeOffsetBuilder_.getMessageOrBuilder(); + } else { + return timeOffset_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : timeOffset_; + } + } + /** + *
+     * Timestamp of this frame.
+     * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getTimeOffsetFieldBuilder() { + if (timeOffsetBuilder_ == null) { + timeOffsetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getTimeOffset(), + getParentForChildren(), + isClean()); + timeOffset_ = null; + } + return timeOffsetBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.TextFrame) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.TextFrame) + private static final com.google.cloud.videointelligence.v1p2beta1.TextFrame DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.TextFrame(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.TextFrame getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextFrame parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextFrame(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.videointelligence.v1p2beta1.TextFrame getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextFrameOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextFrameOrBuilder.java new file mode 100644 index 000000000000..31ade729f650 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextFrameOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface TextFrameOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.TextFrame) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Bounding polygon of the detected text for this frame.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + boolean hasRotatedBoundingBox(); + /** + *
+   * Bounding polygon of the detected text for this frame.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly getRotatedBoundingBox(); + /** + *
+   * Bounding polygon of the detected text for this frame.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPolyOrBuilder getRotatedBoundingBoxOrBuilder(); + + /** + *
+   * Timestamp of this frame.
+   * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + boolean hasTimeOffset(); + /** + *
+   * Timestamp of this frame.
+   * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + com.google.protobuf.Duration getTimeOffset(); + /** + *
+   * Timestamp of this frame.
+   * 
+ * + * .google.protobuf.Duration time_offset = 2; + */ + com.google.protobuf.DurationOrBuilder getTimeOffsetOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextSegment.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextSegment.java new file mode 100644 index 000000000000..381264338009 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextSegment.java @@ -0,0 +1,651 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Video segment level annotation results for text detection.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.TextSegment} + */ +public final class TextSegment extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.TextSegment) + TextSegmentOrBuilder { +private static final long serialVersionUID = 0L; + // Use TextSegment.newBuilder() to construct. + private TextSegment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextSegment() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TextSegment( + 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: { + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder subBuilder = null; + if (segment_ != null) { + subBuilder = segment_.toBuilder(); + } + segment_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.VideoSegment.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(segment_); + segment_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextSegment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextSegment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.TextSegment.class, com.google.cloud.videointelligence.v1p2beta1.TextSegment.Builder.class); + } + + public static final int SEGMENT_FIELD_NUMBER = 1; + private com.google.cloud.videointelligence.v1p2beta1.VideoSegment segment_; + /** + *
+   * Video segment where a text snippet was detected.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public boolean hasSegment() { + return segment_ != null; + } + /** + *
+   * Video segment where a text snippet was detected.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegment() { + return segment_ == null ? com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance() : segment_; + } + /** + *
+   * Video segment where a text snippet was detected.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getSegmentOrBuilder() { + return getSegment(); + } + + 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 (segment_ != null) { + output.writeMessage(1, getSegment()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (segment_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getSegment()); + } + 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.videointelligence.v1p2beta1.TextSegment)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.TextSegment other = (com.google.cloud.videointelligence.v1p2beta1.TextSegment) obj; + + boolean result = true; + result = result && (hasSegment() == other.hasSegment()); + if (hasSegment()) { + result = result && getSegment() + .equals(other.getSegment()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasSegment()) { + hash = (37 * hash) + SEGMENT_FIELD_NUMBER; + hash = (53 * hash) + getSegment().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.TextSegment parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextSegment 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.videointelligence.v1p2beta1.TextSegment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextSegment 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.videointelligence.v1p2beta1.TextSegment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextSegment parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextSegment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextSegment 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.videointelligence.v1p2beta1.TextSegment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextSegment 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.videointelligence.v1p2beta1.TextSegment parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.TextSegment 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.videointelligence.v1p2beta1.TextSegment 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; + } + /** + *
+   * Video segment level annotation results for text detection.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.TextSegment} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.TextSegment) + com.google.cloud.videointelligence.v1p2beta1.TextSegmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextSegment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextSegment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.TextSegment.class, com.google.cloud.videointelligence.v1p2beta1.TextSegment.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.TextSegment.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(); + if (segmentBuilder_ == null) { + segment_ = null; + } else { + segment_ = null; + segmentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_TextSegment_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.TextSegment getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.TextSegment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.TextSegment build() { + com.google.cloud.videointelligence.v1p2beta1.TextSegment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.TextSegment buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.TextSegment result = new com.google.cloud.videointelligence.v1p2beta1.TextSegment(this); + if (segmentBuilder_ == null) { + result.segment_ = segment_; + } else { + result.segment_ = segmentBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.TextSegment) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.TextSegment)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.TextSegment other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.TextSegment.getDefaultInstance()) return this; + if (other.hasSegment()) { + mergeSegment(other.getSegment()); + } + 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.videointelligence.v1p2beta1.TextSegment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.TextSegment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.videointelligence.v1p2beta1.VideoSegment segment_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder> segmentBuilder_; + /** + *
+     * Video segment where a text snippet was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public boolean hasSegment() { + return segmentBuilder_ != null || segment_ != null; + } + /** + *
+     * Video segment where a text snippet was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegment() { + if (segmentBuilder_ == null) { + return segment_ == null ? com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance() : segment_; + } else { + return segmentBuilder_.getMessage(); + } + } + /** + *
+     * Video segment where a text snippet was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public Builder setSegment(com.google.cloud.videointelligence.v1p2beta1.VideoSegment value) { + if (segmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + segment_ = value; + onChanged(); + } else { + segmentBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Video segment where a text snippet was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public Builder setSegment( + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder builderForValue) { + if (segmentBuilder_ == null) { + segment_ = builderForValue.build(); + onChanged(); + } else { + segmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Video segment where a text snippet was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public Builder mergeSegment(com.google.cloud.videointelligence.v1p2beta1.VideoSegment value) { + if (segmentBuilder_ == null) { + if (segment_ != null) { + segment_ = + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.newBuilder(segment_).mergeFrom(value).buildPartial(); + } else { + segment_ = value; + } + onChanged(); + } else { + segmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Video segment where a text snippet was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public Builder clearSegment() { + if (segmentBuilder_ == null) { + segment_ = null; + onChanged(); + } else { + segment_ = null; + segmentBuilder_ = null; + } + + return this; + } + /** + *
+     * Video segment where a text snippet was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder getSegmentBuilder() { + + onChanged(); + return getSegmentFieldBuilder().getBuilder(); + } + /** + *
+     * Video segment where a text snippet was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getSegmentOrBuilder() { + if (segmentBuilder_ != null) { + return segmentBuilder_.getMessageOrBuilder(); + } else { + return segment_ == null ? + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance() : segment_; + } + } + /** + *
+     * Video segment where a text snippet was detected.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder> + getSegmentFieldBuilder() { + if (segmentBuilder_ == null) { + segmentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder>( + getSegment(), + getParentForChildren(), + isClean()); + segment_ = null; + } + return segmentBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.TextSegment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.TextSegment) + private static final com.google.cloud.videointelligence.v1p2beta1.TextSegment DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.TextSegment(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.TextSegment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TextSegment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextSegment(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.videointelligence.v1p2beta1.TextSegment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextSegmentOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextSegmentOrBuilder.java new file mode 100644 index 000000000000..6334f77c3737 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/TextSegmentOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface TextSegmentOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.TextSegment) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Video segment where a text snippet was detected.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + boolean hasSegment(); + /** + *
+   * Video segment where a text snippet was detected.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegment(); + /** + *
+   * Video segment where a text snippet was detected.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.VideoSegment segment = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getSegmentOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationProgress.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationProgress.java new file mode 100644 index 000000000000..8aba72670613 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationProgress.java @@ -0,0 +1,1120 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Annotation progress for a single video.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress} + */ +public final class VideoAnnotationProgress extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress) + VideoAnnotationProgressOrBuilder { +private static final long serialVersionUID = 0L; + // Use VideoAnnotationProgress.newBuilder() to construct. + private VideoAnnotationProgress(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private VideoAnnotationProgress() { + inputUri_ = ""; + progressPercent_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private VideoAnnotationProgress( + 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(); + + inputUri_ = s; + break; + } + case 16: { + + progressPercent_ = input.readInt32(); + break; + } + case 26: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationProgress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationProgress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.class, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.Builder.class); + } + + public static final int INPUT_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object inputUri_; + /** + *
+   * Video file location in
+   * [Google Cloud Storage](https://cloud.google.com/storage/).
+   * 
+ * + * string input_uri = 1; + */ + public java.lang.String getInputUri() { + java.lang.Object ref = inputUri_; + 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(); + inputUri_ = s; + return s; + } + } + /** + *
+   * Video file location in
+   * [Google Cloud Storage](https://cloud.google.com/storage/).
+   * 
+ * + * string input_uri = 1; + */ + public com.google.protobuf.ByteString + getInputUriBytes() { + java.lang.Object ref = inputUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + inputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROGRESS_PERCENT_FIELD_NUMBER = 2; + private int progressPercent_; + /** + *
+   * Approximate percentage processed thus far. Guaranteed to be
+   * 100 when fully processed.
+   * 
+ * + * int32 progress_percent = 2; + */ + public int getProgressPercent() { + return progressPercent_; + } + + public static final int START_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp startTime_; + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + *
+   * Time of the most recent update.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + *
+   * Time of the most recent update.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + *
+   * Time of the most recent update.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + 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 (!getInputUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputUri_); + } + if (progressPercent_ != 0) { + output.writeInt32(2, progressPercent_); + } + if (startTime_ != null) { + output.writeMessage(3, getStartTime()); + } + if (updateTime_ != null) { + output.writeMessage(4, getUpdateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getInputUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, inputUri_); + } + if (progressPercent_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, progressPercent_); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getStartTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getUpdateTime()); + } + 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.videointelligence.v1p2beta1.VideoAnnotationProgress)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress other = (com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress) obj; + + boolean result = true; + result = result && getInputUri() + .equals(other.getInputUri()); + result = result && (getProgressPercent() + == other.getProgressPercent()); + result = result && (hasStartTime() == other.hasStartTime()); + if (hasStartTime()) { + result = result && getStartTime() + .equals(other.getStartTime()); + } + result = result && (hasUpdateTime() == other.hasUpdateTime()); + if (hasUpdateTime()) { + result = result && getUpdateTime() + .equals(other.getUpdateTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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) + PROGRESS_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getProgressPercent(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress 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.videointelligence.v1p2beta1.VideoAnnotationProgress parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress 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.videointelligence.v1p2beta1.VideoAnnotationProgress parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress 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.videointelligence.v1p2beta1.VideoAnnotationProgress parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress 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.videointelligence.v1p2beta1.VideoAnnotationProgress parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress 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.videointelligence.v1p2beta1.VideoAnnotationProgress 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; + } + /** + *
+   * Annotation progress for a single video.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress) + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgressOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationProgress_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationProgress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.class, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.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(); + inputUri_ = ""; + + progressPercent_ = 0; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationProgress_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress build() { + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress result = new com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress(this); + result.inputUri_ = inputUri_; + result.progressPercent_ = progressPercent_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.getDefaultInstance()) return this; + if (!other.getInputUri().isEmpty()) { + inputUri_ = other.inputUri_; + onChanged(); + } + if (other.getProgressPercent() != 0) { + setProgressPercent(other.getProgressPercent()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + 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.videointelligence.v1p2beta1.VideoAnnotationProgress parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object inputUri_ = ""; + /** + *
+     * Video file location in
+     * [Google Cloud Storage](https://cloud.google.com/storage/).
+     * 
+ * + * string input_uri = 1; + */ + public java.lang.String getInputUri() { + java.lang.Object ref = inputUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Video file location in
+     * [Google Cloud Storage](https://cloud.google.com/storage/).
+     * 
+ * + * string input_uri = 1; + */ + public com.google.protobuf.ByteString + getInputUriBytes() { + java.lang.Object ref = inputUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + inputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Video file location in
+     * [Google Cloud Storage](https://cloud.google.com/storage/).
+     * 
+ * + * string input_uri = 1; + */ + public Builder setInputUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + inputUri_ = value; + onChanged(); + return this; + } + /** + *
+     * Video file location in
+     * [Google Cloud Storage](https://cloud.google.com/storage/).
+     * 
+ * + * string input_uri = 1; + */ + public Builder clearInputUri() { + + inputUri_ = getDefaultInstance().getInputUri(); + onChanged(); + return this; + } + /** + *
+     * Video file location in
+     * [Google Cloud Storage](https://cloud.google.com/storage/).
+     * 
+ * + * string input_uri = 1; + */ + public Builder setInputUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + inputUri_ = value; + onChanged(); + return this; + } + + private int progressPercent_ ; + /** + *
+     * Approximate percentage processed thus far. Guaranteed to be
+     * 100 when fully processed.
+     * 
+ * + * int32 progress_percent = 2; + */ + public int getProgressPercent() { + return progressPercent_; + } + /** + *
+     * Approximate percentage processed thus far. Guaranteed to be
+     * 100 when fully processed.
+     * 
+ * + * int32 progress_percent = 2; + */ + public Builder setProgressPercent(int value) { + + progressPercent_ = value; + onChanged(); + return this; + } + /** + *
+     * Approximate percentage processed thus far. Guaranteed to be
+     * 100 when fully processed.
+     * 
+ * + * int32 progress_percent = 2; + */ + public Builder clearProgressPercent() { + + progressPercent_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder setStartTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + *
+     * Time when the request was received.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getStartTime(), + getParentForChildren(), + isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> updateTimeBuilder_; + /** + *
+     * Time of the most recent update.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + *
+     * Time of the most recent update.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time of the most recent update.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time of the most recent update.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder setUpdateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time of the most recent update.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time of the most recent update.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time of the most recent update.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time of the most recent update.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + } + /** + *
+     * Time of the most recent update.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), + getParentForChildren(), + isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.VideoAnnotationProgress) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress) + private static final com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VideoAnnotationProgress parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VideoAnnotationProgress(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.videointelligence.v1p2beta1.VideoAnnotationProgress getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationProgressOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationProgressOrBuilder.java new file mode 100644 index 000000000000..d0012528d1ec --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationProgressOrBuilder.java @@ -0,0 +1,89 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface VideoAnnotationProgressOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Video file location in
+   * [Google Cloud Storage](https://cloud.google.com/storage/).
+   * 
+ * + * string input_uri = 1; + */ + java.lang.String getInputUri(); + /** + *
+   * Video file location in
+   * [Google Cloud Storage](https://cloud.google.com/storage/).
+   * 
+ * + * string input_uri = 1; + */ + com.google.protobuf.ByteString + getInputUriBytes(); + + /** + *
+   * Approximate percentage processed thus far. Guaranteed to be
+   * 100 when fully processed.
+   * 
+ * + * int32 progress_percent = 2; + */ + int getProgressPercent(); + + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + boolean hasStartTime(); + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + com.google.protobuf.Timestamp getStartTime(); + /** + *
+   * Time when the request was received.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + *
+   * Time of the most recent update.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + boolean hasUpdateTime(); + /** + *
+   * Time of the most recent update.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + *
+   * Time of the most recent update.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationResults.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationResults.java new file mode 100644 index 000000000000..b4f8ab9560ae --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationResults.java @@ -0,0 +1,3784 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Annotation results for a single video.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults} + */ +public final class VideoAnnotationResults extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults) + VideoAnnotationResultsOrBuilder { +private static final long serialVersionUID = 0L; + // Use VideoAnnotationResults.newBuilder() to construct. + private VideoAnnotationResults(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private VideoAnnotationResults() { + inputUri_ = ""; + segmentLabelAnnotations_ = java.util.Collections.emptyList(); + shotLabelAnnotations_ = java.util.Collections.emptyList(); + frameLabelAnnotations_ = java.util.Collections.emptyList(); + shotAnnotations_ = java.util.Collections.emptyList(); + textAnnotations_ = java.util.Collections.emptyList(); + objectAnnotations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private VideoAnnotationResults( + 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(); + + inputUri_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + segmentLabelAnnotations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + segmentLabelAnnotations_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + shotLabelAnnotations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + shotLabelAnnotations_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + frameLabelAnnotations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + frameLabelAnnotations_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.parser(), extensionRegistry)); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + shotAnnotations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + shotAnnotations_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.VideoSegment.parser(), extensionRegistry)); + break; + } + case 58: { + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.Builder subBuilder = null; + if (explicitAnnotation_ != null) { + subBuilder = explicitAnnotation_.toBuilder(); + } + explicitAnnotation_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(explicitAnnotation_); + explicitAnnotation_ = subBuilder.buildPartial(); + } + + break; + } + case 74: { + com.google.rpc.Status.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + + break; + } + case 98: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + textAnnotations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + textAnnotations_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.parser(), extensionRegistry)); + break; + } + case 114: { + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + objectAnnotations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + objectAnnotations_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + segmentLabelAnnotations_ = java.util.Collections.unmodifiableList(segmentLabelAnnotations_); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + shotLabelAnnotations_ = java.util.Collections.unmodifiableList(shotLabelAnnotations_); + } + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + frameLabelAnnotations_ = java.util.Collections.unmodifiableList(frameLabelAnnotations_); + } + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + shotAnnotations_ = java.util.Collections.unmodifiableList(shotAnnotations_); + } + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + textAnnotations_ = java.util.Collections.unmodifiableList(textAnnotations_); + } + if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + objectAnnotations_ = java.util.Collections.unmodifiableList(objectAnnotations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationResults_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationResults_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.class, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.Builder.class); + } + + private int bitField0_; + public static final int INPUT_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object inputUri_; + /** + *
+   * Video file location in
+   * [Google Cloud Storage](https://cloud.google.com/storage/).
+   * 
+ * + * string input_uri = 1; + */ + public java.lang.String getInputUri() { + java.lang.Object ref = inputUri_; + 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(); + inputUri_ = s; + return s; + } + } + /** + *
+   * Video file location in
+   * [Google Cloud Storage](https://cloud.google.com/storage/).
+   * 
+ * + * string input_uri = 1; + */ + public com.google.protobuf.ByteString + getInputUriBytes() { + java.lang.Object ref = inputUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + inputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEGMENT_LABEL_ANNOTATIONS_FIELD_NUMBER = 2; + private java.util.List segmentLabelAnnotations_; + /** + *
+   * Label annotations on video level or user specified segment level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public java.util.List getSegmentLabelAnnotationsList() { + return segmentLabelAnnotations_; + } + /** + *
+   * Label annotations on video level or user specified segment level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public java.util.List + getSegmentLabelAnnotationsOrBuilderList() { + return segmentLabelAnnotations_; + } + /** + *
+   * Label annotations on video level or user specified segment level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public int getSegmentLabelAnnotationsCount() { + return segmentLabelAnnotations_.size(); + } + /** + *
+   * Label annotations on video level or user specified segment level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation getSegmentLabelAnnotations(int index) { + return segmentLabelAnnotations_.get(index); + } + /** + *
+   * Label annotations on video level or user specified segment level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder getSegmentLabelAnnotationsOrBuilder( + int index) { + return segmentLabelAnnotations_.get(index); + } + + public static final int SHOT_LABEL_ANNOTATIONS_FIELD_NUMBER = 3; + private java.util.List shotLabelAnnotations_; + /** + *
+   * Label annotations on shot level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public java.util.List getShotLabelAnnotationsList() { + return shotLabelAnnotations_; + } + /** + *
+   * Label annotations on shot level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public java.util.List + getShotLabelAnnotationsOrBuilderList() { + return shotLabelAnnotations_; + } + /** + *
+   * Label annotations on shot level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public int getShotLabelAnnotationsCount() { + return shotLabelAnnotations_.size(); + } + /** + *
+   * Label annotations on shot level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation getShotLabelAnnotations(int index) { + return shotLabelAnnotations_.get(index); + } + /** + *
+   * Label annotations on shot level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder getShotLabelAnnotationsOrBuilder( + int index) { + return shotLabelAnnotations_.get(index); + } + + public static final int FRAME_LABEL_ANNOTATIONS_FIELD_NUMBER = 4; + private java.util.List frameLabelAnnotations_; + /** + *
+   * Label annotations on frame level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public java.util.List getFrameLabelAnnotationsList() { + return frameLabelAnnotations_; + } + /** + *
+   * Label annotations on frame level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public java.util.List + getFrameLabelAnnotationsOrBuilderList() { + return frameLabelAnnotations_; + } + /** + *
+   * Label annotations on frame level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public int getFrameLabelAnnotationsCount() { + return frameLabelAnnotations_.size(); + } + /** + *
+   * Label annotations on frame level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation getFrameLabelAnnotations(int index) { + return frameLabelAnnotations_.get(index); + } + /** + *
+   * Label annotations on frame level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder getFrameLabelAnnotationsOrBuilder( + int index) { + return frameLabelAnnotations_.get(index); + } + + public static final int SHOT_ANNOTATIONS_FIELD_NUMBER = 6; + private java.util.List shotAnnotations_; + /** + *
+   * Shot annotations. Each shot is represented as a video segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public java.util.List getShotAnnotationsList() { + return shotAnnotations_; + } + /** + *
+   * Shot annotations. Each shot is represented as a video segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public java.util.List + getShotAnnotationsOrBuilderList() { + return shotAnnotations_; + } + /** + *
+   * Shot annotations. Each shot is represented as a video segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public int getShotAnnotationsCount() { + return shotAnnotations_.size(); + } + /** + *
+   * Shot annotations. Each shot is represented as a video segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment getShotAnnotations(int index) { + return shotAnnotations_.get(index); + } + /** + *
+   * Shot annotations. Each shot is represented as a video segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getShotAnnotationsOrBuilder( + int index) { + return shotAnnotations_.get(index); + } + + public static final int EXPLICIT_ANNOTATION_FIELD_NUMBER = 7; + private com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicitAnnotation_; + /** + *
+   * Explicit content annotation.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + public boolean hasExplicitAnnotation() { + return explicitAnnotation_ != null; + } + /** + *
+   * Explicit content annotation.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation getExplicitAnnotation() { + return explicitAnnotation_ == null ? com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.getDefaultInstance() : explicitAnnotation_; + } + /** + *
+   * Explicit content annotation.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotationOrBuilder getExplicitAnnotationOrBuilder() { + return getExplicitAnnotation(); + } + + public static final int TEXT_ANNOTATIONS_FIELD_NUMBER = 12; + private java.util.List textAnnotations_; + /** + *
+   * OCR text detection and tracking.
+   * Annotations for list of detected text snippets. Each will have list of
+   * frame information associated with it.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public java.util.List getTextAnnotationsList() { + return textAnnotations_; + } + /** + *
+   * OCR text detection and tracking.
+   * Annotations for list of detected text snippets. Each will have list of
+   * frame information associated with it.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public java.util.List + getTextAnnotationsOrBuilderList() { + return textAnnotations_; + } + /** + *
+   * OCR text detection and tracking.
+   * Annotations for list of detected text snippets. Each will have list of
+   * frame information associated with it.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public int getTextAnnotationsCount() { + return textAnnotations_.size(); + } + /** + *
+   * OCR text detection and tracking.
+   * Annotations for list of detected text snippets. Each will have list of
+   * frame information associated with it.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextAnnotation getTextAnnotations(int index) { + return textAnnotations_.get(index); + } + /** + *
+   * OCR text detection and tracking.
+   * Annotations for list of detected text snippets. Each will have list of
+   * frame information associated with it.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextAnnotationOrBuilder getTextAnnotationsOrBuilder( + int index) { + return textAnnotations_.get(index); + } + + public static final int OBJECT_ANNOTATIONS_FIELD_NUMBER = 14; + private java.util.List objectAnnotations_; + /** + *
+   * Annotations for list of objects detected and tracked in video.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public java.util.List getObjectAnnotationsList() { + return objectAnnotations_; + } + /** + *
+   * Annotations for list of objects detected and tracked in video.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public java.util.List + getObjectAnnotationsOrBuilderList() { + return objectAnnotations_; + } + /** + *
+   * Annotations for list of objects detected and tracked in video.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public int getObjectAnnotationsCount() { + return objectAnnotations_.size(); + } + /** + *
+   * Annotations for list of objects detected and tracked in video.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation getObjectAnnotations(int index) { + return objectAnnotations_.get(index); + } + /** + *
+   * Annotations for list of objects detected and tracked in video.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotationOrBuilder getObjectAnnotationsOrBuilder( + int index) { + return objectAnnotations_.get(index); + } + + public static final int ERROR_FIELD_NUMBER = 9; + private com.google.rpc.Status error_; + /** + *
+   * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+   * some videos may succeed and some may fail.
+   * 
+ * + * .google.rpc.Status error = 9; + */ + public boolean hasError() { + return error_ != null; + } + /** + *
+   * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+   * some videos may succeed and some may fail.
+   * 
+ * + * .google.rpc.Status error = 9; + */ + public com.google.rpc.Status getError() { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } + /** + *
+   * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+   * some videos may succeed and some may fail.
+   * 
+ * + * .google.rpc.Status error = 9; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + return getError(); + } + + 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 (!getInputUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, inputUri_); + } + for (int i = 0; i < segmentLabelAnnotations_.size(); i++) { + output.writeMessage(2, segmentLabelAnnotations_.get(i)); + } + for (int i = 0; i < shotLabelAnnotations_.size(); i++) { + output.writeMessage(3, shotLabelAnnotations_.get(i)); + } + for (int i = 0; i < frameLabelAnnotations_.size(); i++) { + output.writeMessage(4, frameLabelAnnotations_.get(i)); + } + for (int i = 0; i < shotAnnotations_.size(); i++) { + output.writeMessage(6, shotAnnotations_.get(i)); + } + if (explicitAnnotation_ != null) { + output.writeMessage(7, getExplicitAnnotation()); + } + if (error_ != null) { + output.writeMessage(9, getError()); + } + for (int i = 0; i < textAnnotations_.size(); i++) { + output.writeMessage(12, textAnnotations_.get(i)); + } + for (int i = 0; i < objectAnnotations_.size(); i++) { + output.writeMessage(14, objectAnnotations_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getInputUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, inputUri_); + } + for (int i = 0; i < segmentLabelAnnotations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, segmentLabelAnnotations_.get(i)); + } + for (int i = 0; i < shotLabelAnnotations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, shotLabelAnnotations_.get(i)); + } + for (int i = 0; i < frameLabelAnnotations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, frameLabelAnnotations_.get(i)); + } + for (int i = 0; i < shotAnnotations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, shotAnnotations_.get(i)); + } + if (explicitAnnotation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getExplicitAnnotation()); + } + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, getError()); + } + for (int i = 0; i < textAnnotations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, textAnnotations_.get(i)); + } + for (int i = 0; i < objectAnnotations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, objectAnnotations_.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.videointelligence.v1p2beta1.VideoAnnotationResults)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults other = (com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults) obj; + + boolean result = true; + result = result && getInputUri() + .equals(other.getInputUri()); + result = result && getSegmentLabelAnnotationsList() + .equals(other.getSegmentLabelAnnotationsList()); + result = result && getShotLabelAnnotationsList() + .equals(other.getShotLabelAnnotationsList()); + result = result && getFrameLabelAnnotationsList() + .equals(other.getFrameLabelAnnotationsList()); + result = result && getShotAnnotationsList() + .equals(other.getShotAnnotationsList()); + result = result && (hasExplicitAnnotation() == other.hasExplicitAnnotation()); + if (hasExplicitAnnotation()) { + result = result && getExplicitAnnotation() + .equals(other.getExplicitAnnotation()); + } + result = result && getTextAnnotationsList() + .equals(other.getTextAnnotationsList()); + result = result && getObjectAnnotationsList() + .equals(other.getObjectAnnotationsList()); + result = result && (hasError() == other.hasError()); + if (hasError()) { + result = result && getError() + .equals(other.getError()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @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(); + if (getSegmentLabelAnnotationsCount() > 0) { + hash = (37 * hash) + SEGMENT_LABEL_ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getSegmentLabelAnnotationsList().hashCode(); + } + if (getShotLabelAnnotationsCount() > 0) { + hash = (37 * hash) + SHOT_LABEL_ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getShotLabelAnnotationsList().hashCode(); + } + if (getFrameLabelAnnotationsCount() > 0) { + hash = (37 * hash) + FRAME_LABEL_ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getFrameLabelAnnotationsList().hashCode(); + } + if (getShotAnnotationsCount() > 0) { + hash = (37 * hash) + SHOT_ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getShotAnnotationsList().hashCode(); + } + if (hasExplicitAnnotation()) { + hash = (37 * hash) + EXPLICIT_ANNOTATION_FIELD_NUMBER; + hash = (53 * hash) + getExplicitAnnotation().hashCode(); + } + if (getTextAnnotationsCount() > 0) { + hash = (37 * hash) + TEXT_ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getTextAnnotationsList().hashCode(); + } + if (getObjectAnnotationsCount() > 0) { + hash = (37 * hash) + OBJECT_ANNOTATIONS_FIELD_NUMBER; + hash = (53 * hash) + getObjectAnnotationsList().hashCode(); + } + if (hasError()) { + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults 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.videointelligence.v1p2beta1.VideoAnnotationResults parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults 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.videointelligence.v1p2beta1.VideoAnnotationResults parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults 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.videointelligence.v1p2beta1.VideoAnnotationResults parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults 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.videointelligence.v1p2beta1.VideoAnnotationResults parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults 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.videointelligence.v1p2beta1.VideoAnnotationResults 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; + } + /** + *
+   * Annotation results for a single video.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults) + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResultsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationResults_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationResults_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.class, com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSegmentLabelAnnotationsFieldBuilder(); + getShotLabelAnnotationsFieldBuilder(); + getFrameLabelAnnotationsFieldBuilder(); + getShotAnnotationsFieldBuilder(); + getTextAnnotationsFieldBuilder(); + getObjectAnnotationsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + inputUri_ = ""; + + if (segmentLabelAnnotationsBuilder_ == null) { + segmentLabelAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + segmentLabelAnnotationsBuilder_.clear(); + } + if (shotLabelAnnotationsBuilder_ == null) { + shotLabelAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + shotLabelAnnotationsBuilder_.clear(); + } + if (frameLabelAnnotationsBuilder_ == null) { + frameLabelAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + frameLabelAnnotationsBuilder_.clear(); + } + if (shotAnnotationsBuilder_ == null) { + shotAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + shotAnnotationsBuilder_.clear(); + } + if (explicitAnnotationBuilder_ == null) { + explicitAnnotation_ = null; + } else { + explicitAnnotation_ = null; + explicitAnnotationBuilder_ = null; + } + if (textAnnotationsBuilder_ == null) { + textAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + } else { + textAnnotationsBuilder_.clear(); + } + if (objectAnnotationsBuilder_ == null) { + objectAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + } else { + objectAnnotationsBuilder_.clear(); + } + if (errorBuilder_ == null) { + error_ = null; + } else { + error_ = null; + errorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationResults_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults build() { + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults result = new com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.inputUri_ = inputUri_; + if (segmentLabelAnnotationsBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002)) { + segmentLabelAnnotations_ = java.util.Collections.unmodifiableList(segmentLabelAnnotations_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.segmentLabelAnnotations_ = segmentLabelAnnotations_; + } else { + result.segmentLabelAnnotations_ = segmentLabelAnnotationsBuilder_.build(); + } + if (shotLabelAnnotationsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + shotLabelAnnotations_ = java.util.Collections.unmodifiableList(shotLabelAnnotations_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.shotLabelAnnotations_ = shotLabelAnnotations_; + } else { + result.shotLabelAnnotations_ = shotLabelAnnotationsBuilder_.build(); + } + if (frameLabelAnnotationsBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + frameLabelAnnotations_ = java.util.Collections.unmodifiableList(frameLabelAnnotations_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.frameLabelAnnotations_ = frameLabelAnnotations_; + } else { + result.frameLabelAnnotations_ = frameLabelAnnotationsBuilder_.build(); + } + if (shotAnnotationsBuilder_ == null) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { + shotAnnotations_ = java.util.Collections.unmodifiableList(shotAnnotations_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.shotAnnotations_ = shotAnnotations_; + } else { + result.shotAnnotations_ = shotAnnotationsBuilder_.build(); + } + if (explicitAnnotationBuilder_ == null) { + result.explicitAnnotation_ = explicitAnnotation_; + } else { + result.explicitAnnotation_ = explicitAnnotationBuilder_.build(); + } + if (textAnnotationsBuilder_ == null) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { + textAnnotations_ = java.util.Collections.unmodifiableList(textAnnotations_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.textAnnotations_ = textAnnotations_; + } else { + result.textAnnotations_ = textAnnotationsBuilder_.build(); + } + if (objectAnnotationsBuilder_ == null) { + if (((bitField0_ & 0x00000080) == 0x00000080)) { + objectAnnotations_ = java.util.Collections.unmodifiableList(objectAnnotations_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.objectAnnotations_ = objectAnnotations_; + } else { + result.objectAnnotations_ = objectAnnotationsBuilder_.build(); + } + if (errorBuilder_ == null) { + result.error_ = error_; + } else { + result.error_ = errorBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.getDefaultInstance()) return this; + if (!other.getInputUri().isEmpty()) { + inputUri_ = other.inputUri_; + onChanged(); + } + if (segmentLabelAnnotationsBuilder_ == null) { + if (!other.segmentLabelAnnotations_.isEmpty()) { + if (segmentLabelAnnotations_.isEmpty()) { + segmentLabelAnnotations_ = other.segmentLabelAnnotations_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSegmentLabelAnnotationsIsMutable(); + segmentLabelAnnotations_.addAll(other.segmentLabelAnnotations_); + } + onChanged(); + } + } else { + if (!other.segmentLabelAnnotations_.isEmpty()) { + if (segmentLabelAnnotationsBuilder_.isEmpty()) { + segmentLabelAnnotationsBuilder_.dispose(); + segmentLabelAnnotationsBuilder_ = null; + segmentLabelAnnotations_ = other.segmentLabelAnnotations_; + bitField0_ = (bitField0_ & ~0x00000002); + segmentLabelAnnotationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSegmentLabelAnnotationsFieldBuilder() : null; + } else { + segmentLabelAnnotationsBuilder_.addAllMessages(other.segmentLabelAnnotations_); + } + } + } + if (shotLabelAnnotationsBuilder_ == null) { + if (!other.shotLabelAnnotations_.isEmpty()) { + if (shotLabelAnnotations_.isEmpty()) { + shotLabelAnnotations_ = other.shotLabelAnnotations_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureShotLabelAnnotationsIsMutable(); + shotLabelAnnotations_.addAll(other.shotLabelAnnotations_); + } + onChanged(); + } + } else { + if (!other.shotLabelAnnotations_.isEmpty()) { + if (shotLabelAnnotationsBuilder_.isEmpty()) { + shotLabelAnnotationsBuilder_.dispose(); + shotLabelAnnotationsBuilder_ = null; + shotLabelAnnotations_ = other.shotLabelAnnotations_; + bitField0_ = (bitField0_ & ~0x00000004); + shotLabelAnnotationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getShotLabelAnnotationsFieldBuilder() : null; + } else { + shotLabelAnnotationsBuilder_.addAllMessages(other.shotLabelAnnotations_); + } + } + } + if (frameLabelAnnotationsBuilder_ == null) { + if (!other.frameLabelAnnotations_.isEmpty()) { + if (frameLabelAnnotations_.isEmpty()) { + frameLabelAnnotations_ = other.frameLabelAnnotations_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureFrameLabelAnnotationsIsMutable(); + frameLabelAnnotations_.addAll(other.frameLabelAnnotations_); + } + onChanged(); + } + } else { + if (!other.frameLabelAnnotations_.isEmpty()) { + if (frameLabelAnnotationsBuilder_.isEmpty()) { + frameLabelAnnotationsBuilder_.dispose(); + frameLabelAnnotationsBuilder_ = null; + frameLabelAnnotations_ = other.frameLabelAnnotations_; + bitField0_ = (bitField0_ & ~0x00000008); + frameLabelAnnotationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFrameLabelAnnotationsFieldBuilder() : null; + } else { + frameLabelAnnotationsBuilder_.addAllMessages(other.frameLabelAnnotations_); + } + } + } + if (shotAnnotationsBuilder_ == null) { + if (!other.shotAnnotations_.isEmpty()) { + if (shotAnnotations_.isEmpty()) { + shotAnnotations_ = other.shotAnnotations_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureShotAnnotationsIsMutable(); + shotAnnotations_.addAll(other.shotAnnotations_); + } + onChanged(); + } + } else { + if (!other.shotAnnotations_.isEmpty()) { + if (shotAnnotationsBuilder_.isEmpty()) { + shotAnnotationsBuilder_.dispose(); + shotAnnotationsBuilder_ = null; + shotAnnotations_ = other.shotAnnotations_; + bitField0_ = (bitField0_ & ~0x00000010); + shotAnnotationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getShotAnnotationsFieldBuilder() : null; + } else { + shotAnnotationsBuilder_.addAllMessages(other.shotAnnotations_); + } + } + } + if (other.hasExplicitAnnotation()) { + mergeExplicitAnnotation(other.getExplicitAnnotation()); + } + if (textAnnotationsBuilder_ == null) { + if (!other.textAnnotations_.isEmpty()) { + if (textAnnotations_.isEmpty()) { + textAnnotations_ = other.textAnnotations_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureTextAnnotationsIsMutable(); + textAnnotations_.addAll(other.textAnnotations_); + } + onChanged(); + } + } else { + if (!other.textAnnotations_.isEmpty()) { + if (textAnnotationsBuilder_.isEmpty()) { + textAnnotationsBuilder_.dispose(); + textAnnotationsBuilder_ = null; + textAnnotations_ = other.textAnnotations_; + bitField0_ = (bitField0_ & ~0x00000040); + textAnnotationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getTextAnnotationsFieldBuilder() : null; + } else { + textAnnotationsBuilder_.addAllMessages(other.textAnnotations_); + } + } + } + if (objectAnnotationsBuilder_ == null) { + if (!other.objectAnnotations_.isEmpty()) { + if (objectAnnotations_.isEmpty()) { + objectAnnotations_ = other.objectAnnotations_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureObjectAnnotationsIsMutable(); + objectAnnotations_.addAll(other.objectAnnotations_); + } + onChanged(); + } + } else { + if (!other.objectAnnotations_.isEmpty()) { + if (objectAnnotationsBuilder_.isEmpty()) { + objectAnnotationsBuilder_.dispose(); + objectAnnotationsBuilder_ = null; + objectAnnotations_ = other.objectAnnotations_; + bitField0_ = (bitField0_ & ~0x00000080); + objectAnnotationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getObjectAnnotationsFieldBuilder() : null; + } else { + objectAnnotationsBuilder_.addAllMessages(other.objectAnnotations_); + } + } + } + if (other.hasError()) { + mergeError(other.getError()); + } + 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.videointelligence.v1p2beta1.VideoAnnotationResults parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object inputUri_ = ""; + /** + *
+     * Video file location in
+     * [Google Cloud Storage](https://cloud.google.com/storage/).
+     * 
+ * + * string input_uri = 1; + */ + public java.lang.String getInputUri() { + java.lang.Object ref = inputUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + inputUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Video file location in
+     * [Google Cloud Storage](https://cloud.google.com/storage/).
+     * 
+ * + * string input_uri = 1; + */ + public com.google.protobuf.ByteString + getInputUriBytes() { + java.lang.Object ref = inputUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + inputUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Video file location in
+     * [Google Cloud Storage](https://cloud.google.com/storage/).
+     * 
+ * + * string input_uri = 1; + */ + public Builder setInputUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + inputUri_ = value; + onChanged(); + return this; + } + /** + *
+     * Video file location in
+     * [Google Cloud Storage](https://cloud.google.com/storage/).
+     * 
+ * + * string input_uri = 1; + */ + public Builder clearInputUri() { + + inputUri_ = getDefaultInstance().getInputUri(); + onChanged(); + return this; + } + /** + *
+     * Video file location in
+     * [Google Cloud Storage](https://cloud.google.com/storage/).
+     * 
+ * + * string input_uri = 1; + */ + public Builder setInputUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + inputUri_ = value; + onChanged(); + return this; + } + + private java.util.List segmentLabelAnnotations_ = + java.util.Collections.emptyList(); + private void ensureSegmentLabelAnnotationsIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + segmentLabelAnnotations_ = new java.util.ArrayList(segmentLabelAnnotations_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder> segmentLabelAnnotationsBuilder_; + + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public java.util.List getSegmentLabelAnnotationsList() { + if (segmentLabelAnnotationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(segmentLabelAnnotations_); + } else { + return segmentLabelAnnotationsBuilder_.getMessageList(); + } + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public int getSegmentLabelAnnotationsCount() { + if (segmentLabelAnnotationsBuilder_ == null) { + return segmentLabelAnnotations_.size(); + } else { + return segmentLabelAnnotationsBuilder_.getCount(); + } + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation getSegmentLabelAnnotations(int index) { + if (segmentLabelAnnotationsBuilder_ == null) { + return segmentLabelAnnotations_.get(index); + } else { + return segmentLabelAnnotationsBuilder_.getMessage(index); + } + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public Builder setSegmentLabelAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation value) { + if (segmentLabelAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentLabelAnnotationsIsMutable(); + segmentLabelAnnotations_.set(index, value); + onChanged(); + } else { + segmentLabelAnnotationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public Builder setSegmentLabelAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder builderForValue) { + if (segmentLabelAnnotationsBuilder_ == null) { + ensureSegmentLabelAnnotationsIsMutable(); + segmentLabelAnnotations_.set(index, builderForValue.build()); + onChanged(); + } else { + segmentLabelAnnotationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public Builder addSegmentLabelAnnotations(com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation value) { + if (segmentLabelAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentLabelAnnotationsIsMutable(); + segmentLabelAnnotations_.add(value); + onChanged(); + } else { + segmentLabelAnnotationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public Builder addSegmentLabelAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation value) { + if (segmentLabelAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentLabelAnnotationsIsMutable(); + segmentLabelAnnotations_.add(index, value); + onChanged(); + } else { + segmentLabelAnnotationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public Builder addSegmentLabelAnnotations( + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder builderForValue) { + if (segmentLabelAnnotationsBuilder_ == null) { + ensureSegmentLabelAnnotationsIsMutable(); + segmentLabelAnnotations_.add(builderForValue.build()); + onChanged(); + } else { + segmentLabelAnnotationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public Builder addSegmentLabelAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder builderForValue) { + if (segmentLabelAnnotationsBuilder_ == null) { + ensureSegmentLabelAnnotationsIsMutable(); + segmentLabelAnnotations_.add(index, builderForValue.build()); + onChanged(); + } else { + segmentLabelAnnotationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public Builder addAllSegmentLabelAnnotations( + java.lang.Iterable values) { + if (segmentLabelAnnotationsBuilder_ == null) { + ensureSegmentLabelAnnotationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, segmentLabelAnnotations_); + onChanged(); + } else { + segmentLabelAnnotationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public Builder clearSegmentLabelAnnotations() { + if (segmentLabelAnnotationsBuilder_ == null) { + segmentLabelAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + segmentLabelAnnotationsBuilder_.clear(); + } + return this; + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public Builder removeSegmentLabelAnnotations(int index) { + if (segmentLabelAnnotationsBuilder_ == null) { + ensureSegmentLabelAnnotationsIsMutable(); + segmentLabelAnnotations_.remove(index); + onChanged(); + } else { + segmentLabelAnnotationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder getSegmentLabelAnnotationsBuilder( + int index) { + return getSegmentLabelAnnotationsFieldBuilder().getBuilder(index); + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder getSegmentLabelAnnotationsOrBuilder( + int index) { + if (segmentLabelAnnotationsBuilder_ == null) { + return segmentLabelAnnotations_.get(index); } else { + return segmentLabelAnnotationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public java.util.List + getSegmentLabelAnnotationsOrBuilderList() { + if (segmentLabelAnnotationsBuilder_ != null) { + return segmentLabelAnnotationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(segmentLabelAnnotations_); + } + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder addSegmentLabelAnnotationsBuilder() { + return getSegmentLabelAnnotationsFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.getDefaultInstance()); + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder addSegmentLabelAnnotationsBuilder( + int index) { + return getSegmentLabelAnnotationsFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.getDefaultInstance()); + } + /** + *
+     * Label annotations on video level or user specified segment level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + public java.util.List + getSegmentLabelAnnotationsBuilderList() { + return getSegmentLabelAnnotationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder> + getSegmentLabelAnnotationsFieldBuilder() { + if (segmentLabelAnnotationsBuilder_ == null) { + segmentLabelAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder>( + segmentLabelAnnotations_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + segmentLabelAnnotations_ = null; + } + return segmentLabelAnnotationsBuilder_; + } + + private java.util.List shotLabelAnnotations_ = + java.util.Collections.emptyList(); + private void ensureShotLabelAnnotationsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + shotLabelAnnotations_ = new java.util.ArrayList(shotLabelAnnotations_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder> shotLabelAnnotationsBuilder_; + + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public java.util.List getShotLabelAnnotationsList() { + if (shotLabelAnnotationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(shotLabelAnnotations_); + } else { + return shotLabelAnnotationsBuilder_.getMessageList(); + } + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public int getShotLabelAnnotationsCount() { + if (shotLabelAnnotationsBuilder_ == null) { + return shotLabelAnnotations_.size(); + } else { + return shotLabelAnnotationsBuilder_.getCount(); + } + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation getShotLabelAnnotations(int index) { + if (shotLabelAnnotationsBuilder_ == null) { + return shotLabelAnnotations_.get(index); + } else { + return shotLabelAnnotationsBuilder_.getMessage(index); + } + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public Builder setShotLabelAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation value) { + if (shotLabelAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShotLabelAnnotationsIsMutable(); + shotLabelAnnotations_.set(index, value); + onChanged(); + } else { + shotLabelAnnotationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public Builder setShotLabelAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder builderForValue) { + if (shotLabelAnnotationsBuilder_ == null) { + ensureShotLabelAnnotationsIsMutable(); + shotLabelAnnotations_.set(index, builderForValue.build()); + onChanged(); + } else { + shotLabelAnnotationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public Builder addShotLabelAnnotations(com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation value) { + if (shotLabelAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShotLabelAnnotationsIsMutable(); + shotLabelAnnotations_.add(value); + onChanged(); + } else { + shotLabelAnnotationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public Builder addShotLabelAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation value) { + if (shotLabelAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShotLabelAnnotationsIsMutable(); + shotLabelAnnotations_.add(index, value); + onChanged(); + } else { + shotLabelAnnotationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public Builder addShotLabelAnnotations( + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder builderForValue) { + if (shotLabelAnnotationsBuilder_ == null) { + ensureShotLabelAnnotationsIsMutable(); + shotLabelAnnotations_.add(builderForValue.build()); + onChanged(); + } else { + shotLabelAnnotationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public Builder addShotLabelAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder builderForValue) { + if (shotLabelAnnotationsBuilder_ == null) { + ensureShotLabelAnnotationsIsMutable(); + shotLabelAnnotations_.add(index, builderForValue.build()); + onChanged(); + } else { + shotLabelAnnotationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public Builder addAllShotLabelAnnotations( + java.lang.Iterable values) { + if (shotLabelAnnotationsBuilder_ == null) { + ensureShotLabelAnnotationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, shotLabelAnnotations_); + onChanged(); + } else { + shotLabelAnnotationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public Builder clearShotLabelAnnotations() { + if (shotLabelAnnotationsBuilder_ == null) { + shotLabelAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + shotLabelAnnotationsBuilder_.clear(); + } + return this; + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public Builder removeShotLabelAnnotations(int index) { + if (shotLabelAnnotationsBuilder_ == null) { + ensureShotLabelAnnotationsIsMutable(); + shotLabelAnnotations_.remove(index); + onChanged(); + } else { + shotLabelAnnotationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder getShotLabelAnnotationsBuilder( + int index) { + return getShotLabelAnnotationsFieldBuilder().getBuilder(index); + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder getShotLabelAnnotationsOrBuilder( + int index) { + if (shotLabelAnnotationsBuilder_ == null) { + return shotLabelAnnotations_.get(index); } else { + return shotLabelAnnotationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public java.util.List + getShotLabelAnnotationsOrBuilderList() { + if (shotLabelAnnotationsBuilder_ != null) { + return shotLabelAnnotationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(shotLabelAnnotations_); + } + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder addShotLabelAnnotationsBuilder() { + return getShotLabelAnnotationsFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.getDefaultInstance()); + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder addShotLabelAnnotationsBuilder( + int index) { + return getShotLabelAnnotationsFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.getDefaultInstance()); + } + /** + *
+     * Label annotations on shot level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + public java.util.List + getShotLabelAnnotationsBuilderList() { + return getShotLabelAnnotationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder> + getShotLabelAnnotationsFieldBuilder() { + if (shotLabelAnnotationsBuilder_ == null) { + shotLabelAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder>( + shotLabelAnnotations_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + shotLabelAnnotations_ = null; + } + return shotLabelAnnotationsBuilder_; + } + + private java.util.List frameLabelAnnotations_ = + java.util.Collections.emptyList(); + private void ensureFrameLabelAnnotationsIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + frameLabelAnnotations_ = new java.util.ArrayList(frameLabelAnnotations_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder> frameLabelAnnotationsBuilder_; + + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public java.util.List getFrameLabelAnnotationsList() { + if (frameLabelAnnotationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(frameLabelAnnotations_); + } else { + return frameLabelAnnotationsBuilder_.getMessageList(); + } + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public int getFrameLabelAnnotationsCount() { + if (frameLabelAnnotationsBuilder_ == null) { + return frameLabelAnnotations_.size(); + } else { + return frameLabelAnnotationsBuilder_.getCount(); + } + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation getFrameLabelAnnotations(int index) { + if (frameLabelAnnotationsBuilder_ == null) { + return frameLabelAnnotations_.get(index); + } else { + return frameLabelAnnotationsBuilder_.getMessage(index); + } + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public Builder setFrameLabelAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation value) { + if (frameLabelAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFrameLabelAnnotationsIsMutable(); + frameLabelAnnotations_.set(index, value); + onChanged(); + } else { + frameLabelAnnotationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public Builder setFrameLabelAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder builderForValue) { + if (frameLabelAnnotationsBuilder_ == null) { + ensureFrameLabelAnnotationsIsMutable(); + frameLabelAnnotations_.set(index, builderForValue.build()); + onChanged(); + } else { + frameLabelAnnotationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public Builder addFrameLabelAnnotations(com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation value) { + if (frameLabelAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFrameLabelAnnotationsIsMutable(); + frameLabelAnnotations_.add(value); + onChanged(); + } else { + frameLabelAnnotationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public Builder addFrameLabelAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation value) { + if (frameLabelAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFrameLabelAnnotationsIsMutable(); + frameLabelAnnotations_.add(index, value); + onChanged(); + } else { + frameLabelAnnotationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public Builder addFrameLabelAnnotations( + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder builderForValue) { + if (frameLabelAnnotationsBuilder_ == null) { + ensureFrameLabelAnnotationsIsMutable(); + frameLabelAnnotations_.add(builderForValue.build()); + onChanged(); + } else { + frameLabelAnnotationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public Builder addFrameLabelAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder builderForValue) { + if (frameLabelAnnotationsBuilder_ == null) { + ensureFrameLabelAnnotationsIsMutable(); + frameLabelAnnotations_.add(index, builderForValue.build()); + onChanged(); + } else { + frameLabelAnnotationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public Builder addAllFrameLabelAnnotations( + java.lang.Iterable values) { + if (frameLabelAnnotationsBuilder_ == null) { + ensureFrameLabelAnnotationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, frameLabelAnnotations_); + onChanged(); + } else { + frameLabelAnnotationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public Builder clearFrameLabelAnnotations() { + if (frameLabelAnnotationsBuilder_ == null) { + frameLabelAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + frameLabelAnnotationsBuilder_.clear(); + } + return this; + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public Builder removeFrameLabelAnnotations(int index) { + if (frameLabelAnnotationsBuilder_ == null) { + ensureFrameLabelAnnotationsIsMutable(); + frameLabelAnnotations_.remove(index); + onChanged(); + } else { + frameLabelAnnotationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder getFrameLabelAnnotationsBuilder( + int index) { + return getFrameLabelAnnotationsFieldBuilder().getBuilder(index); + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder getFrameLabelAnnotationsOrBuilder( + int index) { + if (frameLabelAnnotationsBuilder_ == null) { + return frameLabelAnnotations_.get(index); } else { + return frameLabelAnnotationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public java.util.List + getFrameLabelAnnotationsOrBuilderList() { + if (frameLabelAnnotationsBuilder_ != null) { + return frameLabelAnnotationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(frameLabelAnnotations_); + } + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder addFrameLabelAnnotationsBuilder() { + return getFrameLabelAnnotationsFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.getDefaultInstance()); + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder addFrameLabelAnnotationsBuilder( + int index) { + return getFrameLabelAnnotationsFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.getDefaultInstance()); + } + /** + *
+     * Label annotations on frame level.
+     * There is exactly one element for each unique label.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + public java.util.List + getFrameLabelAnnotationsBuilderList() { + return getFrameLabelAnnotationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder> + getFrameLabelAnnotationsFieldBuilder() { + if (frameLabelAnnotationsBuilder_ == null) { + frameLabelAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder>( + frameLabelAnnotations_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + frameLabelAnnotations_ = null; + } + return frameLabelAnnotationsBuilder_; + } + + private java.util.List shotAnnotations_ = + java.util.Collections.emptyList(); + private void ensureShotAnnotationsIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + shotAnnotations_ = new java.util.ArrayList(shotAnnotations_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder> shotAnnotationsBuilder_; + + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public java.util.List getShotAnnotationsList() { + if (shotAnnotationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(shotAnnotations_); + } else { + return shotAnnotationsBuilder_.getMessageList(); + } + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public int getShotAnnotationsCount() { + if (shotAnnotationsBuilder_ == null) { + return shotAnnotations_.size(); + } else { + return shotAnnotationsBuilder_.getCount(); + } + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment getShotAnnotations(int index) { + if (shotAnnotationsBuilder_ == null) { + return shotAnnotations_.get(index); + } else { + return shotAnnotationsBuilder_.getMessage(index); + } + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public Builder setShotAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoSegment value) { + if (shotAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShotAnnotationsIsMutable(); + shotAnnotations_.set(index, value); + onChanged(); + } else { + shotAnnotationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public Builder setShotAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder builderForValue) { + if (shotAnnotationsBuilder_ == null) { + ensureShotAnnotationsIsMutable(); + shotAnnotations_.set(index, builderForValue.build()); + onChanged(); + } else { + shotAnnotationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public Builder addShotAnnotations(com.google.cloud.videointelligence.v1p2beta1.VideoSegment value) { + if (shotAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShotAnnotationsIsMutable(); + shotAnnotations_.add(value); + onChanged(); + } else { + shotAnnotationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public Builder addShotAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoSegment value) { + if (shotAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureShotAnnotationsIsMutable(); + shotAnnotations_.add(index, value); + onChanged(); + } else { + shotAnnotationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public Builder addShotAnnotations( + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder builderForValue) { + if (shotAnnotationsBuilder_ == null) { + ensureShotAnnotationsIsMutable(); + shotAnnotations_.add(builderForValue.build()); + onChanged(); + } else { + shotAnnotationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public Builder addShotAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder builderForValue) { + if (shotAnnotationsBuilder_ == null) { + ensureShotAnnotationsIsMutable(); + shotAnnotations_.add(index, builderForValue.build()); + onChanged(); + } else { + shotAnnotationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public Builder addAllShotAnnotations( + java.lang.Iterable values) { + if (shotAnnotationsBuilder_ == null) { + ensureShotAnnotationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, shotAnnotations_); + onChanged(); + } else { + shotAnnotationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public Builder clearShotAnnotations() { + if (shotAnnotationsBuilder_ == null) { + shotAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + shotAnnotationsBuilder_.clear(); + } + return this; + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public Builder removeShotAnnotations(int index) { + if (shotAnnotationsBuilder_ == null) { + ensureShotAnnotationsIsMutable(); + shotAnnotations_.remove(index); + onChanged(); + } else { + shotAnnotationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder getShotAnnotationsBuilder( + int index) { + return getShotAnnotationsFieldBuilder().getBuilder(index); + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getShotAnnotationsOrBuilder( + int index) { + if (shotAnnotationsBuilder_ == null) { + return shotAnnotations_.get(index); } else { + return shotAnnotationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public java.util.List + getShotAnnotationsOrBuilderList() { + if (shotAnnotationsBuilder_ != null) { + return shotAnnotationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(shotAnnotations_); + } + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder addShotAnnotationsBuilder() { + return getShotAnnotationsFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance()); + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder addShotAnnotationsBuilder( + int index) { + return getShotAnnotationsFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance()); + } + /** + *
+     * Shot annotations. Each shot is represented as a video segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + public java.util.List + getShotAnnotationsBuilderList() { + return getShotAnnotationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder> + getShotAnnotationsFieldBuilder() { + if (shotAnnotationsBuilder_ == null) { + shotAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder>( + shotAnnotations_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + shotAnnotations_ = null; + } + return shotAnnotationsBuilder_; + } + + private com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicitAnnotation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotationOrBuilder> explicitAnnotationBuilder_; + /** + *
+     * Explicit content annotation.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + public boolean hasExplicitAnnotation() { + return explicitAnnotationBuilder_ != null || explicitAnnotation_ != null; + } + /** + *
+     * Explicit content annotation.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation getExplicitAnnotation() { + if (explicitAnnotationBuilder_ == null) { + return explicitAnnotation_ == null ? com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.getDefaultInstance() : explicitAnnotation_; + } else { + return explicitAnnotationBuilder_.getMessage(); + } + } + /** + *
+     * Explicit content annotation.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + public Builder setExplicitAnnotation(com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation value) { + if (explicitAnnotationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explicitAnnotation_ = value; + onChanged(); + } else { + explicitAnnotationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Explicit content annotation.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + public Builder setExplicitAnnotation( + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.Builder builderForValue) { + if (explicitAnnotationBuilder_ == null) { + explicitAnnotation_ = builderForValue.build(); + onChanged(); + } else { + explicitAnnotationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Explicit content annotation.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + public Builder mergeExplicitAnnotation(com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation value) { + if (explicitAnnotationBuilder_ == null) { + if (explicitAnnotation_ != null) { + explicitAnnotation_ = + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.newBuilder(explicitAnnotation_).mergeFrom(value).buildPartial(); + } else { + explicitAnnotation_ = value; + } + onChanged(); + } else { + explicitAnnotationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Explicit content annotation.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + public Builder clearExplicitAnnotation() { + if (explicitAnnotationBuilder_ == null) { + explicitAnnotation_ = null; + onChanged(); + } else { + explicitAnnotation_ = null; + explicitAnnotationBuilder_ = null; + } + + return this; + } + /** + *
+     * Explicit content annotation.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.Builder getExplicitAnnotationBuilder() { + + onChanged(); + return getExplicitAnnotationFieldBuilder().getBuilder(); + } + /** + *
+     * Explicit content annotation.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotationOrBuilder getExplicitAnnotationOrBuilder() { + if (explicitAnnotationBuilder_ != null) { + return explicitAnnotationBuilder_.getMessageOrBuilder(); + } else { + return explicitAnnotation_ == null ? + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.getDefaultInstance() : explicitAnnotation_; + } + } + /** + *
+     * Explicit content annotation.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotationOrBuilder> + getExplicitAnnotationFieldBuilder() { + if (explicitAnnotationBuilder_ == null) { + explicitAnnotationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotationOrBuilder>( + getExplicitAnnotation(), + getParentForChildren(), + isClean()); + explicitAnnotation_ = null; + } + return explicitAnnotationBuilder_; + } + + private java.util.List textAnnotations_ = + java.util.Collections.emptyList(); + private void ensureTextAnnotationsIsMutable() { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { + textAnnotations_ = new java.util.ArrayList(textAnnotations_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.TextAnnotation, com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.TextAnnotationOrBuilder> textAnnotationsBuilder_; + + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public java.util.List getTextAnnotationsList() { + if (textAnnotationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(textAnnotations_); + } else { + return textAnnotationsBuilder_.getMessageList(); + } + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public int getTextAnnotationsCount() { + if (textAnnotationsBuilder_ == null) { + return textAnnotations_.size(); + } else { + return textAnnotationsBuilder_.getCount(); + } + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextAnnotation getTextAnnotations(int index) { + if (textAnnotationsBuilder_ == null) { + return textAnnotations_.get(index); + } else { + return textAnnotationsBuilder_.getMessage(index); + } + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public Builder setTextAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.TextAnnotation value) { + if (textAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextAnnotationsIsMutable(); + textAnnotations_.set(index, value); + onChanged(); + } else { + textAnnotationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public Builder setTextAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.Builder builderForValue) { + if (textAnnotationsBuilder_ == null) { + ensureTextAnnotationsIsMutable(); + textAnnotations_.set(index, builderForValue.build()); + onChanged(); + } else { + textAnnotationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public Builder addTextAnnotations(com.google.cloud.videointelligence.v1p2beta1.TextAnnotation value) { + if (textAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextAnnotationsIsMutable(); + textAnnotations_.add(value); + onChanged(); + } else { + textAnnotationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public Builder addTextAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.TextAnnotation value) { + if (textAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureTextAnnotationsIsMutable(); + textAnnotations_.add(index, value); + onChanged(); + } else { + textAnnotationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public Builder addTextAnnotations( + com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.Builder builderForValue) { + if (textAnnotationsBuilder_ == null) { + ensureTextAnnotationsIsMutable(); + textAnnotations_.add(builderForValue.build()); + onChanged(); + } else { + textAnnotationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public Builder addTextAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.Builder builderForValue) { + if (textAnnotationsBuilder_ == null) { + ensureTextAnnotationsIsMutable(); + textAnnotations_.add(index, builderForValue.build()); + onChanged(); + } else { + textAnnotationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public Builder addAllTextAnnotations( + java.lang.Iterable values) { + if (textAnnotationsBuilder_ == null) { + ensureTextAnnotationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, textAnnotations_); + onChanged(); + } else { + textAnnotationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public Builder clearTextAnnotations() { + if (textAnnotationsBuilder_ == null) { + textAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + textAnnotationsBuilder_.clear(); + } + return this; + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public Builder removeTextAnnotations(int index) { + if (textAnnotationsBuilder_ == null) { + ensureTextAnnotationsIsMutable(); + textAnnotations_.remove(index); + onChanged(); + } else { + textAnnotationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.Builder getTextAnnotationsBuilder( + int index) { + return getTextAnnotationsFieldBuilder().getBuilder(index); + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextAnnotationOrBuilder getTextAnnotationsOrBuilder( + int index) { + if (textAnnotationsBuilder_ == null) { + return textAnnotations_.get(index); } else { + return textAnnotationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public java.util.List + getTextAnnotationsOrBuilderList() { + if (textAnnotationsBuilder_ != null) { + return textAnnotationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(textAnnotations_); + } + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.Builder addTextAnnotationsBuilder() { + return getTextAnnotationsFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.getDefaultInstance()); + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.Builder addTextAnnotationsBuilder( + int index) { + return getTextAnnotationsFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.getDefaultInstance()); + } + /** + *
+     * OCR text detection and tracking.
+     * Annotations for list of detected text snippets. Each will have list of
+     * frame information associated with it.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + public java.util.List + getTextAnnotationsBuilderList() { + return getTextAnnotationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.TextAnnotation, com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.TextAnnotationOrBuilder> + getTextAnnotationsFieldBuilder() { + if (textAnnotationsBuilder_ == null) { + textAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.TextAnnotation, com.google.cloud.videointelligence.v1p2beta1.TextAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.TextAnnotationOrBuilder>( + textAnnotations_, + ((bitField0_ & 0x00000040) == 0x00000040), + getParentForChildren(), + isClean()); + textAnnotations_ = null; + } + return textAnnotationsBuilder_; + } + + private java.util.List objectAnnotations_ = + java.util.Collections.emptyList(); + private void ensureObjectAnnotationsIsMutable() { + if (!((bitField0_ & 0x00000080) == 0x00000080)) { + objectAnnotations_ = new java.util.ArrayList(objectAnnotations_); + bitField0_ |= 0x00000080; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotationOrBuilder> objectAnnotationsBuilder_; + + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public java.util.List getObjectAnnotationsList() { + if (objectAnnotationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(objectAnnotations_); + } else { + return objectAnnotationsBuilder_.getMessageList(); + } + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public int getObjectAnnotationsCount() { + if (objectAnnotationsBuilder_ == null) { + return objectAnnotations_.size(); + } else { + return objectAnnotationsBuilder_.getCount(); + } + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation getObjectAnnotations(int index) { + if (objectAnnotationsBuilder_ == null) { + return objectAnnotations_.get(index); + } else { + return objectAnnotationsBuilder_.getMessage(index); + } + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public Builder setObjectAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation value) { + if (objectAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureObjectAnnotationsIsMutable(); + objectAnnotations_.set(index, value); + onChanged(); + } else { + objectAnnotationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public Builder setObjectAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.Builder builderForValue) { + if (objectAnnotationsBuilder_ == null) { + ensureObjectAnnotationsIsMutable(); + objectAnnotations_.set(index, builderForValue.build()); + onChanged(); + } else { + objectAnnotationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public Builder addObjectAnnotations(com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation value) { + if (objectAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureObjectAnnotationsIsMutable(); + objectAnnotations_.add(value); + onChanged(); + } else { + objectAnnotationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public Builder addObjectAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation value) { + if (objectAnnotationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureObjectAnnotationsIsMutable(); + objectAnnotations_.add(index, value); + onChanged(); + } else { + objectAnnotationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public Builder addObjectAnnotations( + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.Builder builderForValue) { + if (objectAnnotationsBuilder_ == null) { + ensureObjectAnnotationsIsMutable(); + objectAnnotations_.add(builderForValue.build()); + onChanged(); + } else { + objectAnnotationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public Builder addObjectAnnotations( + int index, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.Builder builderForValue) { + if (objectAnnotationsBuilder_ == null) { + ensureObjectAnnotationsIsMutable(); + objectAnnotations_.add(index, builderForValue.build()); + onChanged(); + } else { + objectAnnotationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public Builder addAllObjectAnnotations( + java.lang.Iterable values) { + if (objectAnnotationsBuilder_ == null) { + ensureObjectAnnotationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, objectAnnotations_); + onChanged(); + } else { + objectAnnotationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public Builder clearObjectAnnotations() { + if (objectAnnotationsBuilder_ == null) { + objectAnnotations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + onChanged(); + } else { + objectAnnotationsBuilder_.clear(); + } + return this; + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public Builder removeObjectAnnotations(int index) { + if (objectAnnotationsBuilder_ == null) { + ensureObjectAnnotationsIsMutable(); + objectAnnotations_.remove(index); + onChanged(); + } else { + objectAnnotationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.Builder getObjectAnnotationsBuilder( + int index) { + return getObjectAnnotationsFieldBuilder().getBuilder(index); + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotationOrBuilder getObjectAnnotationsOrBuilder( + int index) { + if (objectAnnotationsBuilder_ == null) { + return objectAnnotations_.get(index); } else { + return objectAnnotationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public java.util.List + getObjectAnnotationsOrBuilderList() { + if (objectAnnotationsBuilder_ != null) { + return objectAnnotationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(objectAnnotations_); + } + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.Builder addObjectAnnotationsBuilder() { + return getObjectAnnotationsFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.getDefaultInstance()); + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.Builder addObjectAnnotationsBuilder( + int index) { + return getObjectAnnotationsFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.getDefaultInstance()); + } + /** + *
+     * Annotations for list of objects detected and tracked in video.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + public java.util.List + getObjectAnnotationsBuilderList() { + return getObjectAnnotationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotationOrBuilder> + getObjectAnnotationsFieldBuilder() { + if (objectAnnotationsBuilder_ == null) { + objectAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.Builder, com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotationOrBuilder>( + objectAnnotations_, + ((bitField0_ & 0x00000080) == 0x00000080), + getParentForChildren(), + isClean()); + objectAnnotations_ = null; + } + return objectAnnotationsBuilder_; + } + + private com.google.rpc.Status error_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> errorBuilder_; + /** + *
+     * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+     * some videos may succeed and some may fail.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + /** + *
+     * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+     * some videos may succeed and some may fail.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public com.google.rpc.Status getError() { + if (errorBuilder_ == null) { + return error_ == null ? com.google.rpc.Status.getDefaultInstance() : error_; + } else { + return errorBuilder_.getMessage(); + } + } + /** + *
+     * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+     * some videos may succeed and some may fail.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public Builder setError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+     * some videos may succeed and some may fail.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public Builder setError( + com.google.rpc.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+     * some videos may succeed and some may fail.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public Builder mergeError(com.google.rpc.Status value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.rpc.Status.newBuilder(error_).mergeFrom(value).buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+     * some videos may succeed and some may fail.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + /** + *
+     * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+     * some videos may succeed and some may fail.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public com.google.rpc.Status.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + /** + *
+     * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+     * some videos may succeed and some may fail.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + public com.google.rpc.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null ? + com.google.rpc.Status.getDefaultInstance() : error_; + } + } + /** + *
+     * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+     * some videos may succeed and some may fail.
+     * 
+ * + * .google.rpc.Status error = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getError(), + getParentForChildren(), + isClean()); + error_ = null; + } + return errorBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.VideoAnnotationResults) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults) + private static final com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VideoAnnotationResults parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VideoAnnotationResults(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.videointelligence.v1p2beta1.VideoAnnotationResults getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationResultsOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationResultsOrBuilder.java new file mode 100644 index 000000000000..6ce991e4db10 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoAnnotationResultsOrBuilder.java @@ -0,0 +1,371 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface VideoAnnotationResultsOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Video file location in
+   * [Google Cloud Storage](https://cloud.google.com/storage/).
+   * 
+ * + * string input_uri = 1; + */ + java.lang.String getInputUri(); + /** + *
+   * Video file location in
+   * [Google Cloud Storage](https://cloud.google.com/storage/).
+   * 
+ * + * string input_uri = 1; + */ + com.google.protobuf.ByteString + getInputUriBytes(); + + /** + *
+   * Label annotations on video level or user specified segment level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + java.util.List + getSegmentLabelAnnotationsList(); + /** + *
+   * Label annotations on video level or user specified segment level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation getSegmentLabelAnnotations(int index); + /** + *
+   * Label annotations on video level or user specified segment level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + int getSegmentLabelAnnotationsCount(); + /** + *
+   * Label annotations on video level or user specified segment level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + java.util.List + getSegmentLabelAnnotationsOrBuilderList(); + /** + *
+   * Label annotations on video level or user specified segment level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation segment_label_annotations = 2; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder getSegmentLabelAnnotationsOrBuilder( + int index); + + /** + *
+   * Label annotations on shot level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + java.util.List + getShotLabelAnnotationsList(); + /** + *
+   * Label annotations on shot level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation getShotLabelAnnotations(int index); + /** + *
+   * Label annotations on shot level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + int getShotLabelAnnotationsCount(); + /** + *
+   * Label annotations on shot level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + java.util.List + getShotLabelAnnotationsOrBuilderList(); + /** + *
+   * Label annotations on shot level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation shot_label_annotations = 3; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder getShotLabelAnnotationsOrBuilder( + int index); + + /** + *
+   * Label annotations on frame level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + java.util.List + getFrameLabelAnnotationsList(); + /** + *
+   * Label annotations on frame level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotation getFrameLabelAnnotations(int index); + /** + *
+   * Label annotations on frame level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + int getFrameLabelAnnotationsCount(); + /** + *
+   * Label annotations on frame level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + java.util.List + getFrameLabelAnnotationsOrBuilderList(); + /** + *
+   * Label annotations on frame level.
+   * There is exactly one element for each unique label.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.LabelAnnotation frame_label_annotations = 4; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelAnnotationOrBuilder getFrameLabelAnnotationsOrBuilder( + int index); + + /** + *
+   * Shot annotations. Each shot is represented as a video segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + java.util.List + getShotAnnotationsList(); + /** + *
+   * Shot annotations. Each shot is represented as a video segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoSegment getShotAnnotations(int index); + /** + *
+   * Shot annotations. Each shot is represented as a video segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + int getShotAnnotationsCount(); + /** + *
+   * Shot annotations. Each shot is represented as a video segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + java.util.List + getShotAnnotationsOrBuilderList(); + /** + *
+   * Shot annotations. Each shot is represented as a video segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment shot_annotations = 6; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getShotAnnotationsOrBuilder( + int index); + + /** + *
+   * Explicit content annotation.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + boolean hasExplicitAnnotation(); + /** + *
+   * Explicit content annotation.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation getExplicitAnnotation(); + /** + *
+   * Explicit content annotation.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation explicit_annotation = 7; + */ + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotationOrBuilder getExplicitAnnotationOrBuilder(); + + /** + *
+   * OCR text detection and tracking.
+   * Annotations for list of detected text snippets. Each will have list of
+   * frame information associated with it.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + java.util.List + getTextAnnotationsList(); + /** + *
+   * OCR text detection and tracking.
+   * Annotations for list of detected text snippets. Each will have list of
+   * frame information associated with it.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + com.google.cloud.videointelligence.v1p2beta1.TextAnnotation getTextAnnotations(int index); + /** + *
+   * OCR text detection and tracking.
+   * Annotations for list of detected text snippets. Each will have list of
+   * frame information associated with it.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + int getTextAnnotationsCount(); + /** + *
+   * OCR text detection and tracking.
+   * Annotations for list of detected text snippets. Each will have list of
+   * frame information associated with it.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + java.util.List + getTextAnnotationsOrBuilderList(); + /** + *
+   * OCR text detection and tracking.
+   * Annotations for list of detected text snippets. Each will have list of
+   * frame information associated with it.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.TextAnnotation text_annotations = 12; + */ + com.google.cloud.videointelligence.v1p2beta1.TextAnnotationOrBuilder getTextAnnotationsOrBuilder( + int index); + + /** + *
+   * Annotations for list of objects detected and tracked in video.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + java.util.List + getObjectAnnotationsList(); + /** + *
+   * Annotations for list of objects detected and tracked in video.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation getObjectAnnotations(int index); + /** + *
+   * Annotations for list of objects detected and tracked in video.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + int getObjectAnnotationsCount(); + /** + *
+   * Annotations for list of objects detected and tracked in video.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + java.util.List + getObjectAnnotationsOrBuilderList(); + /** + *
+   * Annotations for list of objects detected and tracked in video.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation object_annotations = 14; + */ + com.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotationOrBuilder getObjectAnnotationsOrBuilder( + int index); + + /** + *
+   * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+   * some videos may succeed and some may fail.
+   * 
+ * + * .google.rpc.Status error = 9; + */ + boolean hasError(); + /** + *
+   * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+   * some videos may succeed and some may fail.
+   * 
+ * + * .google.rpc.Status error = 9; + */ + com.google.rpc.Status getError(); + /** + *
+   * If set, indicates an error. Note that for a single `AnnotateVideoRequest`
+   * some videos may succeed and some may fail.
+   * 
+ * + * .google.rpc.Status error = 9; + */ + com.google.rpc.StatusOrBuilder getErrorOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoContext.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoContext.java new file mode 100644 index 000000000000..204a6bbf4ad5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoContext.java @@ -0,0 +1,1824 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Video context and/or feature-specific parameters.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.VideoContext} + */ +public final class VideoContext extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.VideoContext) + VideoContextOrBuilder { +private static final long serialVersionUID = 0L; + // Use VideoContext.newBuilder() to construct. + private VideoContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private VideoContext() { + segments_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private VideoContext( + 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: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + segments_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + segments_.add( + input.readMessage(com.google.cloud.videointelligence.v1p2beta1.VideoSegment.parser(), extensionRegistry)); + break; + } + case 18: { + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.Builder subBuilder = null; + if (labelDetectionConfig_ != null) { + subBuilder = labelDetectionConfig_.toBuilder(); + } + labelDetectionConfig_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(labelDetectionConfig_); + labelDetectionConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.Builder subBuilder = null; + if (shotChangeDetectionConfig_ != null) { + subBuilder = shotChangeDetectionConfig_.toBuilder(); + } + shotChangeDetectionConfig_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(shotChangeDetectionConfig_); + shotChangeDetectionConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.Builder subBuilder = null; + if (explicitContentDetectionConfig_ != null) { + subBuilder = explicitContentDetectionConfig_.toBuilder(); + } + explicitContentDetectionConfig_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(explicitContentDetectionConfig_); + explicitContentDetectionConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.Builder subBuilder = null; + if (textDetectionConfig_ != null) { + subBuilder = textDetectionConfig_.toBuilder(); + } + textDetectionConfig_ = input.readMessage(com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(textDetectionConfig_); + textDetectionConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + segments_ = java.util.Collections.unmodifiableList(segments_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.VideoContext.class, com.google.cloud.videointelligence.v1p2beta1.VideoContext.Builder.class); + } + + private int bitField0_; + public static final int SEGMENTS_FIELD_NUMBER = 1; + private java.util.List segments_; + /** + *
+   * Video segments to annotate. The segments may overlap and are not required
+   * to be contiguous or span the whole video. If unspecified, each video is
+   * treated as a single segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public java.util.List getSegmentsList() { + return segments_; + } + /** + *
+   * Video segments to annotate. The segments may overlap and are not required
+   * to be contiguous or span the whole video. If unspecified, each video is
+   * treated as a single segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public java.util.List + getSegmentsOrBuilderList() { + return segments_; + } + /** + *
+   * Video segments to annotate. The segments may overlap and are not required
+   * to be contiguous or span the whole video. If unspecified, each video is
+   * treated as a single segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public int getSegmentsCount() { + return segments_.size(); + } + /** + *
+   * Video segments to annotate. The segments may overlap and are not required
+   * to be contiguous or span the whole video. If unspecified, each video is
+   * treated as a single segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegments(int index) { + return segments_.get(index); + } + /** + *
+   * Video segments to annotate. The segments may overlap and are not required
+   * to be contiguous or span the whole video. If unspecified, each video is
+   * treated as a single segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getSegmentsOrBuilder( + int index) { + return segments_.get(index); + } + + public static final int LABEL_DETECTION_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig labelDetectionConfig_; + /** + *
+   * Config for LABEL_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + public boolean hasLabelDetectionConfig() { + return labelDetectionConfig_ != null; + } + /** + *
+   * Config for LABEL_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig getLabelDetectionConfig() { + return labelDetectionConfig_ == null ? com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.getDefaultInstance() : labelDetectionConfig_; + } + /** + *
+   * Config for LABEL_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfigOrBuilder getLabelDetectionConfigOrBuilder() { + return getLabelDetectionConfig(); + } + + public static final int SHOT_CHANGE_DETECTION_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shotChangeDetectionConfig_; + /** + *
+   * Config for SHOT_CHANGE_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + public boolean hasShotChangeDetectionConfig() { + return shotChangeDetectionConfig_ != null; + } + /** + *
+   * Config for SHOT_CHANGE_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig getShotChangeDetectionConfig() { + return shotChangeDetectionConfig_ == null ? com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.getDefaultInstance() : shotChangeDetectionConfig_; + } + /** + *
+   * Config for SHOT_CHANGE_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfigOrBuilder getShotChangeDetectionConfigOrBuilder() { + return getShotChangeDetectionConfig(); + } + + public static final int EXPLICIT_CONTENT_DETECTION_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicitContentDetectionConfig_; + /** + *
+   * Config for EXPLICIT_CONTENT_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + public boolean hasExplicitContentDetectionConfig() { + return explicitContentDetectionConfig_ != null; + } + /** + *
+   * Config for EXPLICIT_CONTENT_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig getExplicitContentDetectionConfig() { + return explicitContentDetectionConfig_ == null ? com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.getDefaultInstance() : explicitContentDetectionConfig_; + } + /** + *
+   * Config for EXPLICIT_CONTENT_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfigOrBuilder getExplicitContentDetectionConfigOrBuilder() { + return getExplicitContentDetectionConfig(); + } + + public static final int TEXT_DETECTION_CONFIG_FIELD_NUMBER = 8; + private com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig textDetectionConfig_; + /** + *
+   * Config for TEXT_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + public boolean hasTextDetectionConfig() { + return textDetectionConfig_ != null; + } + /** + *
+   * Config for TEXT_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig getTextDetectionConfig() { + return textDetectionConfig_ == null ? com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.getDefaultInstance() : textDetectionConfig_; + } + /** + *
+   * Config for TEXT_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfigOrBuilder getTextDetectionConfigOrBuilder() { + return getTextDetectionConfig(); + } + + 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 { + for (int i = 0; i < segments_.size(); i++) { + output.writeMessage(1, segments_.get(i)); + } + if (labelDetectionConfig_ != null) { + output.writeMessage(2, getLabelDetectionConfig()); + } + if (shotChangeDetectionConfig_ != null) { + output.writeMessage(3, getShotChangeDetectionConfig()); + } + if (explicitContentDetectionConfig_ != null) { + output.writeMessage(4, getExplicitContentDetectionConfig()); + } + if (textDetectionConfig_ != null) { + output.writeMessage(8, getTextDetectionConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < segments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, segments_.get(i)); + } + if (labelDetectionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getLabelDetectionConfig()); + } + if (shotChangeDetectionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getShotChangeDetectionConfig()); + } + if (explicitContentDetectionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getExplicitContentDetectionConfig()); + } + if (textDetectionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getTextDetectionConfig()); + } + 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.videointelligence.v1p2beta1.VideoContext)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.VideoContext other = (com.google.cloud.videointelligence.v1p2beta1.VideoContext) obj; + + boolean result = true; + result = result && getSegmentsList() + .equals(other.getSegmentsList()); + result = result && (hasLabelDetectionConfig() == other.hasLabelDetectionConfig()); + if (hasLabelDetectionConfig()) { + result = result && getLabelDetectionConfig() + .equals(other.getLabelDetectionConfig()); + } + result = result && (hasShotChangeDetectionConfig() == other.hasShotChangeDetectionConfig()); + if (hasShotChangeDetectionConfig()) { + result = result && getShotChangeDetectionConfig() + .equals(other.getShotChangeDetectionConfig()); + } + result = result && (hasExplicitContentDetectionConfig() == other.hasExplicitContentDetectionConfig()); + if (hasExplicitContentDetectionConfig()) { + result = result && getExplicitContentDetectionConfig() + .equals(other.getExplicitContentDetectionConfig()); + } + result = result && (hasTextDetectionConfig() == other.hasTextDetectionConfig()); + if (hasTextDetectionConfig()) { + result = result && getTextDetectionConfig() + .equals(other.getTextDetectionConfig()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSegmentsCount() > 0) { + hash = (37 * hash) + SEGMENTS_FIELD_NUMBER; + hash = (53 * hash) + getSegmentsList().hashCode(); + } + if (hasLabelDetectionConfig()) { + hash = (37 * hash) + LABEL_DETECTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getLabelDetectionConfig().hashCode(); + } + if (hasShotChangeDetectionConfig()) { + hash = (37 * hash) + SHOT_CHANGE_DETECTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getShotChangeDetectionConfig().hashCode(); + } + if (hasExplicitContentDetectionConfig()) { + hash = (37 * hash) + EXPLICIT_CONTENT_DETECTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getExplicitContentDetectionConfig().hashCode(); + } + if (hasTextDetectionConfig()) { + hash = (37 * hash) + TEXT_DETECTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getTextDetectionConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.VideoContext parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoContext 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.videointelligence.v1p2beta1.VideoContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoContext 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.videointelligence.v1p2beta1.VideoContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoContext parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoContext 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.videointelligence.v1p2beta1.VideoContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoContext 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.videointelligence.v1p2beta1.VideoContext parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoContext 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.videointelligence.v1p2beta1.VideoContext 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; + } + /** + *
+   * Video context and/or feature-specific parameters.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.VideoContext} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.VideoContext) + com.google.cloud.videointelligence.v1p2beta1.VideoContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.VideoContext.class, com.google.cloud.videointelligence.v1p2beta1.VideoContext.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.VideoContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSegmentsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (segmentsBuilder_ == null) { + segments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + segmentsBuilder_.clear(); + } + if (labelDetectionConfigBuilder_ == null) { + labelDetectionConfig_ = null; + } else { + labelDetectionConfig_ = null; + labelDetectionConfigBuilder_ = null; + } + if (shotChangeDetectionConfigBuilder_ == null) { + shotChangeDetectionConfig_ = null; + } else { + shotChangeDetectionConfig_ = null; + shotChangeDetectionConfigBuilder_ = null; + } + if (explicitContentDetectionConfigBuilder_ == null) { + explicitContentDetectionConfig_ = null; + } else { + explicitContentDetectionConfig_ = null; + explicitContentDetectionConfigBuilder_ = null; + } + if (textDetectionConfigBuilder_ == null) { + textDetectionConfig_ = null; + } else { + textDetectionConfig_ = null; + textDetectionConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoContext_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.VideoContext getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoContext.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.VideoContext build() { + com.google.cloud.videointelligence.v1p2beta1.VideoContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.VideoContext buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.VideoContext result = new com.google.cloud.videointelligence.v1p2beta1.VideoContext(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (segmentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + segments_ = java.util.Collections.unmodifiableList(segments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.segments_ = segments_; + } else { + result.segments_ = segmentsBuilder_.build(); + } + if (labelDetectionConfigBuilder_ == null) { + result.labelDetectionConfig_ = labelDetectionConfig_; + } else { + result.labelDetectionConfig_ = labelDetectionConfigBuilder_.build(); + } + if (shotChangeDetectionConfigBuilder_ == null) { + result.shotChangeDetectionConfig_ = shotChangeDetectionConfig_; + } else { + result.shotChangeDetectionConfig_ = shotChangeDetectionConfigBuilder_.build(); + } + if (explicitContentDetectionConfigBuilder_ == null) { + result.explicitContentDetectionConfig_ = explicitContentDetectionConfig_; + } else { + result.explicitContentDetectionConfig_ = explicitContentDetectionConfigBuilder_.build(); + } + if (textDetectionConfigBuilder_ == null) { + result.textDetectionConfig_ = textDetectionConfig_; + } else { + result.textDetectionConfig_ = textDetectionConfigBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.VideoContext) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.VideoContext)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.VideoContext other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.VideoContext.getDefaultInstance()) return this; + if (segmentsBuilder_ == null) { + if (!other.segments_.isEmpty()) { + if (segments_.isEmpty()) { + segments_ = other.segments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSegmentsIsMutable(); + segments_.addAll(other.segments_); + } + onChanged(); + } + } else { + if (!other.segments_.isEmpty()) { + if (segmentsBuilder_.isEmpty()) { + segmentsBuilder_.dispose(); + segmentsBuilder_ = null; + segments_ = other.segments_; + bitField0_ = (bitField0_ & ~0x00000001); + segmentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSegmentsFieldBuilder() : null; + } else { + segmentsBuilder_.addAllMessages(other.segments_); + } + } + } + if (other.hasLabelDetectionConfig()) { + mergeLabelDetectionConfig(other.getLabelDetectionConfig()); + } + if (other.hasShotChangeDetectionConfig()) { + mergeShotChangeDetectionConfig(other.getShotChangeDetectionConfig()); + } + if (other.hasExplicitContentDetectionConfig()) { + mergeExplicitContentDetectionConfig(other.getExplicitContentDetectionConfig()); + } + if (other.hasTextDetectionConfig()) { + mergeTextDetectionConfig(other.getTextDetectionConfig()); + } + 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.videointelligence.v1p2beta1.VideoContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.VideoContext) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List segments_ = + java.util.Collections.emptyList(); + private void ensureSegmentsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + segments_ = new java.util.ArrayList(segments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder> segmentsBuilder_; + + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public java.util.List getSegmentsList() { + if (segmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(segments_); + } else { + return segmentsBuilder_.getMessageList(); + } + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public int getSegmentsCount() { + if (segmentsBuilder_ == null) { + return segments_.size(); + } else { + return segmentsBuilder_.getCount(); + } + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegments(int index) { + if (segmentsBuilder_ == null) { + return segments_.get(index); + } else { + return segmentsBuilder_.getMessage(index); + } + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public Builder setSegments( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoSegment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.set(index, value); + onChanged(); + } else { + segmentsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public Builder setSegments( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.set(index, builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public Builder addSegments(com.google.cloud.videointelligence.v1p2beta1.VideoSegment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.add(value); + onChanged(); + } else { + segmentsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public Builder addSegments( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoSegment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.add(index, value); + onChanged(); + } else { + segmentsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public Builder addSegments( + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public Builder addSegments( + int index, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(index, builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public Builder addAllSegments( + java.lang.Iterable values) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, segments_); + onChanged(); + } else { + segmentsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public Builder clearSegments() { + if (segmentsBuilder_ == null) { + segments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + segmentsBuilder_.clear(); + } + return this; + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public Builder removeSegments(int index) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.remove(index); + onChanged(); + } else { + segmentsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder getSegmentsBuilder( + int index) { + return getSegmentsFieldBuilder().getBuilder(index); + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getSegmentsOrBuilder( + int index) { + if (segmentsBuilder_ == null) { + return segments_.get(index); } else { + return segmentsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public java.util.List + getSegmentsOrBuilderList() { + if (segmentsBuilder_ != null) { + return segmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(segments_); + } + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder addSegmentsBuilder() { + return getSegmentsFieldBuilder().addBuilder( + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance()); + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder addSegmentsBuilder( + int index) { + return getSegmentsFieldBuilder().addBuilder( + index, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance()); + } + /** + *
+     * Video segments to annotate. The segments may overlap and are not required
+     * to be contiguous or span the whole video. If unspecified, each video is
+     * treated as a single segment.
+     * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + public java.util.List + getSegmentsBuilderList() { + return getSegmentsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder> + getSegmentsFieldBuilder() { + if (segmentsBuilder_ == null) { + segmentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.VideoSegment, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder, com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder>( + segments_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + segments_ = null; + } + return segmentsBuilder_; + } + + private com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig labelDetectionConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig, com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfigOrBuilder> labelDetectionConfigBuilder_; + /** + *
+     * Config for LABEL_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + public boolean hasLabelDetectionConfig() { + return labelDetectionConfigBuilder_ != null || labelDetectionConfig_ != null; + } + /** + *
+     * Config for LABEL_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig getLabelDetectionConfig() { + if (labelDetectionConfigBuilder_ == null) { + return labelDetectionConfig_ == null ? com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.getDefaultInstance() : labelDetectionConfig_; + } else { + return labelDetectionConfigBuilder_.getMessage(); + } + } + /** + *
+     * Config for LABEL_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + public Builder setLabelDetectionConfig(com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig value) { + if (labelDetectionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + labelDetectionConfig_ = value; + onChanged(); + } else { + labelDetectionConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Config for LABEL_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + public Builder setLabelDetectionConfig( + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.Builder builderForValue) { + if (labelDetectionConfigBuilder_ == null) { + labelDetectionConfig_ = builderForValue.build(); + onChanged(); + } else { + labelDetectionConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Config for LABEL_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + public Builder mergeLabelDetectionConfig(com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig value) { + if (labelDetectionConfigBuilder_ == null) { + if (labelDetectionConfig_ != null) { + labelDetectionConfig_ = + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.newBuilder(labelDetectionConfig_).mergeFrom(value).buildPartial(); + } else { + labelDetectionConfig_ = value; + } + onChanged(); + } else { + labelDetectionConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Config for LABEL_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + public Builder clearLabelDetectionConfig() { + if (labelDetectionConfigBuilder_ == null) { + labelDetectionConfig_ = null; + onChanged(); + } else { + labelDetectionConfig_ = null; + labelDetectionConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Config for LABEL_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.Builder getLabelDetectionConfigBuilder() { + + onChanged(); + return getLabelDetectionConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Config for LABEL_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + public com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfigOrBuilder getLabelDetectionConfigOrBuilder() { + if (labelDetectionConfigBuilder_ != null) { + return labelDetectionConfigBuilder_.getMessageOrBuilder(); + } else { + return labelDetectionConfig_ == null ? + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.getDefaultInstance() : labelDetectionConfig_; + } + } + /** + *
+     * Config for LABEL_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig, com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfigOrBuilder> + getLabelDetectionConfigFieldBuilder() { + if (labelDetectionConfigBuilder_ == null) { + labelDetectionConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig, com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.Builder, com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfigOrBuilder>( + getLabelDetectionConfig(), + getParentForChildren(), + isClean()); + labelDetectionConfig_ = null; + } + return labelDetectionConfigBuilder_; + } + + private com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shotChangeDetectionConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig, com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.Builder, com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfigOrBuilder> shotChangeDetectionConfigBuilder_; + /** + *
+     * Config for SHOT_CHANGE_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + public boolean hasShotChangeDetectionConfig() { + return shotChangeDetectionConfigBuilder_ != null || shotChangeDetectionConfig_ != null; + } + /** + *
+     * Config for SHOT_CHANGE_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig getShotChangeDetectionConfig() { + if (shotChangeDetectionConfigBuilder_ == null) { + return shotChangeDetectionConfig_ == null ? com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.getDefaultInstance() : shotChangeDetectionConfig_; + } else { + return shotChangeDetectionConfigBuilder_.getMessage(); + } + } + /** + *
+     * Config for SHOT_CHANGE_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + public Builder setShotChangeDetectionConfig(com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig value) { + if (shotChangeDetectionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + shotChangeDetectionConfig_ = value; + onChanged(); + } else { + shotChangeDetectionConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Config for SHOT_CHANGE_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + public Builder setShotChangeDetectionConfig( + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.Builder builderForValue) { + if (shotChangeDetectionConfigBuilder_ == null) { + shotChangeDetectionConfig_ = builderForValue.build(); + onChanged(); + } else { + shotChangeDetectionConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Config for SHOT_CHANGE_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + public Builder mergeShotChangeDetectionConfig(com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig value) { + if (shotChangeDetectionConfigBuilder_ == null) { + if (shotChangeDetectionConfig_ != null) { + shotChangeDetectionConfig_ = + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.newBuilder(shotChangeDetectionConfig_).mergeFrom(value).buildPartial(); + } else { + shotChangeDetectionConfig_ = value; + } + onChanged(); + } else { + shotChangeDetectionConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Config for SHOT_CHANGE_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + public Builder clearShotChangeDetectionConfig() { + if (shotChangeDetectionConfigBuilder_ == null) { + shotChangeDetectionConfig_ = null; + onChanged(); + } else { + shotChangeDetectionConfig_ = null; + shotChangeDetectionConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Config for SHOT_CHANGE_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.Builder getShotChangeDetectionConfigBuilder() { + + onChanged(); + return getShotChangeDetectionConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Config for SHOT_CHANGE_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + public com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfigOrBuilder getShotChangeDetectionConfigOrBuilder() { + if (shotChangeDetectionConfigBuilder_ != null) { + return shotChangeDetectionConfigBuilder_.getMessageOrBuilder(); + } else { + return shotChangeDetectionConfig_ == null ? + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.getDefaultInstance() : shotChangeDetectionConfig_; + } + } + /** + *
+     * Config for SHOT_CHANGE_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig, com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.Builder, com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfigOrBuilder> + getShotChangeDetectionConfigFieldBuilder() { + if (shotChangeDetectionConfigBuilder_ == null) { + shotChangeDetectionConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig, com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.Builder, com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfigOrBuilder>( + getShotChangeDetectionConfig(), + getParentForChildren(), + isClean()); + shotChangeDetectionConfig_ = null; + } + return shotChangeDetectionConfigBuilder_; + } + + private com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicitContentDetectionConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.Builder, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfigOrBuilder> explicitContentDetectionConfigBuilder_; + /** + *
+     * Config for EXPLICIT_CONTENT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + public boolean hasExplicitContentDetectionConfig() { + return explicitContentDetectionConfigBuilder_ != null || explicitContentDetectionConfig_ != null; + } + /** + *
+     * Config for EXPLICIT_CONTENT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig getExplicitContentDetectionConfig() { + if (explicitContentDetectionConfigBuilder_ == null) { + return explicitContentDetectionConfig_ == null ? com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.getDefaultInstance() : explicitContentDetectionConfig_; + } else { + return explicitContentDetectionConfigBuilder_.getMessage(); + } + } + /** + *
+     * Config for EXPLICIT_CONTENT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + public Builder setExplicitContentDetectionConfig(com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig value) { + if (explicitContentDetectionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + explicitContentDetectionConfig_ = value; + onChanged(); + } else { + explicitContentDetectionConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Config for EXPLICIT_CONTENT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + public Builder setExplicitContentDetectionConfig( + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.Builder builderForValue) { + if (explicitContentDetectionConfigBuilder_ == null) { + explicitContentDetectionConfig_ = builderForValue.build(); + onChanged(); + } else { + explicitContentDetectionConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Config for EXPLICIT_CONTENT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + public Builder mergeExplicitContentDetectionConfig(com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig value) { + if (explicitContentDetectionConfigBuilder_ == null) { + if (explicitContentDetectionConfig_ != null) { + explicitContentDetectionConfig_ = + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.newBuilder(explicitContentDetectionConfig_).mergeFrom(value).buildPartial(); + } else { + explicitContentDetectionConfig_ = value; + } + onChanged(); + } else { + explicitContentDetectionConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Config for EXPLICIT_CONTENT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + public Builder clearExplicitContentDetectionConfig() { + if (explicitContentDetectionConfigBuilder_ == null) { + explicitContentDetectionConfig_ = null; + onChanged(); + } else { + explicitContentDetectionConfig_ = null; + explicitContentDetectionConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Config for EXPLICIT_CONTENT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.Builder getExplicitContentDetectionConfigBuilder() { + + onChanged(); + return getExplicitContentDetectionConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Config for EXPLICIT_CONTENT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + public com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfigOrBuilder getExplicitContentDetectionConfigOrBuilder() { + if (explicitContentDetectionConfigBuilder_ != null) { + return explicitContentDetectionConfigBuilder_.getMessageOrBuilder(); + } else { + return explicitContentDetectionConfig_ == null ? + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.getDefaultInstance() : explicitContentDetectionConfig_; + } + } + /** + *
+     * Config for EXPLICIT_CONTENT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.Builder, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfigOrBuilder> + getExplicitContentDetectionConfigFieldBuilder() { + if (explicitContentDetectionConfigBuilder_ == null) { + explicitContentDetectionConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.Builder, com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfigOrBuilder>( + getExplicitContentDetectionConfig(), + getParentForChildren(), + isClean()); + explicitContentDetectionConfig_ = null; + } + return explicitContentDetectionConfigBuilder_; + } + + private com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig textDetectionConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig, com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.Builder, com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfigOrBuilder> textDetectionConfigBuilder_; + /** + *
+     * Config for TEXT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + public boolean hasTextDetectionConfig() { + return textDetectionConfigBuilder_ != null || textDetectionConfig_ != null; + } + /** + *
+     * Config for TEXT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig getTextDetectionConfig() { + if (textDetectionConfigBuilder_ == null) { + return textDetectionConfig_ == null ? com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.getDefaultInstance() : textDetectionConfig_; + } else { + return textDetectionConfigBuilder_.getMessage(); + } + } + /** + *
+     * Config for TEXT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + public Builder setTextDetectionConfig(com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig value) { + if (textDetectionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + textDetectionConfig_ = value; + onChanged(); + } else { + textDetectionConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Config for TEXT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + public Builder setTextDetectionConfig( + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.Builder builderForValue) { + if (textDetectionConfigBuilder_ == null) { + textDetectionConfig_ = builderForValue.build(); + onChanged(); + } else { + textDetectionConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Config for TEXT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + public Builder mergeTextDetectionConfig(com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig value) { + if (textDetectionConfigBuilder_ == null) { + if (textDetectionConfig_ != null) { + textDetectionConfig_ = + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.newBuilder(textDetectionConfig_).mergeFrom(value).buildPartial(); + } else { + textDetectionConfig_ = value; + } + onChanged(); + } else { + textDetectionConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Config for TEXT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + public Builder clearTextDetectionConfig() { + if (textDetectionConfigBuilder_ == null) { + textDetectionConfig_ = null; + onChanged(); + } else { + textDetectionConfig_ = null; + textDetectionConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * Config for TEXT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.Builder getTextDetectionConfigBuilder() { + + onChanged(); + return getTextDetectionConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Config for TEXT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + public com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfigOrBuilder getTextDetectionConfigOrBuilder() { + if (textDetectionConfigBuilder_ != null) { + return textDetectionConfigBuilder_.getMessageOrBuilder(); + } else { + return textDetectionConfig_ == null ? + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.getDefaultInstance() : textDetectionConfig_; + } + } + /** + *
+     * Config for TEXT_DETECTION.
+     * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig, com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.Builder, com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfigOrBuilder> + getTextDetectionConfigFieldBuilder() { + if (textDetectionConfigBuilder_ == null) { + textDetectionConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig, com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.Builder, com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfigOrBuilder>( + getTextDetectionConfig(), + getParentForChildren(), + isClean()); + textDetectionConfig_ = null; + } + return textDetectionConfigBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.VideoContext) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.VideoContext) + private static final com.google.cloud.videointelligence.v1p2beta1.VideoContext DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.VideoContext(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.VideoContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VideoContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VideoContext(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.videointelligence.v1p2beta1.VideoContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoContextOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoContextOrBuilder.java new file mode 100644 index 000000000000..079cf04fdf32 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoContextOrBuilder.java @@ -0,0 +1,163 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface VideoContextOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.VideoContext) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Video segments to annotate. The segments may overlap and are not required
+   * to be contiguous or span the whole video. If unspecified, each video is
+   * treated as a single segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + java.util.List + getSegmentsList(); + /** + *
+   * Video segments to annotate. The segments may overlap and are not required
+   * to be contiguous or span the whole video. If unspecified, each video is
+   * treated as a single segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoSegment getSegments(int index); + /** + *
+   * Video segments to annotate. The segments may overlap and are not required
+   * to be contiguous or span the whole video. If unspecified, each video is
+   * treated as a single segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + int getSegmentsCount(); + /** + *
+   * Video segments to annotate. The segments may overlap and are not required
+   * to be contiguous or span the whole video. If unspecified, each video is
+   * treated as a single segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + java.util.List + getSegmentsOrBuilderList(); + /** + *
+   * Video segments to annotate. The segments may overlap and are not required
+   * to be contiguous or span the whole video. If unspecified, each video is
+   * treated as a single segment.
+   * 
+ * + * repeated .google.cloud.videointelligence.v1p2beta1.VideoSegment segments = 1; + */ + com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder getSegmentsOrBuilder( + int index); + + /** + *
+   * Config for LABEL_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + boolean hasLabelDetectionConfig(); + /** + *
+   * Config for LABEL_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig getLabelDetectionConfig(); + /** + *
+   * Config for LABEL_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig label_detection_config = 2; + */ + com.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfigOrBuilder getLabelDetectionConfigOrBuilder(); + + /** + *
+   * Config for SHOT_CHANGE_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + boolean hasShotChangeDetectionConfig(); + /** + *
+   * Config for SHOT_CHANGE_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig getShotChangeDetectionConfig(); + /** + *
+   * Config for SHOT_CHANGE_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + com.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfigOrBuilder getShotChangeDetectionConfigOrBuilder(); + + /** + *
+   * Config for EXPLICIT_CONTENT_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + boolean hasExplicitContentDetectionConfig(); + /** + *
+   * Config for EXPLICIT_CONTENT_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig getExplicitContentDetectionConfig(); + /** + *
+   * Config for EXPLICIT_CONTENT_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + com.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfigOrBuilder getExplicitContentDetectionConfigOrBuilder(); + + /** + *
+   * Config for TEXT_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + boolean hasTextDetectionConfig(); + /** + *
+   * Config for TEXT_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig getTextDetectionConfig(); + /** + *
+   * Config for TEXT_DETECTION.
+   * 
+ * + * .google.cloud.videointelligence.v1p2beta1.TextDetectionConfig text_detection_config = 8; + */ + com.google.cloud.videointelligence.v1p2beta1.TextDetectionConfigOrBuilder getTextDetectionConfigOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceProto.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceProto.java new file mode 100644 index 000000000000..3c70cb97ae47 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceProto.java @@ -0,0 +1,467 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public final class VideoIntelligenceServiceProto { + private VideoIntelligenceServiceProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_VideoContext_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_VideoContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_LabelDetectionConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_LabelDetectionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_ShotChangeDetectionConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_ShotChangeDetectionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentDetectionConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentDetectionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_TextDetectionConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_TextDetectionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_VideoSegment_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_VideoSegment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_LabelSegment_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_LabelSegment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_LabelFrame_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_LabelFrame_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_Entity_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_Entity_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_LabelAnnotation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_LabelAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentFrame_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentFrame_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentAnnotation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingBox_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingBox_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationResults_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationResults_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationProgress_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationProgress_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoProgress_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoProgress_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedVertex_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedVertex_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingPoly_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingPoly_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_TextSegment_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_TextSegment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_TextFrame_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_TextFrame_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_TextAnnotation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_TextAnnotation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingFrame_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingFrame_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingAnnotation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingAnnotation_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\nAgoogle/cloud/videointelligence/v1p2bet" + + "a1/video_intelligence.proto\022(google.clou" + + "d.videointelligence.v1p2beta1\032\034google/ap" + + "i/annotations.proto\032#google/longrunning/" + + "operations.proto\032\036google/protobuf/durati" + + "on.proto\032\037google/protobuf/timestamp.prot" + + "o\032\027google/rpc/status.proto\"\375\001\n\024AnnotateV" + + "ideoRequest\022\021\n\tinput_uri\030\001 \001(\t\022\025\n\rinput_" + + "content\030\006 \001(\014\022C\n\010features\030\002 \003(\01621.google" + + ".cloud.videointelligence.v1p2beta1.Featu" + + "re\022M\n\rvideo_context\030\003 \001(\01326.google.cloud" + + ".videointelligence.v1p2beta1.VideoContex" + + "t\022\022\n\noutput_uri\030\004 \001(\t\022\023\n\013location_id\030\005 \001" + + "(\t\"\366\003\n\014VideoContext\022H\n\010segments\030\001 \003(\01326." + + "google.cloud.videointelligence.v1p2beta1" + + ".VideoSegment\022^\n\026label_detection_config\030" + + "\002 \001(\0132>.google.cloud.videointelligence.v" + + "1p2beta1.LabelDetectionConfig\022i\n\034shot_ch" + + "ange_detection_config\030\003 \001(\0132C.google.clo" + + "ud.videointelligence.v1p2beta1.ShotChang" + + "eDetectionConfig\022s\n!explicit_content_det" + + "ection_config\030\004 \001(\0132H.google.cloud.video" + + "intelligence.v1p2beta1.ExplicitContentDe" + + "tectionConfig\022\\\n\025text_detection_config\030\010" + + " \001(\0132=.google.cloud.videointelligence.v1" + + "p2beta1.TextDetectionConfig\"\234\001\n\024LabelDet" + + "ectionConfig\022Z\n\024label_detection_mode\030\001 \001" + + "(\0162<.google.cloud.videointelligence.v1p2" + + "beta1.LabelDetectionMode\022\031\n\021stationary_c" + + "amera\030\002 \001(\010\022\r\n\005model\030\003 \001(\t\"*\n\031ShotChange" + + "DetectionConfig\022\r\n\005model\030\001 \001(\t\"/\n\036Explic" + + "itContentDetectionConfig\022\r\n\005model\030\001 \001(\t\"" + + "-\n\023TextDetectionConfig\022\026\n\016language_hints" + + "\030\001 \003(\t\"x\n\014VideoSegment\0224\n\021start_time_off" + + "set\030\001 \001(\0132\031.google.protobuf.Duration\0222\n\017" + + "end_time_offset\030\002 \001(\0132\031.google.protobuf." + + "Duration\"k\n\014LabelSegment\022G\n\007segment\030\001 \001(" + + "\01326.google.cloud.videointelligence.v1p2b" + + "eta1.VideoSegment\022\022\n\nconfidence\030\002 \001(\002\"P\n" + + "\nLabelFrame\022.\n\013time_offset\030\001 \001(\0132\031.googl" + + "e.protobuf.Duration\022\022\n\nconfidence\030\002 \001(\002\"" + + "G\n\006Entity\022\021\n\tentity_id\030\001 \001(\t\022\023\n\013descript" + + "ion\030\002 \001(\t\022\025\n\rlanguage_code\030\003 \001(\t\"\260\002\n\017Lab" + + "elAnnotation\022@\n\006entity\030\001 \001(\01320.google.cl" + + "oud.videointelligence.v1p2beta1.Entity\022K" + + "\n\021category_entities\030\002 \003(\01320.google.cloud" + + ".videointelligence.v1p2beta1.Entity\022H\n\010s" + + "egments\030\003 \003(\01326.google.cloud.videointell" + + "igence.v1p2beta1.LabelSegment\022D\n\006frames\030" + + "\004 \003(\01324.google.cloud.videointelligence.v" + + "1p2beta1.LabelFrame\"\234\001\n\024ExplicitContentF" + + "rame\022.\n\013time_offset\030\001 \001(\0132\031.google.proto" + + "buf.Duration\022T\n\026pornography_likelihood\030\002" + + " \001(\01624.google.cloud.videointelligence.v1" + + "p2beta1.Likelihood\"k\n\031ExplicitContentAnn" + + "otation\022N\n\006frames\030\001 \003(\0132>.google.cloud.v" + + "ideointelligence.v1p2beta1.ExplicitConte" + + "ntFrame\"Q\n\025NormalizedBoundingBox\022\014\n\004left" + + "\030\001 \001(\002\022\013\n\003top\030\002 \001(\002\022\r\n\005right\030\003 \001(\002\022\016\n\006bo" + + "ttom\030\004 \001(\002\"\313\005\n\026VideoAnnotationResults\022\021\n" + + "\tinput_uri\030\001 \001(\t\022\\\n\031segment_label_annota" + + "tions\030\002 \003(\01329.google.cloud.videointellig" + + "ence.v1p2beta1.LabelAnnotation\022Y\n\026shot_l" + + "abel_annotations\030\003 \003(\01329.google.cloud.vi" + + "deointelligence.v1p2beta1.LabelAnnotatio" + + "n\022Z\n\027frame_label_annotations\030\004 \003(\01329.goo" + + "gle.cloud.videointelligence.v1p2beta1.La" + + "belAnnotation\022P\n\020shot_annotations\030\006 \003(\0132" + + "6.google.cloud.videointelligence.v1p2bet" + + "a1.VideoSegment\022`\n\023explicit_annotation\030\007" + + " \001(\0132C.google.cloud.videointelligence.v1" + + "p2beta1.ExplicitContentAnnotation\022R\n\020tex" + + "t_annotations\030\014 \003(\01328.google.cloud.video" + + "intelligence.v1p2beta1.TextAnnotation\022^\n" + + "\022object_annotations\030\016 \003(\0132B.google.cloud" + + ".videointelligence.v1p2beta1.ObjectTrack" + + "ingAnnotation\022!\n\005error\030\t \001(\0132\022.google.rp" + + "c.Status\"u\n\025AnnotateVideoResponse\022\\\n\022ann" + + "otation_results\030\001 \003(\0132@.google.cloud.vid" + + "eointelligence.v1p2beta1.VideoAnnotation" + + "Results\"\247\001\n\027VideoAnnotationProgress\022\021\n\ti" + + "nput_uri\030\001 \001(\t\022\030\n\020progress_percent\030\002 \001(\005" + + "\022.\n\nstart_time\030\003 \001(\0132\032.google.protobuf.T" + + "imestamp\022/\n\013update_time\030\004 \001(\0132\032.google.p" + + "rotobuf.Timestamp\"w\n\025AnnotateVideoProgre" + + "ss\022^\n\023annotation_progress\030\001 \003(\0132A.google" + + ".cloud.videointelligence.v1p2beta1.Video" + + "AnnotationProgress\"(\n\020NormalizedVertex\022\t" + + "\n\001x\030\001 \001(\002\022\t\n\001y\030\002 \001(\002\"f\n\026NormalizedBoundi" + + "ngPoly\022L\n\010vertices\030\001 \003(\0132:.google.cloud." + + "videointelligence.v1p2beta1.NormalizedVe" + + "rtex\"V\n\013TextSegment\022G\n\007segment\030\001 \001(\01326.g" + + "oogle.cloud.videointelligence.v1p2beta1." + + "VideoSegment\"\233\001\n\tTextFrame\022^\n\024rotated_bo" + + "unding_box\030\001 \001(\0132@.google.cloud.videoint" + + "elligence.v1p2beta1.NormalizedBoundingPo" + + "ly\022.\n\013time_offset\030\002 \001(\0132\031.google.protobu" + + "f.Duration\"\300\001\n\016TextAnnotation\022\014\n\004text\030\001 " + + "\001(\t\022\022\n\nconfidence\030\002 \001(\002\022C\n\006frames\030\003 \003(\0132" + + "3.google.cloud.videointelligence.v1p2bet" + + "a1.TextFrame\022G\n\010segments\030\004 \003(\01325.google." + + "cloud.videointelligence.v1p2beta1.TextSe" + + "gment\"\247\001\n\023ObjectTrackingFrame\022`\n\027normali" + + "zed_bounding_box\030\001 \001(\0132?.google.cloud.vi" + + "deointelligence.v1p2beta1.NormalizedBoun" + + "dingBox\022.\n\013time_offset\030\002 \001(\0132\031.google.pr" + + "otobuf.Duration\"\210\002\n\030ObjectTrackingAnnota" + + "tion\022@\n\006entity\030\001 \001(\01320.google.cloud.vide" + + "ointelligence.v1p2beta1.Entity\022\022\n\nconfid" + + "ence\030\004 \001(\002\022M\n\006frames\030\002 \003(\0132=.google.clou" + + "d.videointelligence.v1p2beta1.ObjectTrac" + + "kingFrame\022G\n\007segment\030\003 \001(\01326.google.clou" + + "d.videointelligence.v1p2beta1.VideoSegme" + + "nt*\233\001\n\007Feature\022\027\n\023FEATURE_UNSPECIFIED\020\000\022" + + "\023\n\017LABEL_DETECTION\020\001\022\031\n\025SHOT_CHANGE_DETE" + + "CTION\020\002\022\036\n\032EXPLICIT_CONTENT_DETECTION\020\003\022" + + "\022\n\016TEXT_DETECTION\020\007\022\023\n\017OBJECT_TRACKING\020\t" + + "*r\n\022LabelDetectionMode\022$\n LABEL_DETECTIO" + + "N_MODE_UNSPECIFIED\020\000\022\r\n\tSHOT_MODE\020\001\022\016\n\nF" + + "RAME_MODE\020\002\022\027\n\023SHOT_AND_FRAME_MODE\020\003*t\n\n" + + "Likelihood\022\032\n\026LIKELIHOOD_UNSPECIFIED\020\000\022\021" + + "\n\rVERY_UNLIKELY\020\001\022\014\n\010UNLIKELY\020\002\022\014\n\010POSSI" + + "BLE\020\003\022\n\n\006LIKELY\020\004\022\017\n\013VERY_LIKELY\020\0052\262\001\n\030V" + + "ideoIntelligenceService\022\225\001\n\rAnnotateVide" + + "o\022>.google.cloud.videointelligence.v1p2b" + + "eta1.AnnotateVideoRequest\032\035.google.longr" + + "unning.Operation\"%\202\323\344\223\002\037\"\032/v1p2beta1/vid" + + "eos:annotate:\001*B\200\002\n,com.google.cloud.vid" + + "eointelligence.v1p2beta1B\035VideoIntellige" + + "nceServiceProtoP\001ZYgoogle.golang.org/gen" + + "proto/googleapis/cloud/videointelligence" + + "/v1p2beta1;videointelligence\252\002(Google.Cl" + + "oud.VideoIntelligence.V1P2Beta1\312\002(Google" + + "\\Cloud\\VideoIntelligence\\V1p2beta1b\006prot" + + "o3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }, assigner); + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoRequest_descriptor, + new java.lang.String[] { "InputUri", "InputContent", "Features", "VideoContext", "OutputUri", "LocationId", }); + internal_static_google_cloud_videointelligence_v1p2beta1_VideoContext_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_videointelligence_v1p2beta1_VideoContext_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_VideoContext_descriptor, + new java.lang.String[] { "Segments", "LabelDetectionConfig", "ShotChangeDetectionConfig", "ExplicitContentDetectionConfig", "TextDetectionConfig", }); + internal_static_google_cloud_videointelligence_v1p2beta1_LabelDetectionConfig_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_videointelligence_v1p2beta1_LabelDetectionConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_LabelDetectionConfig_descriptor, + new java.lang.String[] { "LabelDetectionMode", "StationaryCamera", "Model", }); + internal_static_google_cloud_videointelligence_v1p2beta1_ShotChangeDetectionConfig_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_videointelligence_v1p2beta1_ShotChangeDetectionConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_ShotChangeDetectionConfig_descriptor, + new java.lang.String[] { "Model", }); + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentDetectionConfig_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentDetectionConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentDetectionConfig_descriptor, + new java.lang.String[] { "Model", }); + internal_static_google_cloud_videointelligence_v1p2beta1_TextDetectionConfig_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_videointelligence_v1p2beta1_TextDetectionConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_TextDetectionConfig_descriptor, + new java.lang.String[] { "LanguageHints", }); + internal_static_google_cloud_videointelligence_v1p2beta1_VideoSegment_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_videointelligence_v1p2beta1_VideoSegment_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_VideoSegment_descriptor, + new java.lang.String[] { "StartTimeOffset", "EndTimeOffset", }); + internal_static_google_cloud_videointelligence_v1p2beta1_LabelSegment_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_videointelligence_v1p2beta1_LabelSegment_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_LabelSegment_descriptor, + new java.lang.String[] { "Segment", "Confidence", }); + internal_static_google_cloud_videointelligence_v1p2beta1_LabelFrame_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_videointelligence_v1p2beta1_LabelFrame_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_LabelFrame_descriptor, + new java.lang.String[] { "TimeOffset", "Confidence", }); + internal_static_google_cloud_videointelligence_v1p2beta1_Entity_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_videointelligence_v1p2beta1_Entity_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_Entity_descriptor, + new java.lang.String[] { "EntityId", "Description", "LanguageCode", }); + internal_static_google_cloud_videointelligence_v1p2beta1_LabelAnnotation_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_videointelligence_v1p2beta1_LabelAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_LabelAnnotation_descriptor, + new java.lang.String[] { "Entity", "CategoryEntities", "Segments", "Frames", }); + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentFrame_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentFrame_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentFrame_descriptor, + new java.lang.String[] { "TimeOffset", "PornographyLikelihood", }); + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentAnnotation_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_ExplicitContentAnnotation_descriptor, + new java.lang.String[] { "Frames", }); + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingBox_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingBox_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingBox_descriptor, + new java.lang.String[] { "Left", "Top", "Right", "Bottom", }); + internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationResults_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationResults_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationResults_descriptor, + new java.lang.String[] { "InputUri", "SegmentLabelAnnotations", "ShotLabelAnnotations", "FrameLabelAnnotations", "ShotAnnotations", "ExplicitAnnotation", "TextAnnotations", "ObjectAnnotations", "Error", }); + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoResponse_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoResponse_descriptor, + new java.lang.String[] { "AnnotationResults", }); + internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationProgress_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationProgress_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_VideoAnnotationProgress_descriptor, + new java.lang.String[] { "InputUri", "ProgressPercent", "StartTime", "UpdateTime", }); + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoProgress_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoProgress_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_AnnotateVideoProgress_descriptor, + new java.lang.String[] { "AnnotationProgress", }); + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedVertex_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedVertex_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedVertex_descriptor, + new java.lang.String[] { "X", "Y", }); + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingPoly_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingPoly_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_NormalizedBoundingPoly_descriptor, + new java.lang.String[] { "Vertices", }); + internal_static_google_cloud_videointelligence_v1p2beta1_TextSegment_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_google_cloud_videointelligence_v1p2beta1_TextSegment_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_TextSegment_descriptor, + new java.lang.String[] { "Segment", }); + internal_static_google_cloud_videointelligence_v1p2beta1_TextFrame_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_google_cloud_videointelligence_v1p2beta1_TextFrame_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_TextFrame_descriptor, + new java.lang.String[] { "RotatedBoundingBox", "TimeOffset", }); + internal_static_google_cloud_videointelligence_v1p2beta1_TextAnnotation_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_google_cloud_videointelligence_v1p2beta1_TextAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_TextAnnotation_descriptor, + new java.lang.String[] { "Text", "Confidence", "Frames", "Segments", }); + internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingFrame_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingFrame_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingFrame_descriptor, + new java.lang.String[] { "NormalizedBoundingBox", "TimeOffset", }); + internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingAnnotation_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingAnnotation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_videointelligence_v1p2beta1_ObjectTrackingAnnotation_descriptor, + new java.lang.String[] { "Entity", "Confidence", "Frames", "Segment", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoSegment.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoSegment.java new file mode 100644 index 000000000000..64cfcbefe426 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoSegment.java @@ -0,0 +1,904 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +/** + *
+ * Video segment.
+ * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.VideoSegment} + */ +public final class VideoSegment extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.videointelligence.v1p2beta1.VideoSegment) + VideoSegmentOrBuilder { +private static final long serialVersionUID = 0L; + // Use VideoSegment.newBuilder() to construct. + private VideoSegment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private VideoSegment() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private VideoSegment( + 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: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (startTimeOffset_ != null) { + subBuilder = startTimeOffset_.toBuilder(); + } + startTimeOffset_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTimeOffset_); + startTimeOffset_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (endTimeOffset_ != null) { + subBuilder = endTimeOffset_.toBuilder(); + } + endTimeOffset_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTimeOffset_); + endTimeOffset_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.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.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoSegment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoSegment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.class, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder.class); + } + + public static final int START_TIME_OFFSET_FIELD_NUMBER = 1; + private com.google.protobuf.Duration startTimeOffset_; + /** + *
+   * Time-offset, relative to the beginning of the video,
+   * corresponding to the start of the segment (inclusive).
+   * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + public boolean hasStartTimeOffset() { + return startTimeOffset_ != null; + } + /** + *
+   * Time-offset, relative to the beginning of the video,
+   * corresponding to the start of the segment (inclusive).
+   * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + public com.google.protobuf.Duration getStartTimeOffset() { + return startTimeOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTimeOffset_; + } + /** + *
+   * Time-offset, relative to the beginning of the video,
+   * corresponding to the start of the segment (inclusive).
+   * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + public com.google.protobuf.DurationOrBuilder getStartTimeOffsetOrBuilder() { + return getStartTimeOffset(); + } + + public static final int END_TIME_OFFSET_FIELD_NUMBER = 2; + private com.google.protobuf.Duration endTimeOffset_; + /** + *
+   * Time-offset, relative to the beginning of the video,
+   * corresponding to the end of the segment (inclusive).
+   * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + public boolean hasEndTimeOffset() { + return endTimeOffset_ != null; + } + /** + *
+   * Time-offset, relative to the beginning of the video,
+   * corresponding to the end of the segment (inclusive).
+   * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + public com.google.protobuf.Duration getEndTimeOffset() { + return endTimeOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTimeOffset_; + } + /** + *
+   * Time-offset, relative to the beginning of the video,
+   * corresponding to the end of the segment (inclusive).
+   * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + public com.google.protobuf.DurationOrBuilder getEndTimeOffsetOrBuilder() { + return getEndTimeOffset(); + } + + 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 (startTimeOffset_ != null) { + output.writeMessage(1, getStartTimeOffset()); + } + if (endTimeOffset_ != null) { + output.writeMessage(2, getEndTimeOffset()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (startTimeOffset_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getStartTimeOffset()); + } + if (endTimeOffset_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getEndTimeOffset()); + } + 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.videointelligence.v1p2beta1.VideoSegment)) { + return super.equals(obj); + } + com.google.cloud.videointelligence.v1p2beta1.VideoSegment other = (com.google.cloud.videointelligence.v1p2beta1.VideoSegment) obj; + + boolean result = true; + result = result && (hasStartTimeOffset() == other.hasStartTimeOffset()); + if (hasStartTimeOffset()) { + result = result && getStartTimeOffset() + .equals(other.getStartTimeOffset()); + } + result = result && (hasEndTimeOffset() == other.hasEndTimeOffset()); + if (hasEndTimeOffset()) { + result = result && getEndTimeOffset() + .equals(other.getEndTimeOffset()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStartTimeOffset()) { + hash = (37 * hash) + START_TIME_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getStartTimeOffset().hashCode(); + } + if (hasEndTimeOffset()) { + hash = (37 * hash) + END_TIME_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getEndTimeOffset().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.videointelligence.v1p2beta1.VideoSegment parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoSegment 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.videointelligence.v1p2beta1.VideoSegment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoSegment 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.videointelligence.v1p2beta1.VideoSegment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoSegment parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoSegment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoSegment 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.videointelligence.v1p2beta1.VideoSegment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoSegment 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.videointelligence.v1p2beta1.VideoSegment parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.cloud.videointelligence.v1p2beta1.VideoSegment 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.videointelligence.v1p2beta1.VideoSegment 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; + } + /** + *
+   * Video segment.
+   * 
+ * + * Protobuf type {@code google.cloud.videointelligence.v1p2beta1.VideoSegment} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.cloud.videointelligence.v1p2beta1.VideoSegment) + com.google.cloud.videointelligence.v1p2beta1.VideoSegmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoSegment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoSegment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.videointelligence.v1p2beta1.VideoSegment.class, com.google.cloud.videointelligence.v1p2beta1.VideoSegment.Builder.class); + } + + // Construct using com.google.cloud.videointelligence.v1p2beta1.VideoSegment.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(); + if (startTimeOffsetBuilder_ == null) { + startTimeOffset_ = null; + } else { + startTimeOffset_ = null; + startTimeOffsetBuilder_ = null; + } + if (endTimeOffsetBuilder_ == null) { + endTimeOffset_ = null; + } else { + endTimeOffset_ = null; + endTimeOffsetBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceProto.internal_static_google_cloud_videointelligence_v1p2beta1_VideoSegment_descriptor; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment getDefaultInstanceForType() { + return com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment build() { + com.google.cloud.videointelligence.v1p2beta1.VideoSegment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.videointelligence.v1p2beta1.VideoSegment buildPartial() { + com.google.cloud.videointelligence.v1p2beta1.VideoSegment result = new com.google.cloud.videointelligence.v1p2beta1.VideoSegment(this); + if (startTimeOffsetBuilder_ == null) { + result.startTimeOffset_ = startTimeOffset_; + } else { + result.startTimeOffset_ = startTimeOffsetBuilder_.build(); + } + if (endTimeOffsetBuilder_ == null) { + result.endTimeOffset_ = endTimeOffset_; + } else { + result.endTimeOffset_ = endTimeOffsetBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.videointelligence.v1p2beta1.VideoSegment) { + return mergeFrom((com.google.cloud.videointelligence.v1p2beta1.VideoSegment)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.videointelligence.v1p2beta1.VideoSegment other) { + if (other == com.google.cloud.videointelligence.v1p2beta1.VideoSegment.getDefaultInstance()) return this; + if (other.hasStartTimeOffset()) { + mergeStartTimeOffset(other.getStartTimeOffset()); + } + if (other.hasEndTimeOffset()) { + mergeEndTimeOffset(other.getEndTimeOffset()); + } + 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.videointelligence.v1p2beta1.VideoSegment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.videointelligence.v1p2beta1.VideoSegment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Duration startTimeOffset_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> startTimeOffsetBuilder_; + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the start of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + public boolean hasStartTimeOffset() { + return startTimeOffsetBuilder_ != null || startTimeOffset_ != null; + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the start of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + public com.google.protobuf.Duration getStartTimeOffset() { + if (startTimeOffsetBuilder_ == null) { + return startTimeOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : startTimeOffset_; + } else { + return startTimeOffsetBuilder_.getMessage(); + } + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the start of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + public Builder setStartTimeOffset(com.google.protobuf.Duration value) { + if (startTimeOffsetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTimeOffset_ = value; + onChanged(); + } else { + startTimeOffsetBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the start of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + public Builder setStartTimeOffset( + com.google.protobuf.Duration.Builder builderForValue) { + if (startTimeOffsetBuilder_ == null) { + startTimeOffset_ = builderForValue.build(); + onChanged(); + } else { + startTimeOffsetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the start of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + public Builder mergeStartTimeOffset(com.google.protobuf.Duration value) { + if (startTimeOffsetBuilder_ == null) { + if (startTimeOffset_ != null) { + startTimeOffset_ = + com.google.protobuf.Duration.newBuilder(startTimeOffset_).mergeFrom(value).buildPartial(); + } else { + startTimeOffset_ = value; + } + onChanged(); + } else { + startTimeOffsetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the start of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + public Builder clearStartTimeOffset() { + if (startTimeOffsetBuilder_ == null) { + startTimeOffset_ = null; + onChanged(); + } else { + startTimeOffset_ = null; + startTimeOffsetBuilder_ = null; + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the start of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + public com.google.protobuf.Duration.Builder getStartTimeOffsetBuilder() { + + onChanged(); + return getStartTimeOffsetFieldBuilder().getBuilder(); + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the start of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + public com.google.protobuf.DurationOrBuilder getStartTimeOffsetOrBuilder() { + if (startTimeOffsetBuilder_ != null) { + return startTimeOffsetBuilder_.getMessageOrBuilder(); + } else { + return startTimeOffset_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : startTimeOffset_; + } + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the start of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getStartTimeOffsetFieldBuilder() { + if (startTimeOffsetBuilder_ == null) { + startTimeOffsetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getStartTimeOffset(), + getParentForChildren(), + isClean()); + startTimeOffset_ = null; + } + return startTimeOffsetBuilder_; + } + + private com.google.protobuf.Duration endTimeOffset_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> endTimeOffsetBuilder_; + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the end of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + public boolean hasEndTimeOffset() { + return endTimeOffsetBuilder_ != null || endTimeOffset_ != null; + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the end of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + public com.google.protobuf.Duration getEndTimeOffset() { + if (endTimeOffsetBuilder_ == null) { + return endTimeOffset_ == null ? com.google.protobuf.Duration.getDefaultInstance() : endTimeOffset_; + } else { + return endTimeOffsetBuilder_.getMessage(); + } + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the end of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + public Builder setEndTimeOffset(com.google.protobuf.Duration value) { + if (endTimeOffsetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTimeOffset_ = value; + onChanged(); + } else { + endTimeOffsetBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the end of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + public Builder setEndTimeOffset( + com.google.protobuf.Duration.Builder builderForValue) { + if (endTimeOffsetBuilder_ == null) { + endTimeOffset_ = builderForValue.build(); + onChanged(); + } else { + endTimeOffsetBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the end of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + public Builder mergeEndTimeOffset(com.google.protobuf.Duration value) { + if (endTimeOffsetBuilder_ == null) { + if (endTimeOffset_ != null) { + endTimeOffset_ = + com.google.protobuf.Duration.newBuilder(endTimeOffset_).mergeFrom(value).buildPartial(); + } else { + endTimeOffset_ = value; + } + onChanged(); + } else { + endTimeOffsetBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the end of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + public Builder clearEndTimeOffset() { + if (endTimeOffsetBuilder_ == null) { + endTimeOffset_ = null; + onChanged(); + } else { + endTimeOffset_ = null; + endTimeOffsetBuilder_ = null; + } + + return this; + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the end of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + public com.google.protobuf.Duration.Builder getEndTimeOffsetBuilder() { + + onChanged(); + return getEndTimeOffsetFieldBuilder().getBuilder(); + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the end of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + public com.google.protobuf.DurationOrBuilder getEndTimeOffsetOrBuilder() { + if (endTimeOffsetBuilder_ != null) { + return endTimeOffsetBuilder_.getMessageOrBuilder(); + } else { + return endTimeOffset_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : endTimeOffset_; + } + } + /** + *
+     * Time-offset, relative to the beginning of the video,
+     * corresponding to the end of the segment (inclusive).
+     * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getEndTimeOffsetFieldBuilder() { + if (endTimeOffsetBuilder_ == null) { + endTimeOffsetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getEndTimeOffset(), + getParentForChildren(), + isClean()); + endTimeOffset_ = null; + } + return endTimeOffsetBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(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.videointelligence.v1p2beta1.VideoSegment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.VideoSegment) + private static final com.google.cloud.videointelligence.v1p2beta1.VideoSegment DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.cloud.videointelligence.v1p2beta1.VideoSegment(); + } + + public static com.google.cloud.videointelligence.v1p2beta1.VideoSegment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VideoSegment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VideoSegment(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.videointelligence.v1p2beta1.VideoSegment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoSegmentOrBuilder.java b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoSegmentOrBuilder.java new file mode 100644 index 000000000000..39461c4353eb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoSegmentOrBuilder.java @@ -0,0 +1,65 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/videointelligence/v1p2beta1/video_intelligence.proto + +package com.google.cloud.videointelligence.v1p2beta1; + +public interface VideoSegmentOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.cloud.videointelligence.v1p2beta1.VideoSegment) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Time-offset, relative to the beginning of the video,
+   * corresponding to the start of the segment (inclusive).
+   * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + boolean hasStartTimeOffset(); + /** + *
+   * Time-offset, relative to the beginning of the video,
+   * corresponding to the start of the segment (inclusive).
+   * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + com.google.protobuf.Duration getStartTimeOffset(); + /** + *
+   * Time-offset, relative to the beginning of the video,
+   * corresponding to the start of the segment (inclusive).
+   * 
+ * + * .google.protobuf.Duration start_time_offset = 1; + */ + com.google.protobuf.DurationOrBuilder getStartTimeOffsetOrBuilder(); + + /** + *
+   * Time-offset, relative to the beginning of the video,
+   * corresponding to the end of the segment (inclusive).
+   * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + boolean hasEndTimeOffset(); + /** + *
+   * Time-offset, relative to the beginning of the video,
+   * corresponding to the end of the segment (inclusive).
+   * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + com.google.protobuf.Duration getEndTimeOffset(); + /** + *
+   * Time-offset, relative to the beginning of the video,
+   * corresponding to the end of the segment (inclusive).
+   * 
+ * + * .google.protobuf.Duration end_time_offset = 2; + */ + com.google.protobuf.DurationOrBuilder getEndTimeOffsetOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/proto/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/proto/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto new file mode 100644 index 000000000000..2c1af2efddd7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-video-intelligence-v1p2beta1/src/main/proto/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto @@ -0,0 +1,466 @@ +// Copyright 2018 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 +// +// http://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. +// + +syntax = "proto3"; + +package google.cloud.videointelligence.v1p2beta1; + +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.VideoIntelligence.V1P2Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p2beta1;videointelligence"; +option java_multiple_files = true; +option java_outer_classname = "VideoIntelligenceServiceProto"; +option java_package = "com.google.cloud.videointelligence.v1p2beta1"; +option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1p2beta1"; + + +// Service that implements Google Cloud Video Intelligence API. +service VideoIntelligenceService { + // Performs asynchronous video annotation. Progress and results can be + // retrieved through the `google.longrunning.Operations` interface. + // `Operation.metadata` contains `AnnotateVideoProgress` (progress). + // `Operation.response` contains `AnnotateVideoResponse` (results). + rpc AnnotateVideo(AnnotateVideoRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p2beta1/videos:annotate" + body: "*" + }; + } +} + +// Video annotation request. +message AnnotateVideoRequest { + // 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. + string input_uri = 1; + + // The video data bytes. + // If unset, the input video(s) should be specified via `input_uri`. + // If set, `input_uri` should be unset. + bytes input_content = 6; + + // Requested video annotation features. + repeated Feature features = 2; + + // Additional video context and/or feature-specific parameters. + VideoContext video_context = 3; + + // 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). + string output_uri = 4; + + // 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. + string location_id = 5; +} + +// Video context and/or feature-specific parameters. +message VideoContext { + // Video segments to annotate. The segments may overlap and are not required + // to be contiguous or span the whole video. If unspecified, each video is + // treated as a single segment. + repeated VideoSegment segments = 1; + + // Config for LABEL_DETECTION. + LabelDetectionConfig label_detection_config = 2; + + // Config for SHOT_CHANGE_DETECTION. + ShotChangeDetectionConfig shot_change_detection_config = 3; + + // Config for EXPLICIT_CONTENT_DETECTION. + ExplicitContentDetectionConfig explicit_content_detection_config = 4; + + // Config for TEXT_DETECTION. + TextDetectionConfig text_detection_config = 8; +} + +// Config for LABEL_DETECTION. +message LabelDetectionConfig { + // What labels should be detected with LABEL_DETECTION, in addition to + // video-level labels or segment-level labels. + // If unspecified, defaults to `SHOT_MODE`. + LabelDetectionMode label_detection_mode = 1; + + // Whether the video has been shot from a stationary (i.e. non-moving) camera. + // When set to true, might improve detection accuracy for moving objects. + // Should be used with `SHOT_AND_FRAME_MODE` enabled. + bool stationary_camera = 2; + + // Model to use for label detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 3; +} + +// Config for SHOT_CHANGE_DETECTION. +message ShotChangeDetectionConfig { + // Model to use for shot change detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for EXPLICIT_CONTENT_DETECTION. +message ExplicitContentDetectionConfig { + // Model to use for explicit content detection. + // Supported values: "builtin/stable" (the default if unset) and + // "builtin/latest". + string model = 1; +} + +// Config for TEXT_DETECTION. +message TextDetectionConfig { + // Language hint can be specified if the language to be detected is known a + // priori. It can increase the accuracy of the detection. Language hint must + // be language code in BCP-47 format. + // + // Automatic language detection is performed if no hint is provided. + repeated string language_hints = 1; +} + +// Video segment. +message VideoSegment { + // Time-offset, relative to the beginning of the video, + // corresponding to the start of the segment (inclusive). + google.protobuf.Duration start_time_offset = 1; + + // Time-offset, relative to the beginning of the video, + // corresponding to the end of the segment (inclusive). + google.protobuf.Duration end_time_offset = 2; +} + +// Video segment level annotation results for label detection. +message LabelSegment { + // Video segment where a label was detected. + VideoSegment segment = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; +} + +// Video frame level annotation results for label detection. +message LabelFrame { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + google.protobuf.Duration time_offset = 1; + + // Confidence that the label is accurate. Range: [0, 1]. + float confidence = 2; +} + +// Detected entity from video analysis. +message Entity { + // Opaque entity ID. Some IDs may be available in + // [Google Knowledge Graph Search + // API](https://developers.google.com/knowledge-graph/). + string entity_id = 1; + + // Textual description, e.g. `Fixed-gear bicycle`. + string description = 2; + + // Language code for `description` in BCP-47 format. + string language_code = 3; +} + +// Label annotation. +message LabelAnnotation { + // Detected entity. + Entity entity = 1; + + // Common categories for the detected entity. + // E.g. when the label is `Terrier` the category is likely `dog`. And in some + // cases there might be more than one categories e.g. `Terrier` could also be + // a `pet`. + repeated Entity category_entities = 2; + + // All video segments where a label was detected. + repeated LabelSegment segments = 3; + + // All video frames where a label was detected. + repeated LabelFrame frames = 4; +} + +// Video frame level annotation results for explicit content. +message ExplicitContentFrame { + // Time-offset, relative to the beginning of the video, corresponding to the + // video frame for this location. + google.protobuf.Duration time_offset = 1; + + // Likelihood of the pornography content.. + Likelihood pornography_likelihood = 2; +} + +// Explicit content annotation (based on per-frame visual signals only). +// If no explicit content has been detected in a frame, no annotations are +// present for that frame. +message ExplicitContentAnnotation { + // All video frames where explicit content was detected. + repeated ExplicitContentFrame frames = 1; +} + +// Normalized bounding box. +// The normalized vertex coordinates are relative to the original image. +// Range: [0, 1]. +message NormalizedBoundingBox { + // Left X coordinate. + float left = 1; + + // Top Y coordinate. + float top = 2; + + // Right X coordinate. + float right = 3; + + // Bottom Y coordinate. + float bottom = 4; +} + +// Annotation results for a single video. +message VideoAnnotationResults { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Label annotations on video level or user specified segment level. + // There is exactly one element for each unique label. + repeated LabelAnnotation segment_label_annotations = 2; + + // Label annotations on shot level. + // There is exactly one element for each unique label. + repeated LabelAnnotation shot_label_annotations = 3; + + // Label annotations on frame level. + // There is exactly one element for each unique label. + repeated LabelAnnotation frame_label_annotations = 4; + + // Shot annotations. Each shot is represented as a video segment. + repeated VideoSegment shot_annotations = 6; + + // Explicit content annotation. + ExplicitContentAnnotation explicit_annotation = 7; + + // OCR text detection and tracking. + // Annotations for list of detected text snippets. Each will have list of + // frame information associated with it. + repeated TextAnnotation text_annotations = 12; + + // Annotations for list of objects detected and tracked in video. + repeated ObjectTrackingAnnotation object_annotations = 14; + + // If set, indicates an error. Note that for a single `AnnotateVideoRequest` + // some videos may succeed and some may fail. + google.rpc.Status error = 9; +} + +// Video annotation response. Included in the `response` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoResponse { + // Annotation results for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationResults annotation_results = 1; +} + +// Annotation progress for a single video. +message VideoAnnotationProgress { + // Video file location in + // [Google Cloud Storage](https://cloud.google.com/storage/). + string input_uri = 1; + + // Approximate percentage processed thus far. Guaranteed to be + // 100 when fully processed. + int32 progress_percent = 2; + + // Time when the request was received. + google.protobuf.Timestamp start_time = 3; + + // Time of the most recent update. + google.protobuf.Timestamp update_time = 4; +} + +// Video annotation progress. Included in the `metadata` +// field of the `Operation` returned by the `GetOperation` +// call of the `google::longrunning::Operations` service. +message AnnotateVideoProgress { + // Progress metadata for all videos specified in `AnnotateVideoRequest`. + repeated VideoAnnotationProgress annotation_progress = 1; +} + +// A vertex represents a 2D point in the image. +// NOTE: the normalized vertex coordinates are relative to the original image +// and range from 0 to 1. +message NormalizedVertex { + // X coordinate. + float x = 1; + + // Y coordinate. + float y = 2; +} + +// Normalized bounding polygon for text (that might not be aligned with axis). +// Contains list of the corner points in clockwise order starting from +// top-left corner. For example, for a rectangular bounding box: +// When the text is horizontal it might look like: +// 0----1 +// | | +// 3----2 +// +// When it's clockwise rotated 180 degrees around the top-left corner it +// becomes: +// 2----3 +// | | +// 1----0 +// +// and the vertex order will still be (0, 1, 2, 3). Note that values can be less +// than 0, or greater than 1 due to trignometric calculations for location of +// the box. +message NormalizedBoundingPoly { + // Normalized vertices of the bounding polygon. + repeated NormalizedVertex vertices = 1; +} + +// Video segment level annotation results for text detection. +message TextSegment { + // Video segment where a text snippet was detected. + VideoSegment segment = 1; +} + +// Video frame level annotation results for text annotation (OCR). +// Contains information regarding timestamp and bounding box locations for the +// frames containing detected OCR text snippets. +message TextFrame { + // Bounding polygon of the detected text for this frame. + NormalizedBoundingPoly rotated_bounding_box = 1; + + // Timestamp of this frame. + google.protobuf.Duration time_offset = 2; +} + +// Annotations related to one detected OCR text snippet. This will contain the +// corresponding text, confidence value, and frame level information for each +// detection. +message TextAnnotation { + // The detected text. + string text = 1; + + // Confidence for the track of detected text. It is calculated as the highest + // over all frames where OCR detected text appears. + float confidence = 2; + + // Information related to the frames where OCR detected text appears. + repeated TextFrame frames = 3; + + // All video segments where OCR detected text appears. + repeated TextSegment segments = 4; +} + +// Video frame level annotations for object detection and tracking. This field +// stores per frame location, time offset, and confidence. +message ObjectTrackingFrame { + // The normalized bounding box location of this object track for the frame. + NormalizedBoundingBox normalized_bounding_box = 1; + + // The timestamp of the frame in microseconds. + google.protobuf.Duration time_offset = 2; +} + +// Annotations corresponding to one tracked object. +message ObjectTrackingAnnotation { + // Entity to specify the object category that this track is labeled as. + Entity entity = 1; + + // Object category's labeling confidence of this track. + float confidence = 4; + + // Information corresponding to all frames where this object track appears. + repeated ObjectTrackingFrame frames = 2; + + // Each object track corresponds to one video segment where it appears. + VideoSegment segment = 3; +} + +// Video annotation feature. +enum Feature { + // Unspecified. + FEATURE_UNSPECIFIED = 0; + + // Label detection. Detect objects, such as dog or flower. + LABEL_DETECTION = 1; + + // Shot change detection. + SHOT_CHANGE_DETECTION = 2; + + // Explicit content detection. + EXPLICIT_CONTENT_DETECTION = 3; + + // OCR text detection and tracking. + TEXT_DETECTION = 7; + + // Object detection and tracking. + OBJECT_TRACKING = 9; +} + +// Label detection mode. +enum LabelDetectionMode { + // Unspecified. + LABEL_DETECTION_MODE_UNSPECIFIED = 0; + + // Detect shot-level labels. + SHOT_MODE = 1; + + // Detect frame-level labels. + FRAME_MODE = 2; + + // Detect both shot-level and frame-level labels. + SHOT_AND_FRAME_MODE = 3; +} + +// Bucketized representation of likelihood. +enum Likelihood { + // Unspecified likelihood. + LIKELIHOOD_UNSPECIFIED = 0; + + // Very unlikely. + VERY_UNLIKELY = 1; + + // Unlikely. + UNLIKELY = 2; + + // Possible. + POSSIBLE = 3; + + // Likely. + LIKELY = 4; + + // Very likely. + VERY_LIKELY = 5; +} diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index 6b032e422be1..df19dd00b803 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -747,6 +747,16 @@ grpc-google-cloud-redis-v1beta1 0.26.1-SNAPSHOT
+ + com.google.api.grpc + proto-google-cloud-redis-v1 + 0.26.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-redis-v1 + 0.26.1-SNAPSHOT + com.google.cloud google-cloud-resourcemanager @@ -1057,6 +1067,16 @@ grpc-google-cloud-video-intelligence-v1p1beta1 0.26.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-video-intelligence-v1p2beta1 + 0.26.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-video-intelligence-v1p2beta1 + 0.26.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-iot-v1 diff --git a/google-cloud-clients/google-cloud-redis/pom.xml b/google-cloud-clients/google-cloud-redis/pom.xml index 806b41510396..326ebd48d63d 100644 --- a/google-cloud-clients/google-cloud-redis/pom.xml +++ b/google-cloud-clients/google-cloud-redis/pom.xml @@ -34,6 +34,14 @@ com.google.api.grpc grpc-google-cloud-redis-v1beta1 + + com.google.api.grpc + proto-google-cloud-redis-v1 + + + com.google.api.grpc + grpc-google-cloud-redis-v1 + io.grpc grpc-netty-shaded diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisClient.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisClient.java new file mode 100644 index 000000000000..117c4ab91338 --- /dev/null +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisClient.java @@ -0,0 +1,1080 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.redis.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.redis.v1.stub.CloudRedisStub; +import com.google.cloud.redis.v1.stub.CloudRedisStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Configures and manages Cloud Memorystore for Redis instances + * + *

Google Cloud Memorystore for Redis v1 + * + *

The `redis.googleapis.com` service implements the Google Cloud Memorystore for Redis API and + * defines the following resource model for managing Redis instances: * The service works with a + * collection of cloud projects, named: `/projects/*` * Each project has a collection of + * available locations, named: `/locations/*` * Each location has a collection of Redis + * instances, named: `/instances/*` * As such, Redis instances are resources of the form: + * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * + *

Note that location_id must be refering to a GCP `region`; for example: * + * `projects/redpepper-1290/locations/us-central1/instances/my-redis` + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+ *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ *   Instance response = cloudRedisClient.getInstance(name);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the cloudRedisClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of CloudRedisSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * CloudRedisSettings cloudRedisSettings =
+ *     CloudRedisSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudRedisClient cloudRedisClient =
+ *     CloudRedisClient.create(cloudRedisSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * CloudRedisSettings cloudRedisSettings =
+ *     CloudRedisSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudRedisClient cloudRedisClient =
+ *     CloudRedisClient.create(cloudRedisSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class CloudRedisClient implements BackgroundResource { + private final CloudRedisSettings settings; + private final CloudRedisStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of CloudRedisClient with default settings. */ + public static final CloudRedisClient create() throws IOException { + return create(CloudRedisSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudRedisClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final CloudRedisClient create(CloudRedisSettings settings) throws IOException { + return new CloudRedisClient(settings); + } + + /** + * Constructs an instance of CloudRedisClient, using the given stub for making calls. This is for + * advanced usage - prefer to use CloudRedisSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final CloudRedisClient create(CloudRedisStub stub) { + return new CloudRedisClient(stub); + } + + /** + * Constructs an instance of CloudRedisClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected CloudRedisClient(CloudRedisSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CloudRedisStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected CloudRedisClient(CloudRedisStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final CloudRedisSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CloudRedisStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all Redis instances owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: * + * `projects/{project_id}/locations/{location_id}` + * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Instance element : cloudRedisClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(LocationName parent) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all Redis instances owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: * + * `projects/{project_id}/locations/{location_id}` + * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Instance element : cloudRedisClient.listInstances(parent.toString()).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(String parent) { + ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all Redis instances owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: * + * `projects/{project_id}/locations/{location_id}` + * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListInstancesRequest request = ListInstancesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Instance element : cloudRedisClient.listInstances(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 ListInstancesPagedResponse listInstances(ListInstancesRequest request) { + return listInstancesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all Redis instances owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: * + * `projects/{project_id}/locations/{location_id}` + * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListInstancesRequest request = ListInstancesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListInstancesPagedResponse> future = cloudRedisClient.listInstancesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Instance element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listInstancesPagedCallable() { + return stub.listInstancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists all Redis instances owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: * + * `projects/{project_id}/locations/{location_id}` + * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   ListInstancesRequest request = ListInstancesRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListInstancesResponse response = cloudRedisClient.listInstancesCallable().call(request);
+   *     for (Instance element : response.getInstancesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listInstancesCallable() { + return stub.listInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the details of a specific Redis instance. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   Instance response = cloudRedisClient.getInstance(name);
+   * }
+   * 
+ * + * @param name Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` + * refers to a GCP region + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(InstanceName name) { + + GetInstanceRequest request = + GetInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the details of a specific Redis instance. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   Instance response = cloudRedisClient.getInstance(name.toString());
+   * }
+   * 
+ * + * @param name Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` + * refers to a GCP region + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(String name) { + + GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the details of a specific Redis instance. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   GetInstanceRequest request = GetInstanceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Instance response = cloudRedisClient.getInstance(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 + */ + private final Instance getInstance(GetInstanceRequest request) { + return getInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the details of a specific Redis instance. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   GetInstanceRequest request = GetInstanceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Instance> future = cloudRedisClient.getInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Instance response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getInstanceCallable() { + return stub.getInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Redis instance based on the specified tier and memory size. + * + *

By default, the instance is accessible from the project's [default + * network](/compute/docs/networks-and-firewalls#networks). + * + *

The creation is executed asynchronously and callers may check the returned operation to + * track its progress. Once the operation is completed the Redis instance will be fully + * functional. Completed longrunning.Operation will contain the new instance object in the + * response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   String instanceId = "test_instance";
+   *   Instance.Tier tier = Instance.Tier.BASIC;
+   *   int memorySizeGb = 1;
+   *   Instance instance = Instance.newBuilder()
+   *     .setTier(tier)
+   *     .setMemorySizeGb(memorySizeGb)
+   *     .build();
+   *   Instance response = cloudRedisClient.createInstanceAsync(parent, instanceId, instance).get();
+   * }
+   * 
+ * + * @param parent Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region + * @param instanceId Required. The logical name of the Redis instance in the customer project with + * the following restrictions: + *

* Must contain only lowercase letters, numbers, and hyphens. * Must start with a + * letter. * Must be between 1-40 characters. * Must end with a number or a letter. + * * Must be unique within the customer project / location + * @param instance Required. A Redis [Instance] resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createInstanceAsync( + LocationName parent, String instanceId, Instance instance) { + + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInstanceId(instanceId) + .setInstance(instance) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Redis instance based on the specified tier and memory size. + * + *

By default, the instance is accessible from the project's [default + * network](/compute/docs/networks-and-firewalls#networks). + * + *

The creation is executed asynchronously and callers may check the returned operation to + * track its progress. Once the operation is completed the Redis instance will be fully + * functional. Completed longrunning.Operation will contain the new instance object in the + * response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   String instanceId = "test_instance";
+   *   Instance.Tier tier = Instance.Tier.BASIC;
+   *   int memorySizeGb = 1;
+   *   Instance instance = Instance.newBuilder()
+   *     .setTier(tier)
+   *     .setMemorySizeGb(memorySizeGb)
+   *     .build();
+   *   Instance response = cloudRedisClient.createInstanceAsync(parent.toString(), instanceId, instance).get();
+   * }
+   * 
+ * + * @param parent Required. The resource name of the instance location using the form: + * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region + * @param instanceId Required. The logical name of the Redis instance in the customer project with + * the following restrictions: + *

* Must contain only lowercase letters, numbers, and hyphens. * Must start with a + * letter. * Must be between 1-40 characters. * Must end with a number or a letter. + * * Must be unique within the customer project / location + * @param instance Required. A Redis [Instance] resource + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createInstanceAsync( + String parent, String instanceId, Instance instance) { + + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent) + .setInstanceId(instanceId) + .setInstance(instance) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Redis instance based on the specified tier and memory size. + * + *

By default, the instance is accessible from the project's [default + * network](/compute/docs/networks-and-firewalls#networks). + * + *

The creation is executed asynchronously and callers may check the returned operation to + * track its progress. Once the operation is completed the Redis instance will be fully + * functional. Completed longrunning.Operation will contain the new instance object in the + * response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   String instanceId = "test_instance";
+   *   Instance.Tier tier = Instance.Tier.BASIC;
+   *   int memorySizeGb = 1;
+   *   Instance instance = Instance.newBuilder()
+   *     .setTier(tier)
+   *     .setMemorySizeGb(memorySizeGb)
+   *     .build();
+   *   CreateInstanceRequest request = CreateInstanceRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setInstanceId(instanceId)
+   *     .setInstance(instance)
+   *     .build();
+   *   Instance response = cloudRedisClient.createInstanceAsync(request).get();
+   * }
+   * 
+ * + * @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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture createInstanceAsync( + CreateInstanceRequest request) { + return createInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Redis instance based on the specified tier and memory size. + * + *

By default, the instance is accessible from the project's [default + * network](/compute/docs/networks-and-firewalls#networks). + * + *

The creation is executed asynchronously and callers may check the returned operation to + * track its progress. Once the operation is completed the Redis instance will be fully + * functional. Completed longrunning.Operation will contain the new instance object in the + * response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   String instanceId = "test_instance";
+   *   Instance.Tier tier = Instance.Tier.BASIC;
+   *   int memorySizeGb = 1;
+   *   Instance instance = Instance.newBuilder()
+   *     .setTier(tier)
+   *     .setMemorySizeGb(memorySizeGb)
+   *     .build();
+   *   CreateInstanceRequest request = CreateInstanceRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setInstanceId(instanceId)
+   *     .setInstance(instance)
+   *     .build();
+   *   OperationFuture<Operation> future = cloudRedisClient.createInstanceOperationCallable().futureCall(request);
+   *   // Do something
+   *   Instance response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + createInstanceOperationCallable() { + return stub.createInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a Redis instance based on the specified tier and memory size. + * + *

By default, the instance is accessible from the project's [default + * network](/compute/docs/networks-and-firewalls#networks). + * + *

The creation is executed asynchronously and callers may check the returned operation to + * track its progress. Once the operation is completed the Redis instance will be fully + * functional. Completed longrunning.Operation will contain the new instance object in the + * response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   String instanceId = "test_instance";
+   *   Instance.Tier tier = Instance.Tier.BASIC;
+   *   int memorySizeGb = 1;
+   *   Instance instance = Instance.newBuilder()
+   *     .setTier(tier)
+   *     .setMemorySizeGb(memorySizeGb)
+   *     .build();
+   *   CreateInstanceRequest request = CreateInstanceRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setInstanceId(instanceId)
+   *     .setInstance(instance)
+   *     .build();
+   *   ApiFuture<Operation> future = cloudRedisClient.createInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createInstanceCallable() { + return stub.createInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the metadata and configuration of a specific Redis instance. + * + *

Completed longrunning.Operation will contain the new instance object in the response field. + * The returned operation is automatically deleted after a few hours, so there is no need to call + * DeleteOperation. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   String pathsElement = "display_name";
+   *   String pathsElement2 = "memory_size_gb";
+   *   List<String> paths = Arrays.asList(pathsElement, pathsElement2);
+   *   FieldMask updateMask = FieldMask.newBuilder()
+   *     .addAllPaths(paths)
+   *     .build();
+   *   String displayName = "UpdatedDisplayName";
+   *   int memorySizeGb = 4;
+   *   Instance instance = Instance.newBuilder()
+   *     .setDisplayName(displayName)
+   *     .setMemorySizeGb(memorySizeGb)
+   *     .build();
+   *   Instance response = cloudRedisClient.updateInstanceAsync(updateMask, instance).get();
+   * }
+   * 
+ * + * @param updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these fields from + * [Instance][CloudRedis.Instance]: + *

* `displayName` * `labels` * `memorySizeGb` * `redisConfig` + * @param instance Required. Update description. Only fields specified in update_mask are updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateInstanceAsync( + FieldMask updateMask, Instance instance) { + + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder().setUpdateMask(updateMask).setInstance(instance).build(); + return updateInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the metadata and configuration of a specific Redis instance. + * + *

Completed longrunning.Operation will contain the new instance object in the response field. + * The returned operation is automatically deleted after a few hours, so there is no need to call + * DeleteOperation. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   String pathsElement = "display_name";
+   *   String pathsElement2 = "memory_size_gb";
+   *   List<String> paths = Arrays.asList(pathsElement, pathsElement2);
+   *   FieldMask updateMask = FieldMask.newBuilder()
+   *     .addAllPaths(paths)
+   *     .build();
+   *   String displayName = "UpdatedDisplayName";
+   *   int memorySizeGb = 4;
+   *   Instance instance = Instance.newBuilder()
+   *     .setDisplayName(displayName)
+   *     .setMemorySizeGb(memorySizeGb)
+   *     .build();
+   *   UpdateInstanceRequest request = UpdateInstanceRequest.newBuilder()
+   *     .setUpdateMask(updateMask)
+   *     .setInstance(instance)
+   *     .build();
+   *   Instance response = cloudRedisClient.updateInstanceAsync(request).get();
+   * }
+   * 
+ * + * @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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture updateInstanceAsync( + UpdateInstanceRequest request) { + return updateInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the metadata and configuration of a specific Redis instance. + * + *

Completed longrunning.Operation will contain the new instance object in the response field. + * The returned operation is automatically deleted after a few hours, so there is no need to call + * DeleteOperation. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   String pathsElement = "display_name";
+   *   String pathsElement2 = "memory_size_gb";
+   *   List<String> paths = Arrays.asList(pathsElement, pathsElement2);
+   *   FieldMask updateMask = FieldMask.newBuilder()
+   *     .addAllPaths(paths)
+   *     .build();
+   *   String displayName = "UpdatedDisplayName";
+   *   int memorySizeGb = 4;
+   *   Instance instance = Instance.newBuilder()
+   *     .setDisplayName(displayName)
+   *     .setMemorySizeGb(memorySizeGb)
+   *     .build();
+   *   UpdateInstanceRequest request = UpdateInstanceRequest.newBuilder()
+   *     .setUpdateMask(updateMask)
+   *     .setInstance(instance)
+   *     .build();
+   *   OperationFuture<Operation> future = cloudRedisClient.updateInstanceOperationCallable().futureCall(request);
+   *   // Do something
+   *   Instance response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + updateInstanceOperationCallable() { + return stub.updateInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the metadata and configuration of a specific Redis instance. + * + *

Completed longrunning.Operation will contain the new instance object in the response field. + * The returned operation is automatically deleted after a few hours, so there is no need to call + * DeleteOperation. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   String pathsElement = "display_name";
+   *   String pathsElement2 = "memory_size_gb";
+   *   List<String> paths = Arrays.asList(pathsElement, pathsElement2);
+   *   FieldMask updateMask = FieldMask.newBuilder()
+   *     .addAllPaths(paths)
+   *     .build();
+   *   String displayName = "UpdatedDisplayName";
+   *   int memorySizeGb = 4;
+   *   Instance instance = Instance.newBuilder()
+   *     .setDisplayName(displayName)
+   *     .setMemorySizeGb(memorySizeGb)
+   *     .build();
+   *   UpdateInstanceRequest request = UpdateInstanceRequest.newBuilder()
+   *     .setUpdateMask(updateMask)
+   *     .setInstance(instance)
+   *     .build();
+   *   ApiFuture<Operation> future = cloudRedisClient.updateInstanceCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateInstanceCallable() { + return stub.updateInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a specific Redis instance. Instance stops serving and data is deleted. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   Empty response = cloudRedisClient.deleteInstanceAsync(name).get();
+   * }
+   * 
+ * + * @param name Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` + * refers to a GCP region + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteInstanceAsync(InstanceName name) { + + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a specific Redis instance. Instance stops serving and data is deleted. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   Empty response = cloudRedisClient.deleteInstanceAsync(name.toString()).get();
+   * }
+   * 
+ * + * @param name Required. Redis instance resource name using the form: + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}` where `location_id` + * refers to a GCP region + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture deleteInstanceAsync(String name) { + + DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a specific Redis instance. Instance stops serving and data is deleted. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Empty response = cloudRedisClient.deleteInstanceAsync(request).get();
+   * }
+   * 
+ * + * @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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + private final OperationFuture deleteInstanceAsync( + DeleteInstanceRequest request) { + return deleteInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a specific Redis instance. Instance stops serving and data is deleted. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   OperationFuture<Operation> future = cloudRedisClient.deleteInstanceOperationCallable().futureCall(request);
+   *   // Do something
+   *   Empty response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + deleteInstanceOperationCallable() { + return stub.deleteInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes a specific Redis instance. Instance stops serving and data is deleted. + * + *

Sample code: + * + *


+   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Operation> future = cloudRedisClient.deleteInstanceCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteInstanceCallable() { + return stub.deleteInstanceCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListInstancesPagedResponse + extends AbstractPagedListResponse< + ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage, + ListInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListInstancesPagedResponse apply(ListInstancesPage input) { + return new ListInstancesPagedResponse(input); + } + }); + } + + private ListInstancesPagedResponse(ListInstancesPage page) { + super(page, ListInstancesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListInstancesPage + extends AbstractPage< + ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage> { + + private ListInstancesPage( + PageContext context, + ListInstancesResponse response) { + super(context, response); + } + + private static ListInstancesPage createEmptyPage() { + return new ListInstancesPage(null, null); + } + + @Override + protected ListInstancesPage createPage( + PageContext context, + ListInstancesResponse response) { + return new ListInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage, + ListInstancesFixedSizeCollection> { + + private ListInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstancesFixedSizeCollection createEmptyCollection() { + return new ListInstancesFixedSizeCollection(null, 0); + } + + @Override + protected ListInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstancesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisSettings.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisSettings.java new file mode 100644 index 000000000000..147927b04922 --- /dev/null +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/CloudRedisSettings.java @@ -0,0 +1,270 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.redis.v1; + +import static com.google.cloud.redis.v1.CloudRedisClient.ListInstancesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.redis.v1.stub.CloudRedisStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link CloudRedisClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (redis.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getInstance to 30 seconds: + * + *

+ * 
+ * CloudRedisSettings.Builder cloudRedisSettingsBuilder =
+ *     CloudRedisSettings.newBuilder();
+ * cloudRedisSettingsBuilder.getInstanceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * CloudRedisSettings cloudRedisSettings = cloudRedisSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class CloudRedisSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return ((CloudRedisStubSettings) getStubSettings()).listInstancesSettings(); + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return ((CloudRedisStubSettings) getStubSettings()).getInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return ((CloudRedisStubSettings) getStubSettings()).createInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + createInstanceOperationSettings() { + return ((CloudRedisStubSettings) getStubSettings()).createInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return ((CloudRedisStubSettings) getStubSettings()).updateInstanceSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + updateInstanceOperationSettings() { + return ((CloudRedisStubSettings) getStubSettings()).updateInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return ((CloudRedisStubSettings) getStubSettings()).deleteInstanceSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + deleteInstanceOperationSettings() { + return ((CloudRedisStubSettings) getStubSettings()).deleteInstanceOperationSettings(); + } + + public static final CloudRedisSettings create(CloudRedisStubSettings stub) throws IOException { + return new CloudRedisSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudRedisStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudRedisStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudRedisStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudRedisStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudRedisStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudRedisStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudRedisStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudRedisSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudRedisSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(CloudRedisStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(CloudRedisStubSettings.newBuilder()); + } + + protected Builder(CloudRedisSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudRedisStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public CloudRedisStubSettings.Builder getStubSettingsBuilder() { + return ((CloudRedisStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return getStubSettingsBuilder().listInstancesSettings(); + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getStubSettingsBuilder().getInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return getStubSettingsBuilder().createInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return getStubSettingsBuilder().createInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return getStubSettingsBuilder().updateInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return getStubSettingsBuilder().updateInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return getStubSettingsBuilder().deleteInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return getStubSettingsBuilder().deleteInstanceOperationSettings(); + } + + @Override + public CloudRedisSettings build() throws IOException { + return new CloudRedisSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/package-info.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/package-info.java new file mode 100644 index 000000000000..0c17f3a67e8d --- /dev/null +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/package-info.java @@ -0,0 +1,49 @@ +/* + * Copyright 2018 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. + */ + +/** + * A client to Google Cloud Memorystore for Redis API. + * + *

The interfaces provided are listed below, along with usage samples. + * + *

================ CloudRedisClient ================ + * + *

Service Description: Configures and manages Cloud Memorystore for Redis instances + * + *

Google Cloud Memorystore for Redis v1 + * + *

The `redis.googleapis.com` service implements the Google Cloud Memorystore for Redis API and + * defines the following resource model for managing Redis instances: * The service works with a + * collection of cloud projects, named: `/projects/*` * Each project has a collection of + * available locations, named: `/locations/*` * Each location has a collection of Redis + * instances, named: `/instances/*` * As such, Redis instances are resources of the form: + * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * + *

Note that location_id must be refering to a GCP `region`; for example: * + * `projects/redpepper-1290/locations/us-central1/instances/my-redis` + * + *

Sample for CloudRedisClient: + * + *

+ * 
+ * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
+ *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ *   Instance response = cloudRedisClient.getInstance(name);
+ * }
+ * 
+ * 
+ */ +package com.google.cloud.redis.v1; diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/CloudRedisStub.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/CloudRedisStub.java new file mode 100644 index 000000000000..796a5a50a900 --- /dev/null +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/CloudRedisStub.java @@ -0,0 +1,97 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.redis.v1.stub; + +import static com.google.cloud.redis.v1.CloudRedisClient.ListInstancesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.redis.v1.CreateInstanceRequest; +import com.google.cloud.redis.v1.DeleteInstanceRequest; +import com.google.cloud.redis.v1.GetInstanceRequest; +import com.google.cloud.redis.v1.Instance; +import com.google.cloud.redis.v1.ListInstancesRequest; +import com.google.cloud.redis.v1.ListInstancesResponse; +import com.google.cloud.redis.v1.OperationMetadata; +import com.google.cloud.redis.v1.UpdateInstanceRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Google Cloud Memorystore for Redis API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class CloudRedisStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public UnaryCallable + listInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesPagedCallable()"); + } + + public UnaryCallable listInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesCallable()"); + } + + public UnaryCallable getInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceOperationCallable()"); + } + + public UnaryCallable createInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceOperationCallable()"); + } + + public UnaryCallable updateInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceCallable()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceOperationCallable()"); + } + + public UnaryCallable deleteInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/CloudRedisStubSettings.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/CloudRedisStubSettings.java new file mode 100644 index 000000000000..0456e15fbf03 --- /dev/null +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/CloudRedisStubSettings.java @@ -0,0 +1,578 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.redis.v1.stub; + +import static com.google.cloud.redis.v1.CloudRedisClient.ListInstancesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.redis.v1.CreateInstanceRequest; +import com.google.cloud.redis.v1.DeleteInstanceRequest; +import com.google.cloud.redis.v1.GetInstanceRequest; +import com.google.cloud.redis.v1.Instance; +import com.google.cloud.redis.v1.ListInstancesRequest; +import com.google.cloud.redis.v1.ListInstancesResponse; +import com.google.cloud.redis.v1.OperationMetadata; +import com.google.cloud.redis.v1.UpdateInstanceRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link CloudRedisStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (redis.googleapis.com) and default port (443) are used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of getInstance to 30 seconds: + * + *

+ * 
+ * CloudRedisStubSettings.Builder cloudRedisSettingsBuilder =
+ *     CloudRedisStubSettings.newBuilder();
+ * cloudRedisSettingsBuilder.getInstanceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * CloudRedisStubSettings cloudRedisSettings = cloudRedisSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class CloudRedisStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final PagedCallSettings< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings getInstanceSettings; + private final UnaryCallSettings createInstanceSettings; + private final OperationCallSettings + createInstanceOperationSettings; + private final UnaryCallSettings updateInstanceSettings; + private final OperationCallSettings + updateInstanceOperationSettings; + private final UnaryCallSettings deleteInstanceSettings; + private final OperationCallSettings + deleteInstanceOperationSettings; + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public CloudRedisStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudRedisStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "redis.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(CloudRedisStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected CloudRedisStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listInstancesSettings = settingsBuilder.listInstancesSettings().build(); + getInstanceSettings = settingsBuilder.getInstanceSettings().build(); + createInstanceSettings = settingsBuilder.createInstanceSettings().build(); + createInstanceOperationSettings = settingsBuilder.createInstanceOperationSettings().build(); + updateInstanceSettings = settingsBuilder.updateInstanceSettings().build(); + updateInstanceOperationSettings = settingsBuilder.updateInstanceOperationSettings().build(); + deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build(); + deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); + } + + private static final PagedListDescriptor + LIST_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) { + return ListInstancesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) { + return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListInstancesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListInstancesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListInstancesResponse payload) { + return payload.getInstancesList(); + } + }; + + private static final PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + LIST_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstancesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context); + return ListInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for CloudRedisStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings.Builder getInstanceSettings; + private final UnaryCallSettings.Builder + createInstanceSettings; + private final OperationCallSettings.Builder + createInstanceOperationSettings; + private final UnaryCallSettings.Builder + updateInstanceSettings; + private final OperationCallSettings.Builder + updateInstanceOperationSettings; + private final UnaryCallSettings.Builder + deleteInstanceSettings; + private final OperationCallSettings.Builder + deleteInstanceOperationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT); + + getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createInstanceOperationSettings = OperationCallSettings.newBuilder(); + + updateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateInstanceOperationSettings = OperationCallSettings.newBuilder(); + + deleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + updateInstanceSettings, + deleteInstanceSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .listInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .createInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(60000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(360000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(1200000L)) + .build())); + builder + .updateInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(60000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(360000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(1200000L)) + .build())); + builder + .deleteInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(60000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(360000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(1200000L)) + .build())); + + return builder; + } + + protected Builder(CloudRedisStubSettings settings) { + super(settings); + + listInstancesSettings = settings.listInstancesSettings.toBuilder(); + getInstanceSettings = settings.getInstanceSettings.toBuilder(); + createInstanceSettings = settings.createInstanceSettings.toBuilder(); + createInstanceOperationSettings = settings.createInstanceOperationSettings.toBuilder(); + updateInstanceSettings = settings.updateInstanceSettings.toBuilder(); + updateInstanceOperationSettings = settings.updateInstanceOperationSettings.toBuilder(); + deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder(); + deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + updateInstanceSettings, + deleteInstanceSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + @Override + public CloudRedisStubSettings build() throws IOException { + return new CloudRedisStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/GrpcCloudRedisCallableFactory.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/GrpcCloudRedisCallableFactory.java new file mode 100644 index 000000000000..84e4dd99a0c0 --- /dev/null +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/GrpcCloudRedisCallableFactory.java @@ -0,0 +1,116 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.redis.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Google Cloud Memorystore for Redis API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcCloudRedisCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/GrpcCloudRedisStub.java b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/GrpcCloudRedisStub.java new file mode 100644 index 000000000000..ce0855f72b60 --- /dev/null +++ b/google-cloud-clients/google-cloud-redis/src/main/java/com/google/cloud/redis/v1/stub/GrpcCloudRedisStub.java @@ -0,0 +1,295 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.redis.v1.stub; + +import static com.google.cloud.redis.v1.CloudRedisClient.ListInstancesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.redis.v1.CreateInstanceRequest; +import com.google.cloud.redis.v1.DeleteInstanceRequest; +import com.google.cloud.redis.v1.GetInstanceRequest; +import com.google.cloud.redis.v1.Instance; +import com.google.cloud.redis.v1.ListInstancesRequest; +import com.google.cloud.redis.v1.ListInstancesResponse; +import com.google.cloud.redis.v1.OperationMetadata; +import com.google.cloud.redis.v1.UpdateInstanceRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Google Cloud Memorystore for Redis API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcCloudRedisStub extends CloudRedisStub { + + private static final MethodDescriptor + listInstancesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.redis.v1.CloudRedis/ListInstances") + .setRequestMarshaller( + ProtoUtils.marshaller(ListInstancesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListInstancesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.redis.v1.CloudRedis/GetInstance") + .setRequestMarshaller(ProtoUtils.marshaller(GetInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Instance.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.redis.v1.CloudRedis/CreateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.redis.v1.CloudRedis/UpdateInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteInstanceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.redis.v1.CloudRedis/DeleteInstance") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteInstanceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable listInstancesCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable updateInstanceCallable; + private final OperationCallable + updateInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final OperationCallable + deleteInstanceOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcCloudRedisStub create(CloudRedisStubSettings settings) + throws IOException { + return new GrpcCloudRedisStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudRedisStub create(ClientContext clientContext) throws IOException { + return new GrpcCloudRedisStub(CloudRedisStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudRedisStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudRedisStub( + CloudRedisStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudRedisStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcCloudRedisStub(CloudRedisStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcCloudRedisCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudRedisStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected GrpcCloudRedisStub( + CloudRedisStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listInstancesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .build(); + GrpcCallSettings getInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .build(); + GrpcCallSettings createInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .build(); + GrpcCallSettings updateInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .build(); + GrpcCallSettings deleteInstanceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .build(); + + this.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + this.operationsStub); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.updateInstanceOperationCallable = + callableFactory.createOperationCallable( + updateInstanceTransportSettings, + settings.updateInstanceOperationSettings(), + clientContext, + this.operationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteInstanceOperationCallable = + callableFactory.createOperationCallable( + deleteInstanceTransportSettings, + settings.deleteInstanceOperationSettings(), + clientContext, + this.operationsStub); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + public UnaryCallable + listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + updateInstanceOperationCallable() { + return updateInstanceOperationCallable; + } + + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + deleteInstanceOperationCallable() { + return deleteInstanceOperationCallable; + } + + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1/CloudRedisClientTest.java b/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1/CloudRedisClientTest.java new file mode 100644 index 000000000000..2975ba212f9f --- /dev/null +++ b/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1/CloudRedisClientTest.java @@ -0,0 +1,411 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.redis.v1; + +import static com.google.cloud.redis.v1.CloudRedisClient.ListInstancesPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.redis.v1.Instance.Tier; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class CloudRedisClientTest { + private static MockCloudRedis mockCloudRedis; + private static MockServiceHelper serviceHelper; + private CloudRedisClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockCloudRedis = new MockCloudRedis(); + serviceHelper = + new MockServiceHelper("in-process-1", Arrays.asList(mockCloudRedis)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + CloudRedisSettings settings = + CloudRedisSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudRedisClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listInstancesTest() { + String nextPageToken = ""; + Instance instancesElement = Instance.newBuilder().build(); + List instances = Arrays.asList(instancesElement); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllInstances(instances) + .build(); + mockCloudRedis.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockCloudRedis.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInstancesRequest actualRequest = (ListInstancesRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listInstancesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudRedis.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getInstanceTest() { + String name2 = "name2-1052831874"; + String displayName = "displayName1615086568"; + String locationId = "locationId552319461"; + String alternativeLocationId = "alternativeLocationId-718920621"; + String redisVersion = "redisVersion-685310444"; + String reservedIpRange = "reservedIpRange-1082940580"; + String host = "host3208616"; + int port = 3446913; + String currentLocationId = "currentLocationId1312712735"; + String statusMessage = "statusMessage-239442758"; + int memorySizeGb = 34199707; + String authorizedNetwork = "authorizedNetwork-1733809270"; + Instance expectedResponse = + Instance.newBuilder() + .setName(name2) + .setDisplayName(displayName) + .setLocationId(locationId) + .setAlternativeLocationId(alternativeLocationId) + .setRedisVersion(redisVersion) + .setReservedIpRange(reservedIpRange) + .setHost(host) + .setPort(port) + .setCurrentLocationId(currentLocationId) + .setStatusMessage(statusMessage) + .setMemorySizeGb(memorySizeGb) + .setAuthorizedNetwork(authorizedNetwork) + .build(); + mockCloudRedis.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudRedis.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInstanceRequest actualRequest = (GetInstanceRequest) actualRequests.get(0); + + Assert.assertEquals(name, InstanceName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudRedis.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createInstanceTest() throws Exception { + String name = "name3373707"; + String displayName = "displayName1615086568"; + String locationId = "locationId552319461"; + String alternativeLocationId = "alternativeLocationId-718920621"; + String redisVersion = "redisVersion-685310444"; + String reservedIpRange = "reservedIpRange-1082940580"; + String host = "host3208616"; + int port = 3446913; + String currentLocationId = "currentLocationId1312712735"; + String statusMessage = "statusMessage-239442758"; + int memorySizeGb2 = 1493816946; + String authorizedNetwork = "authorizedNetwork-1733809270"; + Instance expectedResponse = + Instance.newBuilder() + .setName(name) + .setDisplayName(displayName) + .setLocationId(locationId) + .setAlternativeLocationId(alternativeLocationId) + .setRedisVersion(redisVersion) + .setReservedIpRange(reservedIpRange) + .setHost(host) + .setPort(port) + .setCurrentLocationId(currentLocationId) + .setStatusMessage(statusMessage) + .setMemorySizeGb(memorySizeGb2) + .setAuthorizedNetwork(authorizedNetwork) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudRedis.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String instanceId = "test_instance"; + Instance.Tier tier = Instance.Tier.BASIC; + int memorySizeGb = 1; + Instance instance = Instance.newBuilder().setTier(tier).setMemorySizeGb(memorySizeGb).build(); + + Instance actualResponse = client.createInstanceAsync(parent, instanceId, instance).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudRedis.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateInstanceRequest actualRequest = (CreateInstanceRequest) actualRequests.get(0); + + Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(instanceId, actualRequest.getInstanceId()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudRedis.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String instanceId = "test_instance"; + Instance.Tier tier = Instance.Tier.BASIC; + int memorySizeGb = 1; + Instance instance = Instance.newBuilder().setTier(tier).setMemorySizeGb(memorySizeGb).build(); + + client.createInstanceAsync(parent, instanceId, instance).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void updateInstanceTest() throws Exception { + String name = "name3373707"; + String displayName2 = "displayName21615000987"; + String locationId = "locationId552319461"; + String alternativeLocationId = "alternativeLocationId-718920621"; + String redisVersion = "redisVersion-685310444"; + String reservedIpRange = "reservedIpRange-1082940580"; + String host = "host3208616"; + int port = 3446913; + String currentLocationId = "currentLocationId1312712735"; + String statusMessage = "statusMessage-239442758"; + int memorySizeGb2 = 1493816946; + String authorizedNetwork = "authorizedNetwork-1733809270"; + Instance expectedResponse = + Instance.newBuilder() + .setName(name) + .setDisplayName(displayName2) + .setLocationId(locationId) + .setAlternativeLocationId(alternativeLocationId) + .setRedisVersion(redisVersion) + .setReservedIpRange(reservedIpRange) + .setHost(host) + .setPort(port) + .setCurrentLocationId(currentLocationId) + .setStatusMessage(statusMessage) + .setMemorySizeGb(memorySizeGb2) + .setAuthorizedNetwork(authorizedNetwork) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudRedis.addResponse(resultOperation); + + String pathsElement = "display_name"; + String pathsElement2 = "memory_size_gb"; + List paths = Arrays.asList(pathsElement, pathsElement2); + FieldMask updateMask = FieldMask.newBuilder().addAllPaths(paths).build(); + String displayName = "UpdatedDisplayName"; + int memorySizeGb = 4; + Instance instance = + Instance.newBuilder().setDisplayName(displayName).setMemorySizeGb(memorySizeGb).build(); + + Instance actualResponse = client.updateInstanceAsync(updateMask, instance).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudRedis.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateInstanceRequest actualRequest = (UpdateInstanceRequest) actualRequests.get(0); + + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertEquals(instance, actualRequest.getInstance()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudRedis.addException(exception); + + try { + String pathsElement = "display_name"; + String pathsElement2 = "memory_size_gb"; + List paths = Arrays.asList(pathsElement, pathsElement2); + FieldMask updateMask = FieldMask.newBuilder().addAllPaths(paths).build(); + String displayName = "UpdatedDisplayName"; + int memorySizeGb = 4; + Instance instance = + Instance.newBuilder().setDisplayName(displayName).setMemorySizeGb(memorySizeGb).build(); + + client.updateInstanceAsync(updateMask, instance).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + @SuppressWarnings("all") + public void deleteInstanceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudRedis.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + Empty actualResponse = client.deleteInstanceAsync(name).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudRedis.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteInstanceRequest actualRequest = (DeleteInstanceRequest) actualRequests.get(0); + + Assert.assertEquals(name, InstanceName.parse(actualRequest.getName())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteInstanceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockCloudRedis.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1/MockCloudRedis.java b/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1/MockCloudRedis.java new file mode 100644 index 000000000000..cee6f5f1dbfc --- /dev/null +++ b/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1/MockCloudRedis.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.redis.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockCloudRedis implements MockGrpcService { + private final MockCloudRedisImpl serviceImpl; + + public MockCloudRedis() { + serviceImpl = new MockCloudRedisImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(GeneratedMessageV3 response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1/MockCloudRedisImpl.java b/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1/MockCloudRedisImpl.java new file mode 100644 index 000000000000..0fe2e9c2ae82 --- /dev/null +++ b/google-cloud-clients/google-cloud-redis/src/test/java/com/google/cloud/redis/v1/MockCloudRedisImpl.java @@ -0,0 +1,133 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.redis.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.redis.v1.CloudRedisGrpc.CloudRedisImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockCloudRedisImpl extends CloudRedisImplBase { + private ArrayList requests; + private Queue responses; + + public MockCloudRedisImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(GeneratedMessageV3 response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listInstances( + ListInstancesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListInstancesResponse) { + requests.add(request); + responseObserver.onNext((ListInstancesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getInstance(GetInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Instance) { + requests.add(request); + responseObserver.onNext((Instance) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createInstance( + CreateInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateInstance( + UpdateInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteInstance( + DeleteInstanceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-video-intelligence/pom.xml b/google-cloud-clients/google-cloud-video-intelligence/pom.xml index adff02cc3852..6c1a3deb4a2b 100644 --- a/google-cloud-clients/google-cloud-video-intelligence/pom.xml +++ b/google-cloud-clients/google-cloud-video-intelligence/pom.xml @@ -42,6 +42,10 @@ com.google.api.grpc proto-google-cloud-video-intelligence-v1p1beta1 + + com.google.api.grpc + proto-google-cloud-video-intelligence-v1p2beta1 + io.grpc grpc-netty-shaded @@ -95,6 +99,11 @@ grpc-google-cloud-video-intelligence-v1p1beta1 test + + com.google.api.grpc + grpc-google-cloud-video-intelligence-v1p2beta1 + test + com.google.api gax-grpc diff --git a/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceClient.java b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceClient.java new file mode 100644 index 000000000000..ca2d434d6d88 --- /dev/null +++ b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceClient.java @@ -0,0 +1,328 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.videointelligence.v1p2beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.videointelligence.v1p2beta1.stub.VideoIntelligenceServiceStub; +import com.google.cloud.videointelligence.v1p2beta1.stub.VideoIntelligenceServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service that implements Google Cloud Video Intelligence API. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = VideoIntelligenceServiceClient.create()) {
+ *   String inputUri = "gs://demomaker/cat.mp4";
+ *   Feature featuresElement = Feature.LABEL_DETECTION;
+ *   List<Feature> features = Arrays.asList(featuresElement);
+ *   AnnotateVideoResponse response = videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the videoIntelligenceServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of + * VideoIntelligenceServiceSettings to create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * VideoIntelligenceServiceSettings videoIntelligenceServiceSettings =
+ *     VideoIntelligenceServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+ *     VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * VideoIntelligenceServiceSettings videoIntelligenceServiceSettings =
+ *     VideoIntelligenceServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * VideoIntelligenceServiceClient videoIntelligenceServiceClient =
+ *     VideoIntelligenceServiceClient.create(videoIntelligenceServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class VideoIntelligenceServiceClient implements BackgroundResource { + private final VideoIntelligenceServiceSettings settings; + private final VideoIntelligenceServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of VideoIntelligenceServiceClient with default settings. */ + public static final VideoIntelligenceServiceClient create() throws IOException { + return create(VideoIntelligenceServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of VideoIntelligenceServiceClient, using the given settings. The + * channels are created based on the settings passed in, or defaults for any settings that are not + * set. + */ + public static final VideoIntelligenceServiceClient create( + VideoIntelligenceServiceSettings settings) throws IOException { + return new VideoIntelligenceServiceClient(settings); + } + + /** + * Constructs an instance of VideoIntelligenceServiceClient, using the given stub for making + * calls. This is for advanced usage - prefer to use VideoIntelligenceServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final VideoIntelligenceServiceClient create(VideoIntelligenceServiceStub stub) { + return new VideoIntelligenceServiceClient(stub); + } + + /** + * Constructs an instance of VideoIntelligenceServiceClient, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected VideoIntelligenceServiceClient(VideoIntelligenceServiceSettings settings) + throws IOException { + this.settings = settings; + this.stub = ((VideoIntelligenceServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected VideoIntelligenceServiceClient(VideoIntelligenceServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final VideoIntelligenceServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public VideoIntelligenceServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Performs asynchronous video annotation. Progress and results can be retrieved through the + * `google.longrunning.Operations` interface. `Operation.metadata` contains + * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` + * (results). + * + *

Sample code: + * + *


+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = VideoIntelligenceServiceClient.create()) {
+   *   String inputUri = "gs://demomaker/cat.mp4";
+   *   Feature featuresElement = Feature.LABEL_DETECTION;
+   *   List<Feature> features = Arrays.asList(featuresElement);
+   *   AnnotateVideoResponse response = videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features).get();
+   * }
+   * 
+ * + * @param inputUri 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. + * @param features Requested video annotation features. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture annotateVideoAsync( + String inputUri, List features) { + + AnnotateVideoRequest request = + AnnotateVideoRequest.newBuilder().setInputUri(inputUri).addAllFeatures(features).build(); + return annotateVideoAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Performs asynchronous video annotation. Progress and results can be retrieved through the + * `google.longrunning.Operations` interface. `Operation.metadata` contains + * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` + * (results). + * + *

Sample code: + * + *


+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = VideoIntelligenceServiceClient.create()) {
+   *   String inputUri = "gs://demomaker/cat.mp4";
+   *   Feature featuresElement = Feature.LABEL_DETECTION;
+   *   List<Feature> features = Arrays.asList(featuresElement);
+   *   AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
+   *     .setInputUri(inputUri)
+   *     .addAllFeatures(features)
+   *     .build();
+   *   AnnotateVideoResponse response = videoIntelligenceServiceClient.annotateVideoAsync(request).get();
+   * }
+   * 
+ * + * @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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture annotateVideoAsync( + AnnotateVideoRequest request) { + return annotateVideoOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Performs asynchronous video annotation. Progress and results can be retrieved through the + * `google.longrunning.Operations` interface. `Operation.metadata` contains + * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` + * (results). + * + *

Sample code: + * + *


+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = VideoIntelligenceServiceClient.create()) {
+   *   String inputUri = "gs://demomaker/cat.mp4";
+   *   Feature featuresElement = Feature.LABEL_DETECTION;
+   *   List<Feature> features = Arrays.asList(featuresElement);
+   *   AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
+   *     .setInputUri(inputUri)
+   *     .addAllFeatures(features)
+   *     .build();
+   *   OperationFuture<Operation> future = videoIntelligenceServiceClient.annotateVideoOperationCallable().futureCall(request);
+   *   // Do something
+   *   AnnotateVideoResponse response = future.get();
+   * }
+   * 
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable + annotateVideoOperationCallable() { + return stub.annotateVideoOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Performs asynchronous video annotation. Progress and results can be retrieved through the + * `google.longrunning.Operations` interface. `Operation.metadata` contains + * `AnnotateVideoProgress` (progress). `Operation.response` contains `AnnotateVideoResponse` + * (results). + * + *

Sample code: + * + *


+   * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = VideoIntelligenceServiceClient.create()) {
+   *   String inputUri = "gs://demomaker/cat.mp4";
+   *   Feature featuresElement = Feature.LABEL_DETECTION;
+   *   List<Feature> features = Arrays.asList(featuresElement);
+   *   AnnotateVideoRequest request = AnnotateVideoRequest.newBuilder()
+   *     .setInputUri(inputUri)
+   *     .addAllFeatures(features)
+   *     .build();
+   *   ApiFuture<Operation> future = videoIntelligenceServiceClient.annotateVideoCallable().futureCall(request);
+   *   // Do something
+   *   Operation response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable annotateVideoCallable() { + return stub.annotateVideoCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceSettings.java b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceSettings.java new file mode 100644 index 000000000000..1fb265e62626 --- /dev/null +++ b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceSettings.java @@ -0,0 +1,197 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.videointelligence.v1p2beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.videointelligence.v1p2beta1.stub.VideoIntelligenceServiceStubSettings; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link VideoIntelligenceServiceClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (videointelligence.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of annotateVideoAsync to 30 seconds: + * + *

+ * 
+ * VideoIntelligenceServiceSettings.Builder videoIntelligenceServiceSettingsBuilder =
+ *     VideoIntelligenceServiceSettings.newBuilder();
+ * videoIntelligenceServiceSettingsBuilder.annotateVideoSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * VideoIntelligenceServiceSettings videoIntelligenceServiceSettings = videoIntelligenceServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class VideoIntelligenceServiceSettings + extends ClientSettings { + /** Returns the object with the settings used for calls to annotateVideo. */ + public UnaryCallSettings annotateVideoSettings() { + return ((VideoIntelligenceServiceStubSettings) getStubSettings()).annotateVideoSettings(); + } + + /** Returns the object with the settings used for calls to annotateVideo. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + annotateVideoOperationSettings() { + return ((VideoIntelligenceServiceStubSettings) getStubSettings()) + .annotateVideoOperationSettings(); + } + + public static final VideoIntelligenceServiceSettings create( + VideoIntelligenceServiceStubSettings stub) throws IOException { + return new VideoIntelligenceServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return VideoIntelligenceServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return VideoIntelligenceServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return VideoIntelligenceServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return VideoIntelligenceServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return VideoIntelligenceServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return VideoIntelligenceServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return VideoIntelligenceServiceStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected VideoIntelligenceServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for VideoIntelligenceServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(VideoIntelligenceServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(VideoIntelligenceServiceStubSettings.newBuilder()); + } + + protected Builder(VideoIntelligenceServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(VideoIntelligenceServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public VideoIntelligenceServiceStubSettings.Builder getStubSettingsBuilder() { + return ((VideoIntelligenceServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to annotateVideo. */ + public UnaryCallSettings.Builder annotateVideoSettings() { + return getStubSettingsBuilder().annotateVideoSettings(); + } + + /** Returns the builder for the settings used for calls to annotateVideo. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AnnotateVideoRequest, AnnotateVideoResponse, AnnotateVideoProgress> + annotateVideoOperationSettings() { + return getStubSettingsBuilder().annotateVideoOperationSettings(); + } + + @Override + public VideoIntelligenceServiceSettings build() throws IOException { + return new VideoIntelligenceServiceSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/package-info.java b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/package-info.java new file mode 100644 index 000000000000..3477c47bb675 --- /dev/null +++ b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/package-info.java @@ -0,0 +1,39 @@ +/* + * Copyright 2018 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. + */ + +/** + * A client to Cloud Video Intelligence API. + * + *

The interfaces provided are listed below, along with usage samples. + * + *

============================== VideoIntelligenceServiceClient ============================== + * + *

Service Description: Service that implements Google Cloud Video Intelligence API. + * + *

Sample for VideoIntelligenceServiceClient: + * + *

+ * 
+ * try (VideoIntelligenceServiceClient videoIntelligenceServiceClient = VideoIntelligenceServiceClient.create()) {
+ *   String inputUri = "gs://demomaker/cat.mp4";
+ *   Feature featuresElement = Feature.LABEL_DETECTION;
+ *   List<Feature> features = Arrays.asList(featuresElement);
+ *   AnnotateVideoResponse response = videoIntelligenceServiceClient.annotateVideoAsync(inputUri, features);
+ * }
+ * 
+ * 
+ */ +package com.google.cloud.videointelligence.v1p2beta1; diff --git a/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/GrpcVideoIntelligenceServiceCallableFactory.java b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/GrpcVideoIntelligenceServiceCallableFactory.java new file mode 100644 index 000000000000..92abad8bfadf --- /dev/null +++ b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/GrpcVideoIntelligenceServiceCallableFactory.java @@ -0,0 +1,116 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.videointelligence.v1p2beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Cloud Video Intelligence API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcVideoIntelligenceServiceCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/GrpcVideoIntelligenceServiceStub.java b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/GrpcVideoIntelligenceServiceStub.java new file mode 100644 index 000000000000..2391fbf5d1b7 --- /dev/null +++ b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/GrpcVideoIntelligenceServiceStub.java @@ -0,0 +1,171 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.videointelligence.v1p2beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Cloud Video Intelligence API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcVideoIntelligenceServiceStub extends VideoIntelligenceServiceStub { + + private static final MethodDescriptor + annotateVideoMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService/AnnotateVideo") + .setRequestMarshaller( + ProtoUtils.marshaller(AnnotateVideoRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable annotateVideoCallable; + private final OperationCallable< + AnnotateVideoRequest, AnnotateVideoResponse, AnnotateVideoProgress> + annotateVideoOperationCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcVideoIntelligenceServiceStub create( + VideoIntelligenceServiceStubSettings settings) throws IOException { + return new GrpcVideoIntelligenceServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcVideoIntelligenceServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcVideoIntelligenceServiceStub( + VideoIntelligenceServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcVideoIntelligenceServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcVideoIntelligenceServiceStub( + VideoIntelligenceServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcVideoIntelligenceServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcVideoIntelligenceServiceStub( + VideoIntelligenceServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcVideoIntelligenceServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcVideoIntelligenceServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcVideoIntelligenceServiceStub( + VideoIntelligenceServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings annotateVideoTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(annotateVideoMethodDescriptor) + .build(); + + this.annotateVideoCallable = + callableFactory.createUnaryCallable( + annotateVideoTransportSettings, settings.annotateVideoSettings(), clientContext); + this.annotateVideoOperationCallable = + callableFactory.createOperationCallable( + annotateVideoTransportSettings, + settings.annotateVideoOperationSettings(), + clientContext, + this.operationsStub); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + annotateVideoOperationCallable() { + return annotateVideoOperationCallable; + } + + public UnaryCallable annotateVideoCallable() { + return annotateVideoCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStub.java b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStub.java new file mode 100644 index 000000000000..3bb5daec9b6f --- /dev/null +++ b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStub.java @@ -0,0 +1,56 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.videointelligence.v1p2beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Cloud Video Intelligence API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class VideoIntelligenceServiceStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + annotateVideoOperationCallable() { + throw new UnsupportedOperationException("Not implemented: annotateVideoOperationCallable()"); + } + + public UnaryCallable annotateVideoCallable() { + throw new UnsupportedOperationException("Not implemented: annotateVideoCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStubSettings.java b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStubSettings.java new file mode 100644 index 000000000000..e270bde83520 --- /dev/null +++ b/google-cloud-clients/google-cloud-video-intelligence/src/main/java/com/google/cloud/videointelligence/v1p2beta1/stub/VideoIntelligenceServiceStubSettings.java @@ -0,0 +1,322 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.videointelligence.v1p2beta1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest; +import com.google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link VideoIntelligenceServiceStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (videointelligence.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of annotateVideoAsync to 30 seconds: + * + *

+ * 
+ * VideoIntelligenceServiceStubSettings.Builder videoIntelligenceServiceSettingsBuilder =
+ *     VideoIntelligenceServiceStubSettings.newBuilder();
+ * videoIntelligenceServiceSettingsBuilder.annotateVideoSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * VideoIntelligenceServiceStubSettings videoIntelligenceServiceSettings = videoIntelligenceServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class VideoIntelligenceServiceStubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings annotateVideoSettings; + private final OperationCallSettings< + AnnotateVideoRequest, AnnotateVideoResponse, AnnotateVideoProgress> + annotateVideoOperationSettings; + + /** Returns the object with the settings used for calls to annotateVideo. */ + public UnaryCallSettings annotateVideoSettings() { + return annotateVideoSettings; + } + + /** Returns the object with the settings used for calls to annotateVideo. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + annotateVideoOperationSettings() { + return annotateVideoOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public VideoIntelligenceServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcVideoIntelligenceServiceStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "videointelligence.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(VideoIntelligenceServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected VideoIntelligenceServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + annotateVideoSettings = settingsBuilder.annotateVideoSettings().build(); + annotateVideoOperationSettings = settingsBuilder.annotateVideoOperationSettings().build(); + } + + /** Builder for VideoIntelligenceServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder annotateVideoSettings; + private final OperationCallSettings.Builder< + AnnotateVideoRequest, AnnotateVideoResponse, AnnotateVideoProgress> + annotateVideoOperationSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.5) + .setMaxRetryDelay(Duration.ofMillis(120000L)) + .setInitialRpcTimeout(Duration.ofMillis(120000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(120000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + annotateVideoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + annotateVideoOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(annotateVideoSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .annotateVideoSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .annotateVideoOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(AnnotateVideoResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(AnnotateVideoProgress.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(20000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(86400000L)) + .build())); + + return builder; + } + + protected Builder(VideoIntelligenceServiceStubSettings settings) { + super(settings); + + annotateVideoSettings = settings.annotateVideoSettings.toBuilder(); + annotateVideoOperationSettings = settings.annotateVideoOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(annotateVideoSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to annotateVideo. */ + public UnaryCallSettings.Builder annotateVideoSettings() { + return annotateVideoSettings; + } + + /** Returns the builder for the settings used for calls to annotateVideo. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + AnnotateVideoRequest, AnnotateVideoResponse, AnnotateVideoProgress> + annotateVideoOperationSettings() { + return annotateVideoOperationSettings; + } + + @Override + public VideoIntelligenceServiceStubSettings build() throws IOException { + return new VideoIntelligenceServiceStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/MockVideoIntelligenceService.java b/google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/MockVideoIntelligenceService.java new file mode 100644 index 000000000000..6f537cdf7493 --- /dev/null +++ b/google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/MockVideoIntelligenceService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.videointelligence.v1p2beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockVideoIntelligenceService implements MockGrpcService { + private final MockVideoIntelligenceServiceImpl serviceImpl; + + public MockVideoIntelligenceService() { + serviceImpl = new MockVideoIntelligenceServiceImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(GeneratedMessageV3 response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/MockVideoIntelligenceServiceImpl.java b/google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/MockVideoIntelligenceServiceImpl.java new file mode 100644 index 000000000000..11ba75d8620a --- /dev/null +++ b/google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/MockVideoIntelligenceServiceImpl.java @@ -0,0 +1,74 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.videointelligence.v1p2beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceServiceGrpc.VideoIntelligenceServiceImplBase; +import com.google.longrunning.Operation; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockVideoIntelligenceServiceImpl extends VideoIntelligenceServiceImplBase { + private ArrayList requests; + private Queue responses; + + public MockVideoIntelligenceServiceImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(GeneratedMessageV3 response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void annotateVideo( + AnnotateVideoRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext((Operation) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceClientTest.java b/google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceClientTest.java new file mode 100644 index 000000000000..0cbaf299cff1 --- /dev/null +++ b/google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceClientTest.java @@ -0,0 +1,130 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.videointelligence.v1p2beta1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class VideoIntelligenceServiceClientTest { + private static MockVideoIntelligenceService mockVideoIntelligenceService; + private static MockServiceHelper serviceHelper; + private VideoIntelligenceServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockVideoIntelligenceService = new MockVideoIntelligenceService(); + serviceHelper = + new MockServiceHelper( + "in-process-1", Arrays.asList(mockVideoIntelligenceService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + VideoIntelligenceServiceSettings settings = + VideoIntelligenceServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = VideoIntelligenceServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @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 features = Arrays.asList(featuresElement); + + AnnotateVideoResponse actualResponse = client.annotateVideoAsync(inputUri, features).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List 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())); + } + + @Test + @SuppressWarnings("all") + public void annotateVideoExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockVideoIntelligenceService.addException(exception); + + try { + String inputUri = "gs://demomaker/cat.mp4"; + Feature featuresElement = Feature.LABEL_DETECTION; + List features = Arrays.asList(featuresElement); + + client.annotateVideoAsync(inputUri, features).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceSmokeTest.java b/google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceSmokeTest.java new file mode 100644 index 000000000000..54b1fb5771b2 --- /dev/null +++ b/google-cloud-clients/google-cloud-video-intelligence/src/test/java/com/google/cloud/videointelligence/v1p2beta1/VideoIntelligenceServiceSmokeTest.java @@ -0,0 +1,66 @@ +/* + * Copyright 2018 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. + */ +package com.google.cloud.videointelligence.v1p2beta1; + +import com.google.common.base.Preconditions; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class VideoIntelligenceServiceSmokeTest { + private static final String PROJECT_ENV_NAME = "GOOGLE_CLOUD_PROJECT"; + private static final String LEGACY_PROJECT_ENV_NAME = "GCLOUD_PROJECT"; + + @Test + public void run() { + main(null); + } + + public static void main(String args[]) { + Logger.getLogger("").setLevel(Level.WARNING); + try { + executeNoCatch(); + System.out.println("OK"); + } catch (Exception e) { + System.err.println("Failed with exception:"); + e.printStackTrace(System.err); + System.exit(1); + } + } + + public static void executeNoCatch() throws Exception { + try (VideoIntelligenceServiceClient client = VideoIntelligenceServiceClient.create()) { + String inputUri = "gs://demomaker/cat.mp4"; + Feature featuresElement = Feature.LABEL_DETECTION; + List features = Arrays.asList(featuresElement); + + AnnotateVideoResponse response = client.annotateVideoAsync(inputUri, features).get(); + } + } + + private static String getProjectId() { + String projectId = System.getProperty(PROJECT_ENV_NAME, System.getenv(PROJECT_ENV_NAME)); + if (projectId == null) { + projectId = + System.getProperty(LEGACY_PROJECT_ENV_NAME, System.getenv(LEGACY_PROJECT_ENV_NAME)); + } + Preconditions.checkArgument(projectId != null, "A project ID is required."); + return projectId; + } +} diff --git a/google-cloud-clients/pom.xml b/google-cloud-clients/pom.xml index ae1d8cf75141..cc3cc08688a5 100644 --- a/google-cloud-clients/pom.xml +++ b/google-cloud-clients/pom.xml @@ -757,7 +757,7 @@ Stub packages - com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.devtools.containeranalysis.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.spanner.admin.database.v1.stub:com.google.cloud.spanner.admin.instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub + com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.devtools.containeranalysis.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.redis.v1.stub:com.google.cloud.spanner.admin.database.v1.stub:com.google.cloud.spanner.admin.instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.videointelligence.v1p2beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub Deprecated packages diff --git a/versions.txt b/versions.txt index d5d737634045..93c08afe2cee 100644 --- a/versions.txt +++ b/versions.txt @@ -30,6 +30,7 @@ grpc-google-cloud-logging-v2:0.26.0:0.26.1-SNAPSHOT grpc-google-cloud-monitoring-v3:1.25.0:1.25.1-SNAPSHOT grpc-google-cloud-os-login-v1:0.26.0:0.26.1-SNAPSHOT grpc-google-cloud-pubsub-v1:1.25.0:1.25.1-SNAPSHOT +grpc-google-cloud-redis-v1:0.26.0:0.26.1-SNAPSHOT grpc-google-cloud-redis-v1beta1:0.26.0:0.26.1-SNAPSHOT grpc-google-cloud-spanner-admin-database-v1:0.26.0:0.26.1-SNAPSHOT grpc-google-cloud-spanner-admin-instance-v1:0.26.0:0.26.1-SNAPSHOT @@ -47,6 +48,7 @@ grpc-google-cloud-video-intelligence-v1:0.26.0:0.26.1-SNAPSHOT grpc-google-cloud-video-intelligence-v1beta1:0.26.0:0.26.1-SNAPSHOT grpc-google-cloud-video-intelligence-v1beta2:0.26.0:0.26.1-SNAPSHOT grpc-google-cloud-video-intelligence-v1p1beta1:0.26.0:0.26.1-SNAPSHOT +grpc-google-cloud-video-intelligence-v1p2beta1:0.26.0:0.26.1-SNAPSHOT grpc-google-cloud-vision-v1:1.25.0:1.25.1-SNAPSHOT grpc-google-cloud-vision-v1p1beta1:0.26.0:0.26.1-SNAPSHOT grpc-google-cloud-vision-v1p2beta1:1.25.0:1.25.1-SNAPSHOT @@ -76,6 +78,7 @@ proto-google-cloud-logging-v2:0.26.0:0.26.1-SNAPSHOT proto-google-cloud-monitoring-v3:1.25.0:1.25.1-SNAPSHOT proto-google-cloud-os-login-v1:0.26.0:0.26.1-SNAPSHOT proto-google-cloud-pubsub-v1:1.25.0:1.25.1-SNAPSHOT +proto-google-cloud-redis-v1:0.26.0:0.26.1-SNAPSHOT proto-google-cloud-redis-v1beta1:0.26.0:0.26.1-SNAPSHOT proto-google-cloud-spanner-admin-database-v1:0.26.0:0.26.1-SNAPSHOT proto-google-cloud-spanner-admin-instance-v1:0.26.0:0.26.1-SNAPSHOT @@ -93,6 +96,7 @@ proto-google-cloud-video-intelligence-v1:0.26.0:0.26.1-SNAPSHOT proto-google-cloud-video-intelligence-v1beta1:0.26.0:0.26.1-SNAPSHOT proto-google-cloud-video-intelligence-v1beta2:0.26.0:0.26.1-SNAPSHOT proto-google-cloud-video-intelligence-v1p1beta1:0.26.0:0.26.1-SNAPSHOT +proto-google-cloud-video-intelligence-v1p2beta1:0.26.0:0.26.1-SNAPSHOT proto-google-cloud-vision-v1:1.25.0:1.25.1-SNAPSHOT proto-google-cloud-vision-v1p1beta1:0.26.0:0.26.1-SNAPSHOT proto-google-cloud-vision-v1p2beta1:1.25.0:1.25.1-SNAPSHOT