From ef44d589e46b5e18285499d689c0eb27a0a409b3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 9 Sep 2019 11:56:33 -0700 Subject: [PATCH] feat: load protos from JSON, grpc-fallback support (#286) --- .../google-cloud-videointelligence/README.md | 4 +- .../protos/protos.json | 4327 ++++++++++++++++- .../src/browser.js | 21 + .../v1/video_intelligence_service_client.js | 91 +- ...video_intelligence_service_proto_list.json | 3 + .../video_intelligence_service_client.js | 92 +- ...video_intelligence_service_proto_list.json | 3 + .../video_intelligence_service_client.js | 92 +- ...video_intelligence_service_proto_list.json | 3 + .../video_intelligence_service_client.js | 92 +- ...video_intelligence_service_proto_list.json | 3 + .../video_intelligence_service_client.js | 92 +- ...video_intelligence_service_proto_list.json | 3 + ...aming_video_intelligence_service_client.js | 75 +- ...video_intelligence_service_proto_list.json | 3 + .../video_intelligence_service_client.js | 92 +- ...video_intelligence_service_proto_list.json | 3 + .../synth.metadata | 10 +- .../test/gapic-v1.js | 7 + .../test/gapic-v1beta1.js | 7 + .../test/gapic-v1beta2.js | 7 + .../test/gapic-v1p1beta1.js | 7 + .../test/gapic-v1p2beta1.js | 7 + .../test/gapic-v1p3beta1.js | 14 + .../webpack.config.js | 46 + 25 files changed, 4855 insertions(+), 249 deletions(-) create mode 100644 packages/google-cloud-videointelligence/src/browser.js create mode 100644 packages/google-cloud-videointelligence/src/v1/video_intelligence_service_proto_list.json create mode 100644 packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_proto_list.json create mode 100644 packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_proto_list.json create mode 100644 packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_proto_list.json create mode 100644 packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_proto_list.json create mode 100644 packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_proto_list.json create mode 100644 packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_proto_list.json create mode 100644 packages/google-cloud-videointelligence/webpack.config.js diff --git a/packages/google-cloud-videointelligence/README.md b/packages/google-cloud-videointelligence/README.md index f1c4a2a7e50..7adfdc64332 100644 --- a/packages/google-cloud-videointelligence/README.md +++ b/packages/google-cloud-videointelligence/README.md @@ -160,12 +160,10 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-video-intelligence/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/video/latest#reference +[client-docs]: https://googleapis.dev/nodejs/video/latest [product-docs]: https://cloud.google.com/video-intelligence [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=videointelligence.googleapis.com [auth]: https://cloud.google.com/docs/authentication/getting-started - - diff --git a/packages/google-cloud-videointelligence/protos/protos.json b/packages/google-cloud-videointelligence/protos/protos.json index 9e26dfeeb6e..892442cb9bc 100644 --- a/packages/google-cloud-videointelligence/protos/protos.json +++ b/packages/google-cloud-videointelligence/protos/protos.json @@ -1 +1,4326 @@ -{} \ No newline at end of file +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "videointelligence": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.VideoIntelligence.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/videointelligence/v1;videointelligence", + "java_multiple_files": true, + "java_outer_classname": "VideoIntelligenceServiceProto", + "java_package": "com.google.cloud.videointelligence.v1", + "php_namespace": "Google\\Cloud\\VideoIntelligence\\V1", + "ruby_package": "Google::Cloud::VideoIntelligence::V1" + }, + "nested": { + "VideoIntelligenceService": { + "options": { + "(google.api.default_host)": "videointelligence.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "AnnotateVideo": { + "requestType": "AnnotateVideoRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/videos:annotate", + "(google.api.http).body": "*" + } + } + } + }, + "AnnotateVideoRequest": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "inputContent": { + "type": "bytes", + "id": 6 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "videoContext": { + "type": "VideoContext", + "id": 3 + }, + "outputUri": { + "type": "string", + "id": 4 + }, + "locationId": { + "type": "string", + "id": 5 + } + } + }, + "VideoContext": { + "fields": { + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelDetectionConfig": { + "type": "LabelDetectionConfig", + "id": 2 + }, + "shotChangeDetectionConfig": { + "type": "ShotChangeDetectionConfig", + "id": 3 + }, + "explicitContentDetectionConfig": { + "type": "ExplicitContentDetectionConfig", + "id": 4 + }, + "faceDetectionConfig": { + "type": "FaceDetectionConfig", + "id": 5 + }, + "speechTranscriptionConfig": { + "type": "SpeechTranscriptionConfig", + "id": 6 + }, + "textDetectionConfig": { + "type": "TextDetectionConfig", + "id": 8 + }, + "objectTrackingConfig": { + "type": "ObjectTrackingConfig", + "id": 13 + } + } + }, + "LabelDetectionConfig": { + "fields": { + "labelDetectionMode": { + "type": "LabelDetectionMode", + "id": 1 + }, + "stationaryCamera": { + "type": "bool", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + }, + "frameConfidenceThreshold": { + "type": "float", + "id": 4 + }, + "videoConfidenceThreshold": { + "type": "float", + "id": 5 + } + } + }, + "ShotChangeDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "ExplicitContentDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "FaceDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + }, + "includeBoundingBoxes": { + "type": "bool", + "id": 2 + } + } + }, + "ObjectTrackingConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "TextDetectionConfig": { + "fields": { + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "model": { + "type": "string", + "id": 2 + } + } + }, + "VideoSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "LabelSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "LabelFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "Entity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "LabelAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "categoryEntities": { + "rule": "repeated", + "type": "Entity", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "LabelSegment", + "id": 3 + }, + "frames": { + "rule": "repeated", + "type": "LabelFrame", + "id": 4 + } + } + }, + "ExplicitContentFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pornographyLikelihood": { + "type": "Likelihood", + "id": 2 + } + } + }, + "ExplicitContentAnnotation": { + "fields": { + "frames": { + "rule": "repeated", + "type": "ExplicitContentFrame", + "id": 1 + } + } + }, + "NormalizedBoundingBox": { + "fields": { + "left": { + "type": "float", + "id": 1 + }, + "top": { + "type": "float", + "id": 2 + }, + "right": { + "type": "float", + "id": 3 + }, + "bottom": { + "type": "float", + "id": 4 + } + } + }, + "FaceSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + } + } + }, + "FaceFrame": { + "fields": { + "normalizedBoundingBoxes": { + "rule": "repeated", + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "FaceAnnotation": { + "fields": { + "thumbnail": { + "type": "bytes", + "id": 1 + }, + "segments": { + "rule": "repeated", + "type": "FaceSegment", + "id": 2 + }, + "frames": { + "rule": "repeated", + "type": "FaceFrame", + "id": 3 + } + } + }, + "VideoAnnotationResults": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "segment": { + "type": "VideoSegment", + "id": 10 + }, + "segmentLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "segmentPresenceLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 23 + }, + "shotLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 3 + }, + "shotPresenceLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 24 + }, + "frameLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 4 + }, + "faceAnnotations": { + "rule": "repeated", + "type": "FaceAnnotation", + "id": 5 + }, + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 6 + }, + "explicitAnnotation": { + "type": "ExplicitContentAnnotation", + "id": 7 + }, + "speechTranscriptions": { + "rule": "repeated", + "type": "SpeechTranscription", + "id": 11 + }, + "textAnnotations": { + "rule": "repeated", + "type": "TextAnnotation", + "id": 12 + }, + "objectAnnotations": { + "rule": "repeated", + "type": "ObjectTrackingAnnotation", + "id": 14 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + } + } + }, + "AnnotateVideoResponse": { + "fields": { + "annotationResults": { + "rule": "repeated", + "type": "VideoAnnotationResults", + "id": 1 + } + } + }, + "VideoAnnotationProgress": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "progressPercent": { + "type": "int32", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + }, + "feature": { + "type": "Feature", + "id": 5 + }, + "segment": { + "type": "VideoSegment", + "id": 6 + } + } + }, + "AnnotateVideoProgress": { + "fields": { + "annotationProgress": { + "rule": "repeated", + "type": "VideoAnnotationProgress", + "id": 1 + } + } + }, + "SpeechTranscriptionConfig": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "maxAlternatives": { + "type": "int32", + "id": 2 + }, + "filterProfanity": { + "type": "bool", + "id": 3 + }, + "speechContexts": { + "rule": "repeated", + "type": "SpeechContext", + "id": 4 + }, + "enableAutomaticPunctuation": { + "type": "bool", + "id": 5 + }, + "audioTracks": { + "rule": "repeated", + "type": "int32", + "id": 6 + }, + "enableSpeakerDiarization": { + "type": "bool", + "id": 7 + }, + "diarizationSpeakerCount": { + "type": "int32", + "id": 8 + }, + "enableWordConfidence": { + "type": "bool", + "id": 9 + } + } + }, + "SpeechContext": { + "fields": { + "phrases": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "SpeechTranscription": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "SpeechRecognitionAlternative": { + "fields": { + "transcript": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "words": { + "rule": "repeated", + "type": "WordInfo", + "id": 3 + } + } + }, + "WordInfo": { + "fields": { + "startTime": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "word": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "speakerTag": { + "type": "int32", + "id": 5 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "NormalizedBoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 1 + } + } + }, + "TextSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "frames": { + "rule": "repeated", + "type": "TextFrame", + "id": 3 + } + } + }, + "TextFrame": { + "fields": { + "rotatedBoundingBox": { + "type": "NormalizedBoundingPoly", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "TextAnnotation": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "segments": { + "rule": "repeated", + "type": "TextSegment", + "id": 2 + } + } + }, + "ObjectTrackingFrame": { + "fields": { + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "ObjectTrackingAnnotation": { + "oneofs": { + "trackInfo": { + "oneof": [ + "segment", + "trackId" + ] + } + }, + "fields": { + "segment": { + "type": "VideoSegment", + "id": 3 + }, + "trackId": { + "type": "int64", + "id": 5 + }, + "entity": { + "type": "Entity", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "frames": { + "rule": "repeated", + "type": "ObjectTrackingFrame", + "id": 2 + } + } + }, + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "SHOT_CHANGE_DETECTION": 2, + "EXPLICIT_CONTENT_DETECTION": 3, + "FACE_DETECTION": 4, + "SPEECH_TRANSCRIPTION": 6, + "TEXT_DETECTION": 7, + "OBJECT_TRACKING": 9 + } + }, + "LabelDetectionMode": { + "values": { + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3 + } + }, + "Likelihood": { + "values": { + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + } + } + }, + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.VideoIntelligence.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/videointelligence/v1beta1;videointelligence", + "java_multiple_files": true, + "java_outer_classname": "VideoIntelligenceServiceProto", + "java_package": "com.google.cloud.videointelligence.v1beta1", + "php_namespace": "Google\\Cloud\\VideoIntelligence\\V1beta1", + "ruby_package": "Google::Cloud::VideoIntelligence::V1beta1" + }, + "nested": { + "VideoIntelligenceService": { + "methods": { + "AnnotateVideo": { + "requestType": "AnnotateVideoRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/videos:annotate", + "(google.api.http).body": "*" + } + } + } + }, + "AnnotateVideoRequest": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "inputContent": { + "type": "string", + "id": 6 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "videoContext": { + "type": "VideoContext", + "id": 3 + }, + "outputUri": { + "type": "string", + "id": 4 + }, + "locationId": { + "type": "string", + "id": 5 + } + } + }, + "VideoContext": { + "fields": { + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelDetectionMode": { + "type": "LabelDetectionMode", + "id": 2 + }, + "stationaryCamera": { + "type": "bool", + "id": 3 + }, + "labelDetectionModel": { + "type": "string", + "id": 4 + }, + "faceDetectionModel": { + "type": "string", + "id": 5 + }, + "shotChangeDetectionModel": { + "type": "string", + "id": 6 + }, + "safeSearchDetectionModel": { + "type": "string", + "id": 7 + } + } + }, + "VideoSegment": { + "fields": { + "startTimeOffset": { + "type": "int64", + "id": 1 + }, + "endTimeOffset": { + "type": "int64", + "id": 2 + } + } + }, + "LabelLocation": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "level": { + "type": "LabelLevel", + "id": 3 + } + } + }, + "LabelAnnotation": { + "fields": { + "description": { + "type": "string", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + }, + "locations": { + "rule": "repeated", + "type": "LabelLocation", + "id": 3 + } + } + }, + "SafeSearchAnnotation": { + "fields": { + "adult": { + "type": "Likelihood", + "id": 1 + }, + "spoof": { + "type": "Likelihood", + "id": 2 + }, + "medical": { + "type": "Likelihood", + "id": 3 + }, + "violent": { + "type": "Likelihood", + "id": 4 + }, + "racy": { + "type": "Likelihood", + "id": 5 + }, + "timeOffset": { + "type": "int64", + "id": 6 + } + } + }, + "BoundingBox": { + "fields": { + "left": { + "type": "int32", + "id": 1 + }, + "right": { + "type": "int32", + "id": 2 + }, + "bottom": { + "type": "int32", + "id": 3 + }, + "top": { + "type": "int32", + "id": 4 + } + } + }, + "FaceLocation": { + "fields": { + "boundingBox": { + "type": "BoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "int64", + "id": 2 + } + } + }, + "FaceAnnotation": { + "fields": { + "thumbnail": { + "type": "string", + "id": 1 + }, + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 2 + }, + "locations": { + "rule": "repeated", + "type": "FaceLocation", + "id": 3 + } + } + }, + "VideoAnnotationResults": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "labelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "faceAnnotations": { + "rule": "repeated", + "type": "FaceAnnotation", + "id": 3 + }, + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 4 + }, + "safeSearchAnnotations": { + "rule": "repeated", + "type": "SafeSearchAnnotation", + "id": 6 + }, + "error": { + "type": "google.rpc.Status", + "id": 5 + } + } + }, + "AnnotateVideoResponse": { + "fields": { + "annotationResults": { + "rule": "repeated", + "type": "VideoAnnotationResults", + "id": 1 + } + } + }, + "VideoAnnotationProgress": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "progressPercent": { + "type": "int32", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "AnnotateVideoProgress": { + "fields": { + "annotationProgress": { + "rule": "repeated", + "type": "VideoAnnotationProgress", + "id": 1 + } + } + }, + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "FACE_DETECTION": 2, + "SHOT_CHANGE_DETECTION": 3, + "SAFE_SEARCH_DETECTION": 4 + } + }, + "LabelLevel": { + "values": { + "LABEL_LEVEL_UNSPECIFIED": 0, + "VIDEO_LEVEL": 1, + "SEGMENT_LEVEL": 2, + "SHOT_LEVEL": 3, + "FRAME_LEVEL": 4 + } + }, + "LabelDetectionMode": { + "values": { + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3 + } + }, + "Likelihood": { + "values": { + "UNKNOWN": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + } + } + }, + "v1beta2": { + "options": { + "csharp_namespace": "Google.Cloud.VideoIntelligence.V1Beta2", + "go_package": "google.golang.org/genproto/googleapis/cloud/videointelligence/v1beta2;videointelligence", + "java_multiple_files": true, + "java_outer_classname": "VideoIntelligenceServiceProto", + "java_package": "com.google.cloud.videointelligence.v1beta2", + "php_namespace": "Google\\Cloud\\VideoIntelligence\\V1beta2", + "ruby_package": "Google::Cloud::VideoIntelligence::V1beta2" + }, + "nested": { + "VideoIntelligenceService": { + "methods": { + "AnnotateVideo": { + "requestType": "AnnotateVideoRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta2/videos:annotate", + "(google.api.http).body": "*" + } + } + } + }, + "AnnotateVideoRequest": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "inputContent": { + "type": "bytes", + "id": 6 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "videoContext": { + "type": "VideoContext", + "id": 3 + }, + "outputUri": { + "type": "string", + "id": 4 + }, + "locationId": { + "type": "string", + "id": 5 + } + } + }, + "VideoContext": { + "fields": { + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelDetectionConfig": { + "type": "LabelDetectionConfig", + "id": 2 + }, + "shotChangeDetectionConfig": { + "type": "ShotChangeDetectionConfig", + "id": 3 + }, + "explicitContentDetectionConfig": { + "type": "ExplicitContentDetectionConfig", + "id": 4 + }, + "faceDetectionConfig": { + "type": "FaceDetectionConfig", + "id": 5 + } + } + }, + "LabelDetectionConfig": { + "fields": { + "labelDetectionMode": { + "type": "LabelDetectionMode", + "id": 1 + }, + "stationaryCamera": { + "type": "bool", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + } + }, + "ShotChangeDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "ExplicitContentDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "FaceDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + }, + "includeBoundingBoxes": { + "type": "bool", + "id": 2 + } + } + }, + "VideoSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "LabelSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "LabelFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "Entity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "LabelAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "categoryEntities": { + "rule": "repeated", + "type": "Entity", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "LabelSegment", + "id": 3 + }, + "frames": { + "rule": "repeated", + "type": "LabelFrame", + "id": 4 + } + } + }, + "ExplicitContentFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pornographyLikelihood": { + "type": "Likelihood", + "id": 2 + } + } + }, + "ExplicitContentAnnotation": { + "fields": { + "frames": { + "rule": "repeated", + "type": "ExplicitContentFrame", + "id": 1 + } + } + }, + "NormalizedBoundingBox": { + "fields": { + "left": { + "type": "float", + "id": 1 + }, + "top": { + "type": "float", + "id": 2 + }, + "right": { + "type": "float", + "id": 3 + }, + "bottom": { + "type": "float", + "id": 4 + } + } + }, + "FaceSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + } + } + }, + "FaceFrame": { + "fields": { + "normalizedBoundingBoxes": { + "rule": "repeated", + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "FaceAnnotation": { + "fields": { + "thumbnail": { + "type": "bytes", + "id": 1 + }, + "segments": { + "rule": "repeated", + "type": "FaceSegment", + "id": 2 + }, + "frames": { + "rule": "repeated", + "type": "FaceFrame", + "id": 3 + } + } + }, + "VideoAnnotationResults": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "segmentLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "shotLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 3 + }, + "frameLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 4 + }, + "faceAnnotations": { + "rule": "repeated", + "type": "FaceAnnotation", + "id": 5 + }, + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 6 + }, + "explicitAnnotation": { + "type": "ExplicitContentAnnotation", + "id": 7 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + } + } + }, + "AnnotateVideoResponse": { + "fields": { + "annotationResults": { + "rule": "repeated", + "type": "VideoAnnotationResults", + "id": 1 + } + } + }, + "VideoAnnotationProgress": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "progressPercent": { + "type": "int32", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "AnnotateVideoProgress": { + "fields": { + "annotationProgress": { + "rule": "repeated", + "type": "VideoAnnotationProgress", + "id": 1 + } + } + }, + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "SHOT_CHANGE_DETECTION": 2, + "EXPLICIT_CONTENT_DETECTION": 3, + "FACE_DETECTION": 4 + } + }, + "LabelDetectionMode": { + "values": { + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3 + } + }, + "Likelihood": { + "values": { + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + } + } + }, + "v1p1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.VideoIntelligence.V1P1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p1beta1;videointelligence", + "java_multiple_files": true, + "java_outer_classname": "VideoIntelligenceServiceProto", + "java_package": "com.google.cloud.videointelligence.v1p1beta1", + "php_namespace": "Google\\Cloud\\VideoIntelligence\\V1p1beta1", + "ruby_package": "Google::Cloud::VideoIntelligence::V1p1beta1" + }, + "nested": { + "VideoIntelligenceService": { + "methods": { + "AnnotateVideo": { + "requestType": "AnnotateVideoRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p1beta1/videos:annotate", + "(google.api.http).body": "*" + } + } + } + }, + "AnnotateVideoRequest": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "inputContent": { + "type": "bytes", + "id": 6 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "videoContext": { + "type": "VideoContext", + "id": 3 + }, + "outputUri": { + "type": "string", + "id": 4 + }, + "locationId": { + "type": "string", + "id": 5 + } + } + }, + "VideoContext": { + "fields": { + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelDetectionConfig": { + "type": "LabelDetectionConfig", + "id": 2 + }, + "shotChangeDetectionConfig": { + "type": "ShotChangeDetectionConfig", + "id": 3 + }, + "explicitContentDetectionConfig": { + "type": "ExplicitContentDetectionConfig", + "id": 4 + }, + "speechTranscriptionConfig": { + "type": "SpeechTranscriptionConfig", + "id": 6 + } + } + }, + "LabelDetectionConfig": { + "fields": { + "labelDetectionMode": { + "type": "LabelDetectionMode", + "id": 1 + }, + "stationaryCamera": { + "type": "bool", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + } + }, + "ShotChangeDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "ExplicitContentDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "VideoSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "LabelSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "LabelFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "Entity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "LabelAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "categoryEntities": { + "rule": "repeated", + "type": "Entity", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "LabelSegment", + "id": 3 + }, + "frames": { + "rule": "repeated", + "type": "LabelFrame", + "id": 4 + } + } + }, + "ExplicitContentFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pornographyLikelihood": { + "type": "Likelihood", + "id": 2 + } + } + }, + "ExplicitContentAnnotation": { + "fields": { + "frames": { + "rule": "repeated", + "type": "ExplicitContentFrame", + "id": 1 + } + } + }, + "VideoAnnotationResults": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "segmentLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "shotLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 3 + }, + "frameLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 4 + }, + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 6 + }, + "explicitAnnotation": { + "type": "ExplicitContentAnnotation", + "id": 7 + }, + "speechTranscriptions": { + "rule": "repeated", + "type": "SpeechTranscription", + "id": 11 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + } + } + }, + "AnnotateVideoResponse": { + "fields": { + "annotationResults": { + "rule": "repeated", + "type": "VideoAnnotationResults", + "id": 1 + } + } + }, + "VideoAnnotationProgress": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "progressPercent": { + "type": "int32", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "AnnotateVideoProgress": { + "fields": { + "annotationProgress": { + "rule": "repeated", + "type": "VideoAnnotationProgress", + "id": 1 + } + } + }, + "SpeechTranscriptionConfig": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "maxAlternatives": { + "type": "int32", + "id": 2 + }, + "filterProfanity": { + "type": "bool", + "id": 3 + }, + "speechContexts": { + "rule": "repeated", + "type": "SpeechContext", + "id": 4 + }, + "enableAutomaticPunctuation": { + "type": "bool", + "id": 5 + }, + "audioTracks": { + "rule": "repeated", + "type": "int32", + "id": 6 + } + } + }, + "SpeechContext": { + "fields": { + "phrases": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "SpeechTranscription": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + } + } + }, + "SpeechRecognitionAlternative": { + "fields": { + "transcript": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "words": { + "rule": "repeated", + "type": "WordInfo", + "id": 3 + } + } + }, + "WordInfo": { + "fields": { + "startTime": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "word": { + "type": "string", + "id": 3 + } + } + }, + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "SHOT_CHANGE_DETECTION": 2, + "EXPLICIT_CONTENT_DETECTION": 3, + "SPEECH_TRANSCRIPTION": 6 + } + }, + "LabelDetectionMode": { + "values": { + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3 + } + }, + "Likelihood": { + "values": { + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + } + } + }, + "v1p2beta1": { + "options": { + "csharp_namespace": "Google.Cloud.VideoIntelligence.V1P2Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p2beta1;videointelligence", + "java_multiple_files": true, + "java_outer_classname": "VideoIntelligenceServiceProto", + "java_package": "com.google.cloud.videointelligence.v1p2beta1", + "php_namespace": "Google\\Cloud\\VideoIntelligence\\V1p2beta1", + "ruby_package": "Google::Cloud::VideoIntelligence::V1p2beta1" + }, + "nested": { + "VideoIntelligenceService": { + "methods": { + "AnnotateVideo": { + "requestType": "AnnotateVideoRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p2beta1/videos:annotate", + "(google.api.http).body": "*" + } + } + } + }, + "AnnotateVideoRequest": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "inputContent": { + "type": "bytes", + "id": 6 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "videoContext": { + "type": "VideoContext", + "id": 3 + }, + "outputUri": { + "type": "string", + "id": 4 + }, + "locationId": { + "type": "string", + "id": 5 + } + } + }, + "VideoContext": { + "fields": { + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelDetectionConfig": { + "type": "LabelDetectionConfig", + "id": 2 + }, + "shotChangeDetectionConfig": { + "type": "ShotChangeDetectionConfig", + "id": 3 + }, + "explicitContentDetectionConfig": { + "type": "ExplicitContentDetectionConfig", + "id": 4 + }, + "textDetectionConfig": { + "type": "TextDetectionConfig", + "id": 8 + } + } + }, + "LabelDetectionConfig": { + "fields": { + "labelDetectionMode": { + "type": "LabelDetectionMode", + "id": 1 + }, + "stationaryCamera": { + "type": "bool", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + } + } + }, + "ShotChangeDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "ExplicitContentDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "TextDetectionConfig": { + "fields": { + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "VideoSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "LabelSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "LabelFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "Entity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "LabelAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "categoryEntities": { + "rule": "repeated", + "type": "Entity", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "LabelSegment", + "id": 3 + }, + "frames": { + "rule": "repeated", + "type": "LabelFrame", + "id": 4 + } + } + }, + "ExplicitContentFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pornographyLikelihood": { + "type": "Likelihood", + "id": 2 + } + } + }, + "ExplicitContentAnnotation": { + "fields": { + "frames": { + "rule": "repeated", + "type": "ExplicitContentFrame", + "id": 1 + } + } + }, + "NormalizedBoundingBox": { + "fields": { + "left": { + "type": "float", + "id": 1 + }, + "top": { + "type": "float", + "id": 2 + }, + "right": { + "type": "float", + "id": 3 + }, + "bottom": { + "type": "float", + "id": 4 + } + } + }, + "VideoAnnotationResults": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "segmentLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "shotLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 3 + }, + "frameLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 4 + }, + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 6 + }, + "explicitAnnotation": { + "type": "ExplicitContentAnnotation", + "id": 7 + }, + "textAnnotations": { + "rule": "repeated", + "type": "TextAnnotation", + "id": 12 + }, + "objectAnnotations": { + "rule": "repeated", + "type": "ObjectTrackingAnnotation", + "id": 14 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + } + } + }, + "AnnotateVideoResponse": { + "fields": { + "annotationResults": { + "rule": "repeated", + "type": "VideoAnnotationResults", + "id": 1 + } + } + }, + "VideoAnnotationProgress": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "progressPercent": { + "type": "int32", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "AnnotateVideoProgress": { + "fields": { + "annotationProgress": { + "rule": "repeated", + "type": "VideoAnnotationProgress", + "id": 1 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "NormalizedBoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 1 + } + } + }, + "TextSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "frames": { + "rule": "repeated", + "type": "TextFrame", + "id": 3 + } + } + }, + "TextFrame": { + "fields": { + "rotatedBoundingBox": { + "type": "NormalizedBoundingPoly", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "TextAnnotation": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "segments": { + "rule": "repeated", + "type": "TextSegment", + "id": 2 + } + } + }, + "ObjectTrackingFrame": { + "fields": { + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "ObjectTrackingAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "frames": { + "rule": "repeated", + "type": "ObjectTrackingFrame", + "id": 2 + }, + "segment": { + "type": "VideoSegment", + "id": 3 + } + } + }, + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "SHOT_CHANGE_DETECTION": 2, + "EXPLICIT_CONTENT_DETECTION": 3, + "TEXT_DETECTION": 7, + "OBJECT_TRACKING": 9 + } + }, + "LabelDetectionMode": { + "values": { + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3 + } + }, + "Likelihood": { + "values": { + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + } + } + }, + "v1p3beta1": { + "options": { + "csharp_namespace": "Google.Cloud.VideoIntelligence.V1P3Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p3beta1;videointelligence", + "java_multiple_files": true, + "java_outer_classname": "VideoIntelligenceServiceProto", + "java_package": "com.google.cloud.videointelligence.v1p3beta1", + "php_namespace": "Google\\Cloud\\VideoIntelligence\\V1p3beta1", + "ruby_package": "Google::Cloud::VideoIntelligence::V1p3beta1" + }, + "nested": { + "VideoIntelligenceService": { + "methods": { + "AnnotateVideo": { + "requestType": "AnnotateVideoRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1p3beta1/videos:annotate", + "(google.api.http).body": "*" + } + } + } + }, + "StreamingVideoIntelligenceService": { + "methods": { + "StreamingAnnotateVideo": { + "requestType": "StreamingAnnotateVideoRequest", + "requestStream": true, + "responseType": "StreamingAnnotateVideoResponse", + "responseStream": true + } + } + }, + "AnnotateVideoRequest": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "inputContent": { + "type": "bytes", + "id": 6 + }, + "features": { + "rule": "repeated", + "type": "Feature", + "id": 2 + }, + "videoContext": { + "type": "VideoContext", + "id": 3 + }, + "outputUri": { + "type": "string", + "id": 4 + }, + "locationId": { + "type": "string", + "id": 5 + } + } + }, + "VideoContext": { + "fields": { + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelDetectionConfig": { + "type": "LabelDetectionConfig", + "id": 2 + }, + "shotChangeDetectionConfig": { + "type": "ShotChangeDetectionConfig", + "id": 3 + }, + "explicitContentDetectionConfig": { + "type": "ExplicitContentDetectionConfig", + "id": 4 + }, + "speechTranscriptionConfig": { + "type": "SpeechTranscriptionConfig", + "id": 6 + }, + "textDetectionConfig": { + "type": "TextDetectionConfig", + "id": 8 + }, + "objectTrackingConfig": { + "type": "ObjectTrackingConfig", + "id": 13 + } + } + }, + "LabelDetectionConfig": { + "fields": { + "labelDetectionMode": { + "type": "LabelDetectionMode", + "id": 1 + }, + "stationaryCamera": { + "type": "bool", + "id": 2 + }, + "model": { + "type": "string", + "id": 3 + }, + "frameConfidenceThreshold": { + "type": "float", + "id": 4 + }, + "videoConfidenceThreshold": { + "type": "float", + "id": 5 + } + } + }, + "ShotChangeDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "ObjectTrackingConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "ExplicitContentDetectionConfig": { + "fields": { + "model": { + "type": "string", + "id": 1 + } + } + }, + "TextDetectionConfig": { + "fields": { + "languageHints": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "model": { + "type": "string", + "id": 2 + } + } + }, + "VideoSegment": { + "fields": { + "startTimeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTimeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "LabelSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "LabelFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + } + } + }, + "Entity": { + "fields": { + "entityId": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + } + } + }, + "LabelAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "categoryEntities": { + "rule": "repeated", + "type": "Entity", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "LabelSegment", + "id": 3 + }, + "frames": { + "rule": "repeated", + "type": "LabelFrame", + "id": 4 + } + } + }, + "ExplicitContentFrame": { + "fields": { + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pornographyLikelihood": { + "type": "Likelihood", + "id": 2 + } + } + }, + "ExplicitContentAnnotation": { + "fields": { + "frames": { + "rule": "repeated", + "type": "ExplicitContentFrame", + "id": 1 + } + } + }, + "NormalizedBoundingBox": { + "fields": { + "left": { + "type": "float", + "id": 1 + }, + "top": { + "type": "float", + "id": 2 + }, + "right": { + "type": "float", + "id": 3 + }, + "bottom": { + "type": "float", + "id": 4 + } + } + }, + "TimestampedObject": { + "fields": { + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "attributes": { + "rule": "repeated", + "type": "DetectedAttribute", + "id": 3 + } + } + }, + "Track": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "timestampedObjects": { + "rule": "repeated", + "type": "TimestampedObject", + "id": 2 + }, + "attributes": { + "rule": "repeated", + "type": "DetectedAttribute", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "DetectedAttribute": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "value": { + "type": "string", + "id": 3 + } + } + }, + "VideoAnnotationResults": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "segmentLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "shotLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 3 + }, + "frameLabelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 4 + }, + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 6 + }, + "explicitAnnotation": { + "type": "ExplicitContentAnnotation", + "id": 7 + }, + "speechTranscriptions": { + "rule": "repeated", + "type": "SpeechTranscription", + "id": 11 + }, + "textAnnotations": { + "rule": "repeated", + "type": "TextAnnotation", + "id": 12 + }, + "objectAnnotations": { + "rule": "repeated", + "type": "ObjectTrackingAnnotation", + "id": 14 + }, + "logoRecognitionAnnotations": { + "rule": "repeated", + "type": "LogoRecognitionAnnotation", + "id": 19 + }, + "error": { + "type": "google.rpc.Status", + "id": 9 + } + } + }, + "AnnotateVideoResponse": { + "fields": { + "annotationResults": { + "rule": "repeated", + "type": "VideoAnnotationResults", + "id": 1 + } + } + }, + "VideoAnnotationProgress": { + "fields": { + "inputUri": { + "type": "string", + "id": 1 + }, + "progressPercent": { + "type": "int32", + "id": 2 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4 + } + } + }, + "AnnotateVideoProgress": { + "fields": { + "annotationProgress": { + "rule": "repeated", + "type": "VideoAnnotationProgress", + "id": 1 + } + } + }, + "SpeechTranscriptionConfig": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + }, + "maxAlternatives": { + "type": "int32", + "id": 2 + }, + "filterProfanity": { + "type": "bool", + "id": 3 + }, + "speechContexts": { + "rule": "repeated", + "type": "SpeechContext", + "id": 4 + }, + "enableAutomaticPunctuation": { + "type": "bool", + "id": 5 + }, + "audioTracks": { + "rule": "repeated", + "type": "int32", + "id": 6 + }, + "enableSpeakerDiarization": { + "type": "bool", + "id": 7 + }, + "diarizationSpeakerCount": { + "type": "int32", + "id": 8 + }, + "enableWordConfidence": { + "type": "bool", + "id": 9 + } + } + }, + "SpeechContext": { + "fields": { + "phrases": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "SpeechTranscription": { + "fields": { + "alternatives": { + "rule": "repeated", + "type": "SpeechRecognitionAlternative", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "SpeechRecognitionAlternative": { + "fields": { + "transcript": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "words": { + "rule": "repeated", + "type": "WordInfo", + "id": 3 + } + } + }, + "WordInfo": { + "fields": { + "startTime": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "word": { + "type": "string", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "speakerTag": { + "type": "int32", + "id": 5 + } + } + }, + "NormalizedVertex": { + "fields": { + "x": { + "type": "float", + "id": 1 + }, + "y": { + "type": "float", + "id": 2 + } + } + }, + "NormalizedBoundingPoly": { + "fields": { + "vertices": { + "rule": "repeated", + "type": "NormalizedVertex", + "id": 1 + } + } + }, + "TextSegment": { + "fields": { + "segment": { + "type": "VideoSegment", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "frames": { + "rule": "repeated", + "type": "TextFrame", + "id": 3 + } + } + }, + "TextFrame": { + "fields": { + "rotatedBoundingBox": { + "type": "NormalizedBoundingPoly", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "TextAnnotation": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "segments": { + "rule": "repeated", + "type": "TextSegment", + "id": 2 + } + } + }, + "ObjectTrackingFrame": { + "fields": { + "normalizedBoundingBox": { + "type": "NormalizedBoundingBox", + "id": 1 + }, + "timeOffset": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "ObjectTrackingAnnotation": { + "oneofs": { + "trackInfo": { + "oneof": [ + "segment", + "trackId" + ] + } + }, + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "frames": { + "rule": "repeated", + "type": "ObjectTrackingFrame", + "id": 2 + }, + "segment": { + "type": "VideoSegment", + "id": 3 + }, + "trackId": { + "type": "int64", + "id": 5 + } + } + }, + "LogoRecognitionAnnotation": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "tracks": { + "rule": "repeated", + "type": "Track", + "id": 2 + }, + "segments": { + "rule": "repeated", + "type": "VideoSegment", + "id": 3 + } + } + }, + "StreamingAnnotateVideoRequest": { + "oneofs": { + "streamingRequest": { + "oneof": [ + "videoConfig", + "inputContent" + ] + } + }, + "fields": { + "videoConfig": { + "type": "StreamingVideoConfig", + "id": 1 + }, + "inputContent": { + "type": "bytes", + "id": 2 + } + } + }, + "StreamingAnnotateVideoResponse": { + "fields": { + "error": { + "type": "google.rpc.Status", + "id": 1 + }, + "annotationResults": { + "type": "StreamingVideoAnnotationResults", + "id": 2 + }, + "annotationResultsUri": { + "type": "string", + "id": 3 + } + } + }, + "StreamingAutomlClassificationConfig": { + "fields": { + "modelName": { + "type": "string", + "id": 1 + } + } + }, + "StreamingAutomlObjectTrackingConfig": { + "fields": { + "modelName": { + "type": "string", + "id": 1 + } + } + }, + "StreamingExplicitContentDetectionConfig": { + "fields": {} + }, + "StreamingLabelDetectionConfig": { + "fields": { + "stationaryCamera": { + "type": "bool", + "id": 1 + } + } + }, + "StreamingObjectTrackingConfig": { + "fields": {} + }, + "StreamingShotChangeDetectionConfig": { + "fields": {} + }, + "StreamingStorageConfig": { + "fields": { + "enableStorageAnnotationResult": { + "type": "bool", + "id": 1 + }, + "annotationResultStorageDirectory": { + "type": "string", + "id": 3 + } + } + }, + "StreamingVideoAnnotationResults": { + "fields": { + "shotAnnotations": { + "rule": "repeated", + "type": "VideoSegment", + "id": 1 + }, + "labelAnnotations": { + "rule": "repeated", + "type": "LabelAnnotation", + "id": 2 + }, + "explicitAnnotation": { + "type": "ExplicitContentAnnotation", + "id": 3 + }, + "objectAnnotations": { + "rule": "repeated", + "type": "ObjectTrackingAnnotation", + "id": 4 + } + } + }, + "StreamingVideoConfig": { + "oneofs": { + "streamingConfig": { + "oneof": [ + "shotChangeDetectionConfig", + "labelDetectionConfig", + "explicitContentDetectionConfig", + "objectTrackingConfig", + "automlClassificationConfig", + "automlObjectTrackingConfig" + ] + } + }, + "fields": { + "feature": { + "type": "StreamingFeature", + "id": 1 + }, + "shotChangeDetectionConfig": { + "type": "StreamingShotChangeDetectionConfig", + "id": 2 + }, + "labelDetectionConfig": { + "type": "StreamingLabelDetectionConfig", + "id": 3 + }, + "explicitContentDetectionConfig": { + "type": "StreamingExplicitContentDetectionConfig", + "id": 4 + }, + "objectTrackingConfig": { + "type": "StreamingObjectTrackingConfig", + "id": 5 + }, + "automlClassificationConfig": { + "type": "StreamingAutomlClassificationConfig", + "id": 21 + }, + "automlObjectTrackingConfig": { + "type": "StreamingAutomlObjectTrackingConfig", + "id": 22 + }, + "storageConfig": { + "type": "StreamingStorageConfig", + "id": 30 + } + } + }, + "Feature": { + "values": { + "FEATURE_UNSPECIFIED": 0, + "LABEL_DETECTION": 1, + "SHOT_CHANGE_DETECTION": 2, + "EXPLICIT_CONTENT_DETECTION": 3, + "SPEECH_TRANSCRIPTION": 6, + "TEXT_DETECTION": 7, + "OBJECT_TRACKING": 9, + "LOGO_RECOGNITION": 12 + } + }, + "LabelDetectionMode": { + "values": { + "LABEL_DETECTION_MODE_UNSPECIFIED": 0, + "SHOT_MODE": 1, + "FRAME_MODE": 2, + "SHOT_AND_FRAME_MODE": 3 + } + }, + "Likelihood": { + "values": { + "LIKELIHOOD_UNSPECIFIED": 0, + "VERY_UNLIKELY": 1, + "UNLIKELY": 2, + "POSSIBLE": 3, + "LIKELY": 4, + "VERY_LIKELY": 5 + } + }, + "StreamingFeature": { + "values": { + "STREAMING_FEATURE_UNSPECIFIED": 0, + "STREAMING_LABEL_DETECTION": 1, + "STREAMING_SHOT_CHANGE_DETECTION": 2, + "STREAMING_EXPLICIT_CONTENT_DETECTION": 3, + "STREAMING_OBJECT_TRACKING": 4, + "STREAMING_AUTOML_CLASSIFICATION": 21, + "STREAMING_AUTOML_OBJECT_TRACKING": 22 + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "protobuf": { + "options": { + "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": false + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + } + } + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}" + } + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}" + } + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}" + } + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*" + } + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-videointelligence/src/browser.js b/packages/google-cloud-videointelligence/src/browser.js new file mode 100644 index 00000000000..ddbcd7ecb9a --- /dev/null +++ b/packages/google-cloud-videointelligence/src/browser.js @@ -0,0 +1,21 @@ +// Copyright 2019 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. + +'use strict'; + +// Set a flag that we are running in a browser bundle. +global.isBrowser = true; + +// Re-export all exports from ./index.js. +module.exports = require('./index'); diff --git a/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.js b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.js index 594ee64fe79..e79cf34cb5b 100644 --- a/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.js +++ b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./video_intelligence_service_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -59,6 +58,16 @@ class VideoIntelligenceServiceClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -75,43 +84,51 @@ class VideoIntelligenceServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.version}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/videointelligence/v1/video_intelligence.proto'] + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' ); - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/videointelligence/v1/video_intelligence.proto' - ), - protoFilesRoot + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -124,7 +141,7 @@ class VideoIntelligenceServiceClient { ); this._descriptors.longrunning = { - annotateVideo: new gax.LongrunningDescriptor( + annotateVideo: new gaxModule.LongrunningDescriptor( this.operationsClient, annotateVideoResponse.decode.bind(annotateVideoResponse), annotateVideoMetadata.decode.bind(annotateVideoMetadata) @@ -147,7 +164,11 @@ class VideoIntelligenceServiceClient { // Put together the "service stub" for // google.cloud.videointelligence.v1.VideoIntelligenceService. const videoIntelligenceServiceStub = gaxGrpc.createStub( - protos.google.cloud.videointelligence.v1.VideoIntelligenceService, + opts.fallback + ? protos.lookupService( + 'google.cloud.videointelligence.v1.VideoIntelligenceService' + ) + : protos.google.cloud.videointelligence.v1.VideoIntelligenceService, opts ); @@ -155,18 +176,16 @@ class VideoIntelligenceServiceClient { // and create an API call method for each. const videoIntelligenceServiceStubMethods = ['annotateVideo']; for (const methodName of videoIntelligenceServiceStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - videoIntelligenceServiceStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = videoIntelligenceServiceStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..e28d401f1a2 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1/video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_client.js b/packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_client.js index 70f5c659cf4..feb2ee54362 100644 --- a/packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_client.js +++ b/packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./video_intelligence_service_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -59,6 +58,16 @@ class VideoIntelligenceServiceClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -75,43 +84,51 @@ class VideoIntelligenceServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.version}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/videointelligence/v1beta1/video_intelligence.proto'] + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' ); - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/videointelligence/v1beta1/video_intelligence.proto' - ), - protoFilesRoot + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -124,7 +141,7 @@ class VideoIntelligenceServiceClient { ); this._descriptors.longrunning = { - annotateVideo: new gax.LongrunningDescriptor( + annotateVideo: new gaxModule.LongrunningDescriptor( this.operationsClient, annotateVideoResponse.decode.bind(annotateVideoResponse), annotateVideoMetadata.decode.bind(annotateVideoMetadata) @@ -147,7 +164,12 @@ class VideoIntelligenceServiceClient { // Put together the "service stub" for // google.cloud.videointelligence.v1beta1.VideoIntelligenceService. const videoIntelligenceServiceStub = gaxGrpc.createStub( - protos.google.cloud.videointelligence.v1beta1.VideoIntelligenceService, + opts.fallback + ? protos.lookupService( + 'google.cloud.videointelligence.v1beta1.VideoIntelligenceService' + ) + : protos.google.cloud.videointelligence.v1beta1 + .VideoIntelligenceService, opts ); @@ -155,18 +177,16 @@ class VideoIntelligenceServiceClient { // and create an API call method for each. const videoIntelligenceServiceStubMethods = ['annotateVideo']; for (const methodName of videoIntelligenceServiceStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - videoIntelligenceServiceStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = videoIntelligenceServiceStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..db0d6735d24 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1beta1/video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1beta1/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.js b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.js index d944b5b4606..ccc58f9b6d8 100644 --- a/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.js +++ b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./video_intelligence_service_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -59,6 +58,16 @@ class VideoIntelligenceServiceClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -75,43 +84,51 @@ class VideoIntelligenceServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.version}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/videointelligence/v1beta2/video_intelligence.proto'] + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' ); - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/videointelligence/v1beta2/video_intelligence.proto' - ), - protoFilesRoot + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -124,7 +141,7 @@ class VideoIntelligenceServiceClient { ); this._descriptors.longrunning = { - annotateVideo: new gax.LongrunningDescriptor( + annotateVideo: new gaxModule.LongrunningDescriptor( this.operationsClient, annotateVideoResponse.decode.bind(annotateVideoResponse), annotateVideoMetadata.decode.bind(annotateVideoMetadata) @@ -147,7 +164,12 @@ class VideoIntelligenceServiceClient { // Put together the "service stub" for // google.cloud.videointelligence.v1beta2.VideoIntelligenceService. const videoIntelligenceServiceStub = gaxGrpc.createStub( - protos.google.cloud.videointelligence.v1beta2.VideoIntelligenceService, + opts.fallback + ? protos.lookupService( + 'google.cloud.videointelligence.v1beta2.VideoIntelligenceService' + ) + : protos.google.cloud.videointelligence.v1beta2 + .VideoIntelligenceService, opts ); @@ -155,18 +177,16 @@ class VideoIntelligenceServiceClient { // and create an API call method for each. const videoIntelligenceServiceStubMethods = ['annotateVideo']; for (const methodName of videoIntelligenceServiceStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - videoIntelligenceServiceStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = videoIntelligenceServiceStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..02f0a919dcd --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1beta2/video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1beta2/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.js b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.js index 8488b5bc3e9..33ffbfbf7d9 100644 --- a/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.js +++ b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./video_intelligence_service_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -59,6 +58,16 @@ class VideoIntelligenceServiceClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -75,43 +84,51 @@ class VideoIntelligenceServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.version}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/videointelligence/v1p1beta1/video_intelligence.proto'] + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' ); - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/videointelligence/v1p1beta1/video_intelligence.proto' - ), - protoFilesRoot + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -124,7 +141,7 @@ class VideoIntelligenceServiceClient { ); this._descriptors.longrunning = { - annotateVideo: new gax.LongrunningDescriptor( + annotateVideo: new gaxModule.LongrunningDescriptor( this.operationsClient, annotateVideoResponse.decode.bind(annotateVideoResponse), annotateVideoMetadata.decode.bind(annotateVideoMetadata) @@ -147,7 +164,12 @@ class VideoIntelligenceServiceClient { // Put together the "service stub" for // google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService. const videoIntelligenceServiceStub = gaxGrpc.createStub( - protos.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService, + opts.fallback + ? protos.lookupService( + 'google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService' + ) + : protos.google.cloud.videointelligence.v1p1beta1 + .VideoIntelligenceService, opts ); @@ -155,18 +177,16 @@ class VideoIntelligenceServiceClient { // and create an API call method for each. const videoIntelligenceServiceStubMethods = ['annotateVideo']; for (const methodName of videoIntelligenceServiceStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - videoIntelligenceServiceStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = videoIntelligenceServiceStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..4213216a5f9 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p1beta1/video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1p1beta1/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.js b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.js index a2aee93318d..47924654695 100644 --- a/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.js +++ b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./video_intelligence_service_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -59,6 +58,16 @@ class VideoIntelligenceServiceClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -75,43 +84,51 @@ class VideoIntelligenceServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.version}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/videointelligence/v1p2beta1/video_intelligence.proto'] + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' ); - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/videointelligence/v1p2beta1/video_intelligence.proto' - ), - protoFilesRoot + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -124,7 +141,7 @@ class VideoIntelligenceServiceClient { ); this._descriptors.longrunning = { - annotateVideo: new gax.LongrunningDescriptor( + annotateVideo: new gaxModule.LongrunningDescriptor( this.operationsClient, annotateVideoResponse.decode.bind(annotateVideoResponse), annotateVideoMetadata.decode.bind(annotateVideoMetadata) @@ -147,7 +164,12 @@ class VideoIntelligenceServiceClient { // Put together the "service stub" for // google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService. const videoIntelligenceServiceStub = gaxGrpc.createStub( - protos.google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService, + opts.fallback + ? protos.lookupService( + 'google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService' + ) + : protos.google.cloud.videointelligence.v1p2beta1 + .VideoIntelligenceService, opts ); @@ -155,18 +177,16 @@ class VideoIntelligenceServiceClient { // and create an API call method for each. const videoIntelligenceServiceStubMethods = ['annotateVideo']; for (const methodName of videoIntelligenceServiceStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - videoIntelligenceServiceStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = videoIntelligenceServiceStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..64abb974b04 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p2beta1/video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1p2beta1/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client.js b/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client.js index 08afbbe2a24..b8b5b8159c9 100644 --- a/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client.js +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_client.js @@ -58,6 +58,16 @@ class StreamingVideoIntelligenceServiceClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -74,32 +84,47 @@ class StreamingVideoIntelligenceServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.version}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/videointelligence/v1p3beta1/video_intelligence.proto'] + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); // Some of the methods on this service provide streaming responses. // Provide descriptors for these. this._descriptors.stream = { - streamingAnnotateVideo: new gax.StreamDescriptor( + streamingAnnotateVideo: new gaxModule.StreamDescriptor( gax.StreamType.BIDI_STREAMING ), }; @@ -120,8 +145,12 @@ class StreamingVideoIntelligenceServiceClient { // Put together the "service stub" for // google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService. const streamingVideoIntelligenceServiceStub = gaxGrpc.createStub( - protos.google.cloud.videointelligence.v1p3beta1 - .StreamingVideoIntelligenceService, + opts.fallback + ? protos.lookupService( + 'google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService' + ) + : protos.google.cloud.videointelligence.v1p3beta1 + .StreamingVideoIntelligenceService, opts ); @@ -131,18 +160,16 @@ class StreamingVideoIntelligenceServiceClient { 'streamingAnnotateVideo', ]; for (const methodName of streamingVideoIntelligenceServiceStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - streamingVideoIntelligenceServiceStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = streamingVideoIntelligenceServiceStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.stream[methodName] ); diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..85fbf375df1 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/streaming_video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1p3beta1/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client.js b/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client.js index 9c783efb698..307d8f55002 100644 --- a/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client.js +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_client.js @@ -17,7 +17,6 @@ const gapicConfig = require('./video_intelligence_service_client_config.json'); const gax = require('google-gax'); const path = require('path'); -const protobuf = require('protobufjs'); const VERSION = require('../../package.json').version; @@ -59,6 +58,16 @@ class VideoIntelligenceServiceClient { opts = opts || {}; this._descriptors = {}; + if (global.isBrowser) { + // If we're in browser, we use gRPC fallback. + opts.fallback = true; + } + + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !global.isBrowser && opts.fallback ? gax.fallback : gax; + const servicePath = opts.servicePath || opts.apiEndpoint || this.constructor.servicePath; @@ -75,43 +84,51 @@ class VideoIntelligenceServiceClient { // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = this.constructor.scopes; - const gaxGrpc = new gax.GrpcClient(opts); + const gaxGrpc = new gaxModule.GrpcClient(opts); // Save the auth object to the client, for use by other methods. this.auth = gaxGrpc.auth; // Determine the client header string. - const clientHeader = [ - `gl-node/${process.version}`, - `grpc/${gaxGrpc.grpcVersion}`, - `gax/${gax.version}`, - `gapic/${VERSION}`, - ]; + const clientHeader = []; + + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } + clientHeader.push(`gax/${gaxModule.version}`); + if (opts.fallback) { + clientHeader.push(`gl-web/${gaxModule.version}`); + } else { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + clientHeader.push(`gapic/${VERSION}`); if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - const protos = gaxGrpc.loadProto( - path.join(__dirname, '..', '..', 'protos'), - ['google/cloud/videointelligence/v1p3beta1/video_intelligence.proto'] + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' ); - let protoFilesRoot = new gax.GoogleProtoFilesRoot(); - protoFilesRoot = protobuf.loadSync( - path.join( - __dirname, - '..', - '..', - 'protos', - 'google/cloud/videointelligence/v1p3beta1/video_intelligence.proto' - ), - protoFilesRoot + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); + const protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = new gax.lro({ + this.operationsClient = new gaxModule.lro({ auth: gaxGrpc.auth, grpc: gaxGrpc.grpc, }).operationsClient(opts); @@ -124,7 +141,7 @@ class VideoIntelligenceServiceClient { ); this._descriptors.longrunning = { - annotateVideo: new gax.LongrunningDescriptor( + annotateVideo: new gaxModule.LongrunningDescriptor( this.operationsClient, annotateVideoResponse.decode.bind(annotateVideoResponse), annotateVideoMetadata.decode.bind(annotateVideoMetadata) @@ -147,7 +164,12 @@ class VideoIntelligenceServiceClient { // Put together the "service stub" for // google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService. const videoIntelligenceServiceStub = gaxGrpc.createStub( - protos.google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService, + opts.fallback + ? protos.lookupService( + 'google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService' + ) + : protos.google.cloud.videointelligence.v1p3beta1 + .VideoIntelligenceService, opts ); @@ -155,18 +177,16 @@ class VideoIntelligenceServiceClient { // and create an API call method for each. const videoIntelligenceServiceStubMethods = ['annotateVideo']; for (const methodName of videoIntelligenceServiceStubMethods) { - this._innerApiCalls[methodName] = gax.createApiCall( - videoIntelligenceServiceStub.then( - stub => - function() { - const args = Array.prototype.slice.call(arguments, 0); - return stub[methodName].apply(stub, args); - }, - err => - function() { - throw err; - } - ), + const innerCallPromise = videoIntelligenceServiceStub.then( + stub => (...args) => { + return stub[methodName].apply(stub, args); + }, + err => () => { + throw err; + } + ); + this._innerApiCalls[methodName] = gaxModule.createApiCall( + innerCallPromise, defaults[methodName], this._descriptors.longrunning[methodName] ); diff --git a/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_proto_list.json b/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_proto_list.json new file mode 100644 index 00000000000..85fbf375df1 --- /dev/null +++ b/packages/google-cloud-videointelligence/src/v1p3beta1/video_intelligence_service_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/videointelligence/v1p3beta1/video_intelligence.proto" +] diff --git a/packages/google-cloud-videointelligence/synth.metadata b/packages/google-cloud-videointelligence/synth.metadata index 4e30adba5fc..1a02978c3bd 100644 --- a/packages/google-cloud-videointelligence/synth.metadata +++ b/packages/google-cloud-videointelligence/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-08-07T11:29:13.523044Z", + "updateTime": "2019-09-04T11:29:28.847451Z", "sources": [ { "generator": { "name": "artman", - "version": "0.32.1", - "dockerImage": "googleapis/artman@sha256:a684d40ba9a4e15946f5f2ca6b4bd9fe301192f522e9de4fff622118775f309b" + "version": "0.36.2", + "dockerImage": "googleapis/artman@sha256:0e6f3a668cd68afc768ecbe08817cf6e56a0e64fcbdb1c58c3b97492d12418a1" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6d29882872298c8bfbaef33bd69bfca275c4d2eb", - "internalRef": "262019251" + "sha": "a2158681f6e30c5fd9446eb1fd7b5021a6d48bfa", + "internalRef": "266999433" } }, { diff --git a/packages/google-cloud-videointelligence/test/gapic-v1.js b/packages/google-cloud-videointelligence/test/gapic-v1.js index 5dad8ce8569..1b4046b61d5 100644 --- a/packages/google-cloud-videointelligence/test/gapic-v1.js +++ b/packages/google-cloud-videointelligence/test/gapic-v1.js @@ -46,6 +46,13 @@ describe('VideoIntelligenceServiceClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new videoIntelligenceModule.v1.VideoIntelligenceServiceClient( + {fallback: true} + ); + assert(client); + }); + describe('annotateVideo', function() { it('invokes annotateVideo without error', done => { const client = new videoIntelligenceModule.v1.VideoIntelligenceServiceClient( diff --git a/packages/google-cloud-videointelligence/test/gapic-v1beta1.js b/packages/google-cloud-videointelligence/test/gapic-v1beta1.js index 313d7690014..1aeb57cdca2 100644 --- a/packages/google-cloud-videointelligence/test/gapic-v1beta1.js +++ b/packages/google-cloud-videointelligence/test/gapic-v1beta1.js @@ -49,6 +49,13 @@ describe('VideoIntelligenceServiceClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new videointelligenceModule.v1beta1.VideoIntelligenceServiceClient( + {fallback: true} + ); + assert(client); + }); + describe('annotateVideo', function() { it('invokes annotateVideo without error', done => { const client = new videointelligenceModule.v1beta1.VideoIntelligenceServiceClient( diff --git a/packages/google-cloud-videointelligence/test/gapic-v1beta2.js b/packages/google-cloud-videointelligence/test/gapic-v1beta2.js index 0ff760944f2..20ec155ba9e 100644 --- a/packages/google-cloud-videointelligence/test/gapic-v1beta2.js +++ b/packages/google-cloud-videointelligence/test/gapic-v1beta2.js @@ -49,6 +49,13 @@ describe('VideoIntelligenceServiceClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new videoIntelligenceModule.v1beta2.VideoIntelligenceServiceClient( + {fallback: true} + ); + assert(client); + }); + describe('annotateVideo', function() { it('invokes annotateVideo without error', done => { const client = new videoIntelligenceModule.v1beta2.VideoIntelligenceServiceClient( diff --git a/packages/google-cloud-videointelligence/test/gapic-v1p1beta1.js b/packages/google-cloud-videointelligence/test/gapic-v1p1beta1.js index 241c99a736a..aec9fe858f7 100644 --- a/packages/google-cloud-videointelligence/test/gapic-v1p1beta1.js +++ b/packages/google-cloud-videointelligence/test/gapic-v1p1beta1.js @@ -49,6 +49,13 @@ describe('VideoIntelligenceServiceClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new videoIntelligenceModule.v1p1beta1.VideoIntelligenceServiceClient( + {fallback: true} + ); + assert(client); + }); + describe('annotateVideo', function() { it('invokes annotateVideo without error', done => { const client = new videoIntelligenceModule.v1p1beta1.VideoIntelligenceServiceClient( diff --git a/packages/google-cloud-videointelligence/test/gapic-v1p2beta1.js b/packages/google-cloud-videointelligence/test/gapic-v1p2beta1.js index fe40d3b5a70..d7c132ddd77 100644 --- a/packages/google-cloud-videointelligence/test/gapic-v1p2beta1.js +++ b/packages/google-cloud-videointelligence/test/gapic-v1p2beta1.js @@ -49,6 +49,13 @@ describe('VideoIntelligenceServiceClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new videoIntelligenceModule.v1p2beta1.VideoIntelligenceServiceClient( + {fallback: true} + ); + assert(client); + }); + describe('annotateVideo', function() { it('invokes annotateVideo without error', done => { const client = new videoIntelligenceModule.v1p2beta1.VideoIntelligenceServiceClient( diff --git a/packages/google-cloud-videointelligence/test/gapic-v1p3beta1.js b/packages/google-cloud-videointelligence/test/gapic-v1p3beta1.js index 070c9584db5..cd2f1d4235c 100644 --- a/packages/google-cloud-videointelligence/test/gapic-v1p3beta1.js +++ b/packages/google-cloud-videointelligence/test/gapic-v1p3beta1.js @@ -50,6 +50,13 @@ describe('VideoIntelligenceServiceClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new videoIntelligenceModule.v1p3beta1.VideoIntelligenceServiceClient( + {fallback: true} + ); + assert(client); + }); + describe('annotateVideo', function() { it('invokes annotateVideo without error', done => { const client = new videoIntelligenceModule.v1p3beta1.VideoIntelligenceServiceClient( @@ -178,6 +185,13 @@ describe('StreamingVideoIntelligenceServiceClient', () => { assert(client); }); + it('should create a client with gRPC fallback', () => { + const client = new videoIntelligenceModule.v1p3beta1.StreamingVideoIntelligenceServiceClient( + {fallback: true} + ); + assert(client); + }); + describe('streamingAnnotateVideo', () => { it('invokes streamingAnnotateVideo without error', done => { const client = new videoIntelligenceModule.v1p3beta1.StreamingVideoIntelligenceServiceClient( diff --git a/packages/google-cloud-videointelligence/webpack.config.js b/packages/google-cloud-videointelligence/webpack.config.js new file mode 100644 index 00000000000..ab92bb7f543 --- /dev/null +++ b/packages/google-cloud-videointelligence/webpack.config.js @@ -0,0 +1,46 @@ +// Copyright 2019 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. + +module.exports = { + entry: './src/browser.js', + output: { + library: 'video-intelligence', + filename: './video-intelligence.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + extensions: ['.js', '.json'], + }, + module: { + rules: [ + { + test: /node_modules[\\/]retry-request[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https-proxy-agent[\\/]/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken[\\/]/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +};