From 891eefaa8865796758c3879643ca625b2ba46fb4 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 17 Apr 2024 19:56:41 +0000 Subject: [PATCH] chore(videointelligence/v1): migrate onto non-legacy config PiperOrigin-RevId: 625735306 Source-Link: https://github.com/googleapis/googleapis/commit/ec123eb792cf357847f6d85e4f80fc85e62a53eb Source-Link: https://github.com/googleapis/googleapis-gen/commit/cc295b597d3b5afebe89c9779090ab66725748a8 Copy-Tag: eyJwIjoiVmlkZW9JbnRlbGxpZ2VuY2UvLk93bEJvdC55YW1sIiwiaCI6ImNjMjk1YjU5N2QzYjVhZmViZTg5Yzk3NzkwOTBhYjY2NzI1NzQ4YTgifQ== --- .../V1/VideoIntelligence.php | 271 +++++++ .../V1/AnnotateVideoProgress.php | 69 ++ .../V1/AnnotateVideoRequest.php | 357 +++++++++ .../V1/AnnotateVideoResponse.php | 69 ++ .../V1/DetectedAttribute.php | 143 ++++ .../VideoIntelligence/V1/DetectedLandmark.php | 150 ++++ .../Cloud/VideoIntelligence/V1/Entity.php | 143 ++++ .../V1/ExplicitContentAnnotation.php | 103 +++ .../V1/ExplicitContentDetectionConfig.php | 75 ++ .../V1/ExplicitContentFrame.php | 115 +++ .../VideoIntelligence/V1/FaceAnnotation.php | 136 ++++ .../V1/FaceDetectionAnnotation.php | 135 ++++ .../V1/FaceDetectionConfig.php | 147 ++++ .../Cloud/VideoIntelligence/V1/FaceFrame.php | 124 +++ .../VideoIntelligence/V1/FaceSegment.php | 77 ++ .../Cloud/VideoIntelligence/V1/Feature.php | 110 +++ .../VideoIntelligence/V1/LabelAnnotation.php | 225 ++++++ .../V1/LabelDetectionConfig.php | 267 +++++++ .../V1/LabelDetectionMode.php | 68 ++ .../Cloud/VideoIntelligence/V1/LabelFrame.php | 115 +++ .../VideoIntelligence/V1/LabelSegment.php | 111 +++ .../Cloud/VideoIntelligence/V1/Likelihood.php | 82 ++ .../V1/LogoRecognitionAnnotation.php | 157 ++++ .../V1/NormalizedBoundingBox.php | 171 +++++ .../V1/NormalizedBoundingPoly.php | 81 ++ .../VideoIntelligence/V1/NormalizedVertex.php | 103 +++ .../V1/ObjectTrackingAnnotation.php | 284 +++++++ .../V1/ObjectTrackingConfig.php | 75 ++ .../V1/ObjectTrackingFrame.php | 122 +++ .../V1/PersonDetectionAnnotation.php | 101 +++ .../V1/PersonDetectionConfig.php | 155 ++++ .../V1/ShotChangeDetectionConfig.php | 75 ++ .../VideoIntelligence/V1/SpeechContext.php | 88 +++ .../V1/SpeechRecognitionAlternative.php | 163 ++++ .../V1/SpeechTranscription.php | 121 +++ .../V1/SpeechTranscriptionConfig.php | 447 +++++++++++ .../VideoIntelligence/V1/TextAnnotation.php | 137 ++++ .../V1/TextDetectionConfig.php | 121 +++ .../Cloud/VideoIntelligence/V1/TextFrame.php | 123 +++ .../VideoIntelligence/V1/TextSegment.php | 149 ++++ .../V1/TimestampedObject.php | 195 +++++ .../Cloud/VideoIntelligence/V1/Track.php | 179 +++++ .../V1/VideoAnnotationProgress.php | 283 +++++++ .../V1/VideoAnnotationResults.php | 710 ++++++++++++++++++ .../VideoIntelligence/V1/VideoContext.php | 427 +++++++++++ .../VideoIntelligence/V1/VideoSegment.php | 129 ++++ .../Cloud/VideoIntelligence/V1/WordInfo.php | 281 +++++++ .../annotate_video.php | 72 ++ .../Client/VideoIntelligenceServiceClient.php | 229 ++++++ .../VideoIntelligenceServiceGapicClient.php | 341 +++++++++ .../src/V1/VideoIntelligenceServiceClient.php | 34 + .../v1/src/V1/gapic_metadata.json | 23 + ...eo_intelligence_service_client_config.json | 40 + ...intelligence_service_descriptor_config.php | 39 + ...ntelligence_service_rest_client_config.php | 100 +++ .../VideoIntelligenceServiceClientTest.php | 238 ++++++ .../V1/VideoIntelligenceServiceClientTest.php | 176 +++++ .../V1Beta2/VideoIntelligence.php | Bin 0 -> 5849 bytes .../V1beta2/AnnotateVideoProgress.php | 69 ++ .../V1beta2/AnnotateVideoRequest.php | 327 ++++++++ .../V1beta2/AnnotateVideoResponse.php | 69 ++ .../VideoIntelligence/V1beta2/Entity.php | 143 ++++ .../V1beta2/ExplicitContentAnnotation.php | 69 ++ .../ExplicitContentDetectionConfig.php | 75 ++ .../V1beta2/ExplicitContentFrame.php | 115 +++ .../V1beta2/FaceAnnotation.php | 135 ++++ .../V1beta2/FaceDetectionConfig.php | 109 +++ .../VideoIntelligence/V1beta2/FaceFrame.php | 123 +++ .../VideoIntelligence/V1beta2/FaceSegment.php | 77 ++ .../VideoIntelligence/V1beta2/Feature.php | 75 ++ .../V1beta2/LabelAnnotation.php | 191 +++++ .../V1beta2/LabelDetectionConfig.php | 159 ++++ .../V1beta2/LabelDetectionMode.php | 68 ++ .../VideoIntelligence/V1beta2/LabelFrame.php | 115 +++ .../V1beta2/LabelSegment.php | 111 +++ .../VideoIntelligence/V1beta2/Likelihood.php | 82 ++ .../V1beta2/NormalizedBoundingBox.php | 171 +++++ .../V1beta2/ShotChangeDetectionConfig.php | 75 ++ .../V1beta2/VideoAnnotationProgress.php | 197 +++++ .../V1beta2/VideoAnnotationResults.php | 345 +++++++++ .../V1beta2/VideoContext.php | 251 +++++++ .../V1beta2/VideoSegment.php | 129 ++++ .../annotate_video.php | 84 +++ .../VideoIntelligenceServiceGapicClient.php | 350 +++++++++ .../VideoIntelligenceServiceClient.php | 36 + .../v1beta2/src/V1beta2/gapic_metadata.json | 23 + ...eo_intelligence_service_client_config.json | 31 + ...intelligence_service_descriptor_config.php | 38 + ...ntelligence_service_rest_client_config.php | 100 +++ .../VideoIntelligenceServiceClientTest.php | 182 +++++ 90 files changed, 13385 insertions(+) create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/GPBMetadata/Google/Cloud/Videointelligence/V1/VideoIntelligence.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/AnnotateVideoProgress.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/AnnotateVideoRequest.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/AnnotateVideoResponse.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/DetectedAttribute.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/DetectedLandmark.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Entity.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ExplicitContentAnnotation.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ExplicitContentDetectionConfig.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ExplicitContentFrame.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceAnnotation.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceDetectionAnnotation.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceDetectionConfig.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceFrame.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceSegment.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Feature.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelAnnotation.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelDetectionConfig.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelDetectionMode.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelFrame.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelSegment.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Likelihood.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LogoRecognitionAnnotation.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/NormalizedBoundingBox.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/NormalizedBoundingPoly.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/NormalizedVertex.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ObjectTrackingAnnotation.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ObjectTrackingConfig.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ObjectTrackingFrame.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/PersonDetectionAnnotation.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/PersonDetectionConfig.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ShotChangeDetectionConfig.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechContext.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechRecognitionAlternative.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechTranscription.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechTranscriptionConfig.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextAnnotation.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextDetectionConfig.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextFrame.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextSegment.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TimestampedObject.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Track.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoAnnotationProgress.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoAnnotationResults.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoContext.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoSegment.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/WordInfo.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/samples/V1/VideoIntelligenceServiceClient/annotate_video.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/src/V1/Client/VideoIntelligenceServiceClient.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/src/V1/Gapic/VideoIntelligenceServiceGapicClient.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/src/V1/VideoIntelligenceServiceClient.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/VideoIntelligence/v1/src/V1/resources/video_intelligence_service_client_config.json create mode 100644 owl-bot-staging/VideoIntelligence/v1/src/V1/resources/video_intelligence_service_descriptor_config.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/src/V1/resources/video_intelligence_service_rest_client_config.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/tests/Unit/V1/Client/VideoIntelligenceServiceClientTest.php create mode 100644 owl-bot-staging/VideoIntelligence/v1/tests/Unit/V1/VideoIntelligenceServiceClientTest.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/GPBMetadata/Google/Cloud/Videointelligence/V1Beta2/VideoIntelligence.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/AnnotateVideoProgress.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/AnnotateVideoRequest.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/AnnotateVideoResponse.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/Entity.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ExplicitContentAnnotation.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ExplicitContentDetectionConfig.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ExplicitContentFrame.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceAnnotation.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceDetectionConfig.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceFrame.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceSegment.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/Feature.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelAnnotation.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelDetectionConfig.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelDetectionMode.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelFrame.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelSegment.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/Likelihood.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/NormalizedBoundingBox.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ShotChangeDetectionConfig.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoAnnotationProgress.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoAnnotationResults.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoContext.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoSegment.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/samples/V1beta2/VideoIntelligenceServiceClient/annotate_video.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/Gapic/VideoIntelligenceServiceGapicClient.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/VideoIntelligenceServiceClient.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/gapic_metadata.json create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/resources/video_intelligence_service_client_config.json create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/resources/video_intelligence_service_descriptor_config.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/resources/video_intelligence_service_rest_client_config.php create mode 100644 owl-bot-staging/VideoIntelligence/v1beta2/tests/Unit/V1beta2/VideoIntelligenceServiceClientTest.php diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/GPBMetadata/Google/Cloud/Videointelligence/V1/VideoIntelligence.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/GPBMetadata/Google/Cloud/Videointelligence/V1/VideoIntelligence.php new file mode 100644 index 000000000000..8f9939b79853 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/GPBMetadata/Google/Cloud/Videointelligence/V1/VideoIntelligence.php @@ -0,0 +1,271 @@ +internalAddGeneratedFile( + ' +ÙJ +:google/cloud/videointelligence/v1/video_intelligence.proto!google.cloud.videointelligence.v1google/api/client.protogoogle/api/field_behavior.proto#google/longrunning/operations.protogoogle/protobuf/duration.protogoogle/protobuf/timestamp.protogoogle/rpc/status.proto"þ +AnnotateVideoRequest + input_uri (  + input_content ( A +features (2*.google.cloud.videointelligence.v1.FeatureBàAF + video_context ( 2/.google.cloud.videointelligence.v1.VideoContext + +output_uri ( BàA + location_id ( BàA"Á + VideoContextA +segments ( 2/.google.cloud.videointelligence.v1.VideoSegmentW +label_detection_config ( 27.google.cloud.videointelligence.v1.LabelDetectionConfigb +shot_change_detection_config ( 2<.google.cloud.videointelligence.v1.ShotChangeDetectionConfigl +!explicit_content_detection_config ( 2A.google.cloud.videointelligence.v1.ExplicitContentDetectionConfigU +face_detection_config ( 26.google.cloud.videointelligence.v1.FaceDetectionConfiga +speech_transcription_config ( 2<.google.cloud.videointelligence.v1.SpeechTranscriptionConfigU +text_detection_config ( 26.google.cloud.videointelligence.v1.TextDetectionConfigY +person_detection_config ( 28.google.cloud.videointelligence.v1.PersonDetectionConfigW +object_tracking_config ( 27.google.cloud.videointelligence.v1.ObjectTrackingConfig"Ý +LabelDetectionConfigS +label_detection_mode (25.google.cloud.videointelligence.v1.LabelDetectionMode +stationary_camera ( +model ( " +frame_confidence_threshold (" +video_confidence_threshold ("* +ShotChangeDetectionConfig +model ( "% +ObjectTrackingConfig +model ( "` +FaceDetectionConfig +model (  +include_bounding_boxes ( +include_attributes ("s +PersonDetectionConfig +include_bounding_boxes ( +include_pose_landmarks ( +include_attributes ("/ +ExplicitContentDetectionConfig +model ( "< +TextDetectionConfig +language_hints (  +model ( "x + VideoSegment4 +start_time_offset ( 2.google.protobuf.Duration2 +end_time_offset ( 2.google.protobuf.Duration"d + LabelSegment@ +segment ( 2/.google.cloud.videointelligence.v1.VideoSegment + +confidence ("P + +LabelFrame. + time_offset ( 2.google.protobuf.Duration + +confidence ("G +Entity + entity_id (  + description (  + language_code ( "¥ +LabelAnnotation9 +entity ( 2).google.cloud.videointelligence.v1.EntityD +category_entities ( 2).google.cloud.videointelligence.v1.EntityA +segments ( 2/.google.cloud.videointelligence.v1.LabelSegment= +frames ( 2-.google.cloud.videointelligence.v1.LabelFrame +version ( "• +ExplicitContentFrame. + time_offset ( 2.google.protobuf.DurationM +pornography_likelihood (2-.google.cloud.videointelligence.v1.Likelihood"u +ExplicitContentAnnotationG +frames ( 27.google.cloud.videointelligence.v1.ExplicitContentFrame +version ( "Q +NormalizedBoundingBox +left ( +top ( +right ( +bottom ("w +FaceDetectionAnnotation8 +tracks ( 2(.google.cloud.videointelligence.v1.Track + thumbnail (  +version ( "f +PersonDetectionAnnotation8 +tracks ( 2(.google.cloud.videointelligence.v1.Track +version ( "O + FaceSegment@ +segment ( 2/.google.cloud.videointelligence.v1.VideoSegment"œ + FaceFrame[ +normalized_bounding_boxes ( 28.google.cloud.videointelligence.v1.NormalizedBoundingBox. + time_offset ( 2.google.protobuf.Duration:"§ +FaceAnnotation + thumbnail ( @ +segments ( 2..google.cloud.videointelligence.v1.FaceSegment< +frames ( 2,.google.cloud.videointelligence.v1.FaceFrame:"º +TimestampedObjectY +normalized_bounding_box ( 28.google.cloud.videointelligence.v1.NormalizedBoundingBox. + time_offset ( 2.google.protobuf.DurationM + +attributes ( 24.google.cloud.videointelligence.v1.DetectedAttributeBàAK + landmarks ( 23.google.cloud.videointelligence.v1.DetectedLandmarkBàA"„ +Track@ +segment ( 2/.google.cloud.videointelligence.v1.VideoSegmentQ +timestamped_objects ( 24.google.cloud.videointelligence.v1.TimestampedObjectM + +attributes ( 24.google.cloud.videointelligence.v1.DetectedAttributeBàA + +confidence (BàA"D +DetectedAttribute +name (  + +confidence ( +value ( "x +DetectedLandmark +name ( B +point ( 23.google.cloud.videointelligence.v1.NormalizedVertex + +confidence ("é + +VideoAnnotationResults + input_uri ( @ +segment + ( 2/.google.cloud.videointelligence.v1.VideoSegmentU +segment_label_annotations ( 22.google.cloud.videointelligence.v1.LabelAnnotation^ +"segment_presence_label_annotations ( 22.google.cloud.videointelligence.v1.LabelAnnotationR +shot_label_annotations ( 22.google.cloud.videointelligence.v1.LabelAnnotation[ +shot_presence_label_annotations ( 22.google.cloud.videointelligence.v1.LabelAnnotationS +frame_label_annotations ( 22.google.cloud.videointelligence.v1.LabelAnnotationO +face_annotations ( 21.google.cloud.videointelligence.v1.FaceAnnotationB^ +face_detection_annotations ( 2:.google.cloud.videointelligence.v1.FaceDetectionAnnotationI +shot_annotations ( 2/.google.cloud.videointelligence.v1.VideoSegmentY +explicit_annotation ( 2<.google.cloud.videointelligence.v1.ExplicitContentAnnotationU +speech_transcriptions ( 26.google.cloud.videointelligence.v1.SpeechTranscriptionK +text_annotations ( 21.google.cloud.videointelligence.v1.TextAnnotationW +object_annotations ( 2;.google.cloud.videointelligence.v1.ObjectTrackingAnnotationb +logo_recognition_annotations ( 2<.google.cloud.videointelligence.v1.LogoRecognitionAnnotationb +person_detection_annotations ( 2<.google.cloud.videointelligence.v1.PersonDetectionAnnotation! +error ( 2.google.rpc.Status"n +AnnotateVideoResponseU +annotation_results ( 29.google.cloud.videointelligence.v1.VideoAnnotationResults"¦ +VideoAnnotationProgress + input_uri (  +progress_percent (. + +start_time ( 2.google.protobuf.Timestamp/ + update_time ( 2.google.protobuf.Timestamp; +feature (2*.google.cloud.videointelligence.v1.Feature@ +segment ( 2/.google.cloud.videointelligence.v1.VideoSegment"p +AnnotateVideoProgressW +annotation_progress ( 2:.google.cloud.videointelligence.v1.VideoAnnotationProgress" +SpeechTranscriptionConfig + language_code ( BàA +max_alternatives (BàA +filter_profanity (BàAN +speech_contexts ( 20.google.cloud.videointelligence.v1.SpeechContextBàA) +enable_automatic_punctuation (BàA + audio_tracks (BàA\' +enable_speaker_diarization (BàA& +diarization_speaker_count (BàA# +enable_word_confidence (BàA"% + SpeechContext +phrases ( BàA"ˆ +SpeechTranscriptionU + alternatives ( 2?.google.cloud.videointelligence.v1.SpeechRecognitionAlternative + language_code ( BàA"Œ +SpeechRecognitionAlternative + +transcript (  + +confidence (BàA? +words ( 2+.google.cloud.videointelligence.v1.WordInfoBàA"§ +WordInfo- + +start_time ( 2.google.protobuf.Duration+ +end_time ( 2.google.protobuf.Duration +word (  + +confidence (BàA + speaker_tag (BàA"( +NormalizedVertex +x ( +y ("_ +NormalizedBoundingPolyE +vertices ( 23.google.cloud.videointelligence.v1.NormalizedVertex"¡ + TextSegment@ +segment ( 2/.google.cloud.videointelligence.v1.VideoSegment + +confidence (< +frames ( 2,.google.cloud.videointelligence.v1.TextFrame"” + TextFrameW +rotated_bounding_box ( 29.google.cloud.videointelligence.v1.NormalizedBoundingPoly. + time_offset ( 2.google.protobuf.Duration"q +TextAnnotation +text ( @ +segments ( 2..google.cloud.videointelligence.v1.TextSegment +version ( "  +ObjectTrackingFrameY +normalized_bounding_box ( 28.google.cloud.videointelligence.v1.NormalizedBoundingBox. + time_offset ( 2.google.protobuf.Duration"¨ +ObjectTrackingAnnotationB +segment ( 2/.google.cloud.videointelligence.v1.VideoSegmentH +track_id (H9 +entity ( 2).google.cloud.videointelligence.v1.Entity + +confidence (F +frames ( 26.google.cloud.videointelligence.v1.ObjectTrackingFrame +version ( B + +track_info"Ó +LogoRecognitionAnnotation9 +entity ( 2).google.cloud.videointelligence.v1.Entity8 +tracks ( 2(.google.cloud.videointelligence.v1.TrackA +segments ( 2/.google.cloud.videointelligence.v1.VideoSegment*õ +Feature +FEATURE_UNSPECIFIED +LABEL_DETECTION +SHOT_CHANGE_DETECTION +EXPLICIT_CONTENT_DETECTION +FACE_DETECTION +SPEECH_TRANSCRIPTION +TEXT_DETECTION +OBJECT_TRACKING  +LOGO_RECOGNITION  +PERSON_DETECTION*r +LabelDetectionMode$ + LABEL_DETECTION_MODE_UNSPECIFIED + SHOT_MODE + +FRAME_MODE +SHOT_AND_FRAME_MODE*t + +Likelihood +LIKELIHOOD_UNSPECIFIED + VERY_UNLIKELY +UNLIKELY +POSSIBLE + +LIKELY + VERY_LIKELY2À +VideoIntelligenceServiceÍ + AnnotateVideo7.google.cloud.videointelligence.v1.AnnotateVideoRequest.google.longrunning.Operation"dÊA. +AnnotateVideoResponseAnnotateVideoProgressÚAinput_uri,features‚Óä“"/v1/videos:annotate:*TÊA videointelligence.googleapis.comÒA.https://www.googleapis.com/auth/cloud-platformBŒ +%com.google.cloud.videointelligence.v1BVideoIntelligenceServiceProtoPZScloud.google.com/go/videointelligence/apiv1/videointelligencepb;videointelligencepbª!Google.Cloud.VideoIntelligence.V1Ê!Google\\Cloud\\VideoIntelligence\\V1ê$Google::Cloud::VideoIntelligence::V1bproto3' + , true); + + static::$is_initialized = true; + } +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/AnnotateVideoProgress.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/AnnotateVideoProgress.php new file mode 100644 index 000000000000..9018fd0c861f --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/AnnotateVideoProgress.php @@ -0,0 +1,69 @@ +google.cloud.videointelligence.v1.AnnotateVideoProgress + */ +class AnnotateVideoProgress extends \Google\Protobuf\Internal\Message +{ + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoAnnotationProgress annotation_progress = 1; + */ + private $annotation_progress; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1\VideoAnnotationProgress>|\Google\Protobuf\Internal\RepeatedField $annotation_progress + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoAnnotationProgress annotation_progress = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnnotationProgress() + { + return $this->annotation_progress; + } + + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoAnnotationProgress annotation_progress = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1\VideoAnnotationProgress>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnnotationProgress($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\VideoAnnotationProgress::class); + $this->annotation_progress = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/AnnotateVideoRequest.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/AnnotateVideoRequest.php new file mode 100644 index 000000000000..a83044c1c487 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/AnnotateVideoRequest.php @@ -0,0 +1,357 @@ +google.cloud.videointelligence.v1.AnnotateVideoRequest + */ +class AnnotateVideoRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Input video location. Currently, only + * [Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported. URIs must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). To identify + * multiple videos, a video URI may include wildcards in the `object-id`. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` must be unset. + * + * Generated from protobuf field string input_uri = 1; + */ + protected $input_uri = ''; + /** + * The video data bytes. + * If unset, the input video(s) should be specified via the `input_uri`. + * If set, `input_uri` must be unset. + * + * Generated from protobuf field bytes input_content = 6; + */ + protected $input_content = ''; + /** + * Required. Requested video annotation features. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Feature features = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $features; + /** + * Additional video context and/or feature-specific parameters. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoContext video_context = 3; + */ + protected $video_context = null; + /** + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported. These must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * + * Generated from protobuf field string output_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $output_uri = ''; + /** + * Optional. Cloud region where annotation should take place. Supported cloud + * regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + * region is specified, the region will be determined based on video file + * location. + * + * Generated from protobuf field string location_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $location_id = ''; + + /** + * @param string $inputUri Input video location. Currently, only + * [Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported. URIs must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). To identify + * multiple videos, a video URI may include wildcards in the `object-id`. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` must be unset. + * @param int[] $features Required. Requested video annotation features. + * For allowed values, use constants defined on {@see \Google\Cloud\VideoIntelligence\V1\Feature} + * + * @return \Google\Cloud\VideoIntelligence\V1\AnnotateVideoRequest + * + * @experimental + */ + public static function build(string $inputUri, array $features): self + { + return (new self()) + ->setInputUri($inputUri) + ->setFeatures($features); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $input_uri + * Input video location. Currently, only + * [Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported. URIs must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). To identify + * multiple videos, a video URI may include wildcards in the `object-id`. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` must be unset. + * @type string $input_content + * The video data bytes. + * If unset, the input video(s) should be specified via the `input_uri`. + * If set, `input_uri` must be unset. + * @type array|\Google\Protobuf\Internal\RepeatedField $features + * Required. Requested video annotation features. + * @type \Google\Cloud\VideoIntelligence\V1\VideoContext $video_context + * Additional video context and/or feature-specific parameters. + * @type string $output_uri + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported. These must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * @type string $location_id + * Optional. Cloud region where annotation should take place. Supported cloud + * regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + * region is specified, the region will be determined based on video file + * location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Input video location. Currently, only + * [Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported. URIs must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). To identify + * multiple videos, a video URI may include wildcards in the `object-id`. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` must be unset. + * + * Generated from protobuf field string input_uri = 1; + * @return string + */ + public function getInputUri() + { + return $this->input_uri; + } + + /** + * Input video location. Currently, only + * [Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported. URIs must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). To identify + * multiple videos, a video URI may include wildcards in the `object-id`. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` must be unset. + * + * Generated from protobuf field string input_uri = 1; + * @param string $var + * @return $this + */ + public function setInputUri($var) + { + GPBUtil::checkString($var, True); + $this->input_uri = $var; + + return $this; + } + + /** + * The video data bytes. + * If unset, the input video(s) should be specified via the `input_uri`. + * If set, `input_uri` must be unset. + * + * Generated from protobuf field bytes input_content = 6; + * @return string + */ + public function getInputContent() + { + return $this->input_content; + } + + /** + * The video data bytes. + * If unset, the input video(s) should be specified via the `input_uri`. + * If set, `input_uri` must be unset. + * + * Generated from protobuf field bytes input_content = 6; + * @param string $var + * @return $this + */ + public function setInputContent($var) + { + GPBUtil::checkString($var, False); + $this->input_content = $var; + + return $this; + } + + /** + * Required. Requested video annotation features. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Feature features = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFeatures() + { + return $this->features; + } + + /** + * Required. Requested video annotation features. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Feature features = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\VideoIntelligence\V1\Feature::class); + $this->features = $arr; + + return $this; + } + + /** + * Additional video context and/or feature-specific parameters. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoContext video_context = 3; + * @return \Google\Cloud\VideoIntelligence\V1\VideoContext|null + */ + public function getVideoContext() + { + return $this->video_context; + } + + public function hasVideoContext() + { + return isset($this->video_context); + } + + public function clearVideoContext() + { + unset($this->video_context); + } + + /** + * Additional video context and/or feature-specific parameters. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoContext video_context = 3; + * @param \Google\Cloud\VideoIntelligence\V1\VideoContext $var + * @return $this + */ + public function setVideoContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\VideoContext::class); + $this->video_context = $var; + + return $this; + } + + /** + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported. These must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * + * Generated from protobuf field string output_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOutputUri() + { + return $this->output_uri; + } + + /** + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported. These must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * + * Generated from protobuf field string output_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOutputUri($var) + { + GPBUtil::checkString($var, True); + $this->output_uri = $var; + + return $this; + } + + /** + * Optional. Cloud region where annotation should take place. Supported cloud + * regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + * region is specified, the region will be determined based on video file + * location. + * + * Generated from protobuf field string location_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLocationId() + { + return $this->location_id; + } + + /** + * Optional. Cloud region where annotation should take place. Supported cloud + * regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + * region is specified, the region will be determined based on video file + * location. + * + * Generated from protobuf field string location_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLocationId($var) + { + GPBUtil::checkString($var, True); + $this->location_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/AnnotateVideoResponse.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/AnnotateVideoResponse.php new file mode 100644 index 000000000000..25d2c7cf89de --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/AnnotateVideoResponse.php @@ -0,0 +1,69 @@ +google.cloud.videointelligence.v1.AnnotateVideoResponse + */ +class AnnotateVideoResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoAnnotationResults annotation_results = 1; + */ + private $annotation_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1\VideoAnnotationResults>|\Google\Protobuf\Internal\RepeatedField $annotation_results + * Annotation results for all videos specified in `AnnotateVideoRequest`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoAnnotationResults annotation_results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnnotationResults() + { + return $this->annotation_results; + } + + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoAnnotationResults annotation_results = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1\VideoAnnotationResults>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnnotationResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\VideoAnnotationResults::class); + $this->annotation_results = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/DetectedAttribute.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/DetectedAttribute.php new file mode 100644 index 000000000000..a3869d67c043 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/DetectedAttribute.php @@ -0,0 +1,143 @@ +google.cloud.videointelligence.v1.DetectedAttribute + */ +class DetectedAttribute extends \Google\Protobuf\Internal\Message +{ + /** + * The name of the attribute, for example, glasses, dark_glasses, mouth_open. + * A full list of supported type names will be provided in the document. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * Detected attribute confidence. Range [0, 1]. + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + /** + * Text value of the detection result. For example, the value for "HairColor" + * can be "black", "blonde", etc. + * + * Generated from protobuf field string value = 3; + */ + protected $value = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of the attribute, for example, glasses, dark_glasses, mouth_open. + * A full list of supported type names will be provided in the document. + * @type float $confidence + * Detected attribute confidence. Range [0, 1]. + * @type string $value + * Text value of the detection result. For example, the value for "HairColor" + * can be "black", "blonde", etc. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * The name of the attribute, for example, glasses, dark_glasses, mouth_open. + * A full list of supported type names will be provided in the document. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of the attribute, for example, glasses, dark_glasses, mouth_open. + * A full list of supported type names will be provided in the document. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Detected attribute confidence. Range [0, 1]. + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Detected attribute confidence. Range [0, 1]. + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * Text value of the detection result. For example, the value for "HairColor" + * can be "black", "blonde", etc. + * + * Generated from protobuf field string value = 3; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Text value of the detection result. For example, the value for "HairColor" + * can be "black", "blonde", etc. + * + * Generated from protobuf field string value = 3; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/DetectedLandmark.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/DetectedLandmark.php new file mode 100644 index 000000000000..50f56b1a634b --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/DetectedLandmark.php @@ -0,0 +1,150 @@ +google.cloud.videointelligence.v1.DetectedLandmark + */ +class DetectedLandmark extends \Google\Protobuf\Internal\Message +{ + /** + * The name of this landmark, for example, left_hand, right_shoulder. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The 2D point of the detected landmark using the normalized image + * coordindate system. The normalized coordinates have the range from 0 to 1. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.NormalizedVertex point = 2; + */ + protected $point = null; + /** + * The confidence score of the detected landmark. Range [0, 1]. + * + * Generated from protobuf field float confidence = 3; + */ + protected $confidence = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The name of this landmark, for example, left_hand, right_shoulder. + * @type \Google\Cloud\VideoIntelligence\V1\NormalizedVertex $point + * The 2D point of the detected landmark using the normalized image + * coordindate system. The normalized coordinates have the range from 0 to 1. + * @type float $confidence + * The confidence score of the detected landmark. Range [0, 1]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * The name of this landmark, for example, left_hand, right_shoulder. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The name of this landmark, for example, left_hand, right_shoulder. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The 2D point of the detected landmark using the normalized image + * coordindate system. The normalized coordinates have the range from 0 to 1. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.NormalizedVertex point = 2; + * @return \Google\Cloud\VideoIntelligence\V1\NormalizedVertex|null + */ + public function getPoint() + { + return $this->point; + } + + public function hasPoint() + { + return isset($this->point); + } + + public function clearPoint() + { + unset($this->point); + } + + /** + * The 2D point of the detected landmark using the normalized image + * coordindate system. The normalized coordinates have the range from 0 to 1. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.NormalizedVertex point = 2; + * @param \Google\Cloud\VideoIntelligence\V1\NormalizedVertex $var + * @return $this + */ + public function setPoint($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\NormalizedVertex::class); + $this->point = $var; + + return $this; + } + + /** + * The confidence score of the detected landmark. Range [0, 1]. + * + * Generated from protobuf field float confidence = 3; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * The confidence score of the detected landmark. Range [0, 1]. + * + * Generated from protobuf field float confidence = 3; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Entity.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Entity.php new file mode 100644 index 000000000000..d62bc773e7d4 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Entity.php @@ -0,0 +1,143 @@ +google.cloud.videointelligence.v1.Entity + */ +class Entity extends \Google\Protobuf\Internal\Message +{ + /** + * Opaque entity ID. Some IDs may be available in + * [Google Knowledge Graph Search + * API](https://developers.google.com/knowledge-graph/). + * + * Generated from protobuf field string entity_id = 1; + */ + protected $entity_id = ''; + /** + * Textual description, e.g., `Fixed-gear bicycle`. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Language code for `description` in BCP-47 format. + * + * Generated from protobuf field string language_code = 3; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $entity_id + * Opaque entity ID. Some IDs may be available in + * [Google Knowledge Graph Search + * API](https://developers.google.com/knowledge-graph/). + * @type string $description + * Textual description, e.g., `Fixed-gear bicycle`. + * @type string $language_code + * Language code for `description` in BCP-47 format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Opaque entity ID. Some IDs may be available in + * [Google Knowledge Graph Search + * API](https://developers.google.com/knowledge-graph/). + * + * Generated from protobuf field string entity_id = 1; + * @return string + */ + public function getEntityId() + { + return $this->entity_id; + } + + /** + * Opaque entity ID. Some IDs may be available in + * [Google Knowledge Graph Search + * API](https://developers.google.com/knowledge-graph/). + * + * Generated from protobuf field string entity_id = 1; + * @param string $var + * @return $this + */ + public function setEntityId($var) + { + GPBUtil::checkString($var, True); + $this->entity_id = $var; + + return $this; + } + + /** + * Textual description, e.g., `Fixed-gear bicycle`. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Textual description, e.g., `Fixed-gear bicycle`. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Language code for `description` in BCP-47 format. + * + * Generated from protobuf field string language_code = 3; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Language code for `description` in BCP-47 format. + * + * Generated from protobuf field string language_code = 3; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ExplicitContentAnnotation.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ExplicitContentAnnotation.php new file mode 100644 index 000000000000..dabb7a061483 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ExplicitContentAnnotation.php @@ -0,0 +1,103 @@ +google.cloud.videointelligence.v1.ExplicitContentAnnotation + */ +class ExplicitContentAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * All video frames where explicit content was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.ExplicitContentFrame frames = 1; + */ + private $frames; + /** + * Feature version. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1\ExplicitContentFrame>|\Google\Protobuf\Internal\RepeatedField $frames + * All video frames where explicit content was detected. + * @type string $version + * Feature version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * All video frames where explicit content was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.ExplicitContentFrame frames = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrames() + { + return $this->frames; + } + + /** + * All video frames where explicit content was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.ExplicitContentFrame frames = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1\ExplicitContentFrame>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\ExplicitContentFrame::class); + $this->frames = $arr; + + return $this; + } + + /** + * Feature version. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Feature version. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ExplicitContentDetectionConfig.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ExplicitContentDetectionConfig.php new file mode 100644 index 000000000000..582cd1808f9f --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ExplicitContentDetectionConfig.php @@ -0,0 +1,75 @@ +google.cloud.videointelligence.v1.ExplicitContentDetectionConfig + */ +class ExplicitContentDetectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Model to use for explicit content detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + */ + protected $model = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Model to use for explicit content detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Model to use for explicit content detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Model to use for explicit content detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ExplicitContentFrame.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ExplicitContentFrame.php new file mode 100644 index 000000000000..9d249b46301c --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ExplicitContentFrame.php @@ -0,0 +1,115 @@ +google.cloud.videointelligence.v1.ExplicitContentFrame + */ +class ExplicitContentFrame extends \Google\Protobuf\Internal\Message +{ + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 1; + */ + protected $time_offset = null; + /** + * Likelihood of the pornography content.. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Likelihood pornography_likelihood = 2; + */ + protected $pornography_likelihood = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $time_offset + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * @type int $pornography_likelihood + * Likelihood of the pornography content.. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeOffset() + { + return $this->time_offset; + } + + public function hasTimeOffset() + { + return isset($this->time_offset); + } + + public function clearTimeOffset() + { + unset($this->time_offset); + } + + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->time_offset = $var; + + return $this; + } + + /** + * Likelihood of the pornography content.. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Likelihood pornography_likelihood = 2; + * @return int + */ + public function getPornographyLikelihood() + { + return $this->pornography_likelihood; + } + + /** + * Likelihood of the pornography content.. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Likelihood pornography_likelihood = 2; + * @param int $var + * @return $this + */ + public function setPornographyLikelihood($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VideoIntelligence\V1\Likelihood::class); + $this->pornography_likelihood = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceAnnotation.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceAnnotation.php new file mode 100644 index 000000000000..6c8796da5c58 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceAnnotation.php @@ -0,0 +1,136 @@ +google.cloud.videointelligence.v1.FaceAnnotation + */ +class FaceAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Thumbnail of a representative face view (in JPEG format). + * + * Generated from protobuf field bytes thumbnail = 1; + */ + protected $thumbnail = ''; + /** + * All video segments where a face was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.FaceSegment segments = 2; + */ + private $segments; + /** + * All video frames where a face was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.FaceFrame frames = 3; + */ + private $frames; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $thumbnail + * Thumbnail of a representative face view (in JPEG format). + * @type array<\Google\Cloud\VideoIntelligence\V1\FaceSegment>|\Google\Protobuf\Internal\RepeatedField $segments + * All video segments where a face was detected. + * @type array<\Google\Cloud\VideoIntelligence\V1\FaceFrame>|\Google\Protobuf\Internal\RepeatedField $frames + * All video frames where a face was detected. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Thumbnail of a representative face view (in JPEG format). + * + * Generated from protobuf field bytes thumbnail = 1; + * @return string + */ + public function getThumbnail() + { + return $this->thumbnail; + } + + /** + * Thumbnail of a representative face view (in JPEG format). + * + * Generated from protobuf field bytes thumbnail = 1; + * @param string $var + * @return $this + */ + public function setThumbnail($var) + { + GPBUtil::checkString($var, False); + $this->thumbnail = $var; + + return $this; + } + + /** + * All video segments where a face was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.FaceSegment segments = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSegments() + { + return $this->segments; + } + + /** + * All video segments where a face was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.FaceSegment segments = 2; + * @param array<\Google\Cloud\VideoIntelligence\V1\FaceSegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSegments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\FaceSegment::class); + $this->segments = $arr; + + return $this; + } + + /** + * All video frames where a face was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.FaceFrame frames = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrames() + { + return $this->frames; + } + + /** + * All video frames where a face was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.FaceFrame frames = 3; + * @param array<\Google\Cloud\VideoIntelligence\V1\FaceFrame>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\FaceFrame::class); + $this->frames = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceDetectionAnnotation.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceDetectionAnnotation.php new file mode 100644 index 000000000000..ebbbbc2c5152 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceDetectionAnnotation.php @@ -0,0 +1,135 @@ +google.cloud.videointelligence.v1.FaceDetectionAnnotation + */ +class FaceDetectionAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * The face tracks with attributes. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Track tracks = 3; + */ + private $tracks; + /** + * The thumbnail of a person's face. + * + * Generated from protobuf field bytes thumbnail = 4; + */ + protected $thumbnail = ''; + /** + * Feature version. + * + * Generated from protobuf field string version = 5; + */ + protected $version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1\Track>|\Google\Protobuf\Internal\RepeatedField $tracks + * The face tracks with attributes. + * @type string $thumbnail + * The thumbnail of a person's face. + * @type string $version + * Feature version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * The face tracks with attributes. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Track tracks = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTracks() + { + return $this->tracks; + } + + /** + * The face tracks with attributes. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Track tracks = 3; + * @param array<\Google\Cloud\VideoIntelligence\V1\Track>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTracks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\Track::class); + $this->tracks = $arr; + + return $this; + } + + /** + * The thumbnail of a person's face. + * + * Generated from protobuf field bytes thumbnail = 4; + * @return string + */ + public function getThumbnail() + { + return $this->thumbnail; + } + + /** + * The thumbnail of a person's face. + * + * Generated from protobuf field bytes thumbnail = 4; + * @param string $var + * @return $this + */ + public function setThumbnail($var) + { + GPBUtil::checkString($var, False); + $this->thumbnail = $var; + + return $this; + } + + /** + * Feature version. + * + * Generated from protobuf field string version = 5; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Feature version. + * + * Generated from protobuf field string version = 5; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceDetectionConfig.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceDetectionConfig.php new file mode 100644 index 000000000000..4ff17755b38e --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceDetectionConfig.php @@ -0,0 +1,147 @@ +google.cloud.videointelligence.v1.FaceDetectionConfig + */ +class FaceDetectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Model to use for face detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + */ + protected $model = ''; + /** + * Whether bounding boxes are included in the face annotation output. + * + * Generated from protobuf field bool include_bounding_boxes = 2; + */ + protected $include_bounding_boxes = false; + /** + * Whether to enable face attributes detection, such as glasses, dark_glasses, + * mouth_open etc. Ignored if 'include_bounding_boxes' is set to false. + * + * Generated from protobuf field bool include_attributes = 5; + */ + protected $include_attributes = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Model to use for face detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * @type bool $include_bounding_boxes + * Whether bounding boxes are included in the face annotation output. + * @type bool $include_attributes + * Whether to enable face attributes detection, such as glasses, dark_glasses, + * mouth_open etc. Ignored if 'include_bounding_boxes' is set to false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Model to use for face detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Model to use for face detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * Whether bounding boxes are included in the face annotation output. + * + * Generated from protobuf field bool include_bounding_boxes = 2; + * @return bool + */ + public function getIncludeBoundingBoxes() + { + return $this->include_bounding_boxes; + } + + /** + * Whether bounding boxes are included in the face annotation output. + * + * Generated from protobuf field bool include_bounding_boxes = 2; + * @param bool $var + * @return $this + */ + public function setIncludeBoundingBoxes($var) + { + GPBUtil::checkBool($var); + $this->include_bounding_boxes = $var; + + return $this; + } + + /** + * Whether to enable face attributes detection, such as glasses, dark_glasses, + * mouth_open etc. Ignored if 'include_bounding_boxes' is set to false. + * + * Generated from protobuf field bool include_attributes = 5; + * @return bool + */ + public function getIncludeAttributes() + { + return $this->include_attributes; + } + + /** + * Whether to enable face attributes detection, such as glasses, dark_glasses, + * mouth_open etc. Ignored if 'include_bounding_boxes' is set to false. + * + * Generated from protobuf field bool include_attributes = 5; + * @param bool $var + * @return $this + */ + public function setIncludeAttributes($var) + { + GPBUtil::checkBool($var); + $this->include_attributes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceFrame.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceFrame.php new file mode 100644 index 000000000000..32de97e8e348 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceFrame.php @@ -0,0 +1,124 @@ +google.cloud.videointelligence.v1.FaceFrame + */ +class FaceFrame extends \Google\Protobuf\Internal\Message +{ + /** + * Normalized Bounding boxes in a frame. + * There can be more than one boxes if the same face is detected in multiple + * locations within the current frame. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.NormalizedBoundingBox normalized_bounding_boxes = 1; + */ + private $normalized_bounding_boxes; + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + */ + protected $time_offset = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox>|\Google\Protobuf\Internal\RepeatedField $normalized_bounding_boxes + * Normalized Bounding boxes in a frame. + * There can be more than one boxes if the same face is detected in multiple + * locations within the current frame. + * @type \Google\Protobuf\Duration $time_offset + * Time-offset, relative to the beginning of the video, + * corresponding to the video frame for this location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Normalized Bounding boxes in a frame. + * There can be more than one boxes if the same face is detected in multiple + * locations within the current frame. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.NormalizedBoundingBox normalized_bounding_boxes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNormalizedBoundingBoxes() + { + return $this->normalized_bounding_boxes; + } + + /** + * Normalized Bounding boxes in a frame. + * There can be more than one boxes if the same face is detected in multiple + * locations within the current frame. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.NormalizedBoundingBox normalized_bounding_boxes = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNormalizedBoundingBoxes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox::class); + $this->normalized_bounding_boxes = $arr; + + return $this; + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeOffset() + { + return $this->time_offset; + } + + public function hasTimeOffset() + { + return isset($this->time_offset); + } + + public function clearTimeOffset() + { + unset($this->time_offset); + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->time_offset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceSegment.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceSegment.php new file mode 100644 index 000000000000..66e742d5504b --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/FaceSegment.php @@ -0,0 +1,77 @@ +google.cloud.videointelligence.v1.FaceSegment + */ +class FaceSegment extends \Google\Protobuf\Internal\Message +{ + /** + * Video segment where a face was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 1; + */ + protected $segment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1\VideoSegment $segment + * Video segment where a face was detected. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Video segment where a face was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 1; + * @return \Google\Cloud\VideoIntelligence\V1\VideoSegment|null + */ + public function getSegment() + { + return $this->segment; + } + + public function hasSegment() + { + return isset($this->segment); + } + + public function clearSegment() + { + unset($this->segment); + } + + /** + * Video segment where a face was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 1; + * @param \Google\Cloud\VideoIntelligence\V1\VideoSegment $var + * @return $this + */ + public function setSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\VideoSegment::class); + $this->segment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Feature.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Feature.php new file mode 100644 index 000000000000..6a3a2b4518c5 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Feature.php @@ -0,0 +1,110 @@ +google.cloud.videointelligence.v1.Feature + */ +class Feature +{ + /** + * Unspecified. + * + * Generated from protobuf enum FEATURE_UNSPECIFIED = 0; + */ + const FEATURE_UNSPECIFIED = 0; + /** + * Label detection. Detect objects, such as dog or flower. + * + * Generated from protobuf enum LABEL_DETECTION = 1; + */ + const LABEL_DETECTION = 1; + /** + * Shot change detection. + * + * Generated from protobuf enum SHOT_CHANGE_DETECTION = 2; + */ + const SHOT_CHANGE_DETECTION = 2; + /** + * Explicit content detection. + * + * Generated from protobuf enum EXPLICIT_CONTENT_DETECTION = 3; + */ + const EXPLICIT_CONTENT_DETECTION = 3; + /** + * Human face detection. + * + * Generated from protobuf enum FACE_DETECTION = 4; + */ + const FACE_DETECTION = 4; + /** + * Speech transcription. + * + * Generated from protobuf enum SPEECH_TRANSCRIPTION = 6; + */ + const SPEECH_TRANSCRIPTION = 6; + /** + * OCR text detection and tracking. + * + * Generated from protobuf enum TEXT_DETECTION = 7; + */ + const TEXT_DETECTION = 7; + /** + * Object detection and tracking. + * + * Generated from protobuf enum OBJECT_TRACKING = 9; + */ + const OBJECT_TRACKING = 9; + /** + * Logo detection, tracking, and recognition. + * + * Generated from protobuf enum LOGO_RECOGNITION = 12; + */ + const LOGO_RECOGNITION = 12; + /** + * Person detection. + * + * Generated from protobuf enum PERSON_DETECTION = 14; + */ + const PERSON_DETECTION = 14; + + private static $valueToName = [ + self::FEATURE_UNSPECIFIED => 'FEATURE_UNSPECIFIED', + self::LABEL_DETECTION => 'LABEL_DETECTION', + self::SHOT_CHANGE_DETECTION => 'SHOT_CHANGE_DETECTION', + self::EXPLICIT_CONTENT_DETECTION => 'EXPLICIT_CONTENT_DETECTION', + self::FACE_DETECTION => 'FACE_DETECTION', + self::SPEECH_TRANSCRIPTION => 'SPEECH_TRANSCRIPTION', + self::TEXT_DETECTION => 'TEXT_DETECTION', + self::OBJECT_TRACKING => 'OBJECT_TRACKING', + self::LOGO_RECOGNITION => 'LOGO_RECOGNITION', + self::PERSON_DETECTION => 'PERSON_DETECTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelAnnotation.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelAnnotation.php new file mode 100644 index 000000000000..5c9afbaef898 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelAnnotation.php @@ -0,0 +1,225 @@ +google.cloud.videointelligence.v1.LabelAnnotation + */ +class LabelAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Detected entity. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Entity entity = 1; + */ + protected $entity = null; + /** + * Common categories for the detected entity. + * For example, when the label is `Terrier`, the category is likely `dog`. And + * in some cases there might be more than one categories e.g., `Terrier` could + * also be a `pet`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Entity category_entities = 2; + */ + private $category_entities; + /** + * All video segments where a label was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelSegment segments = 3; + */ + private $segments; + /** + * All video frames where a label was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelFrame frames = 4; + */ + private $frames; + /** + * Feature version. + * + * Generated from protobuf field string version = 5; + */ + protected $version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1\Entity $entity + * Detected entity. + * @type array<\Google\Cloud\VideoIntelligence\V1\Entity>|\Google\Protobuf\Internal\RepeatedField $category_entities + * Common categories for the detected entity. + * For example, when the label is `Terrier`, the category is likely `dog`. And + * in some cases there might be more than one categories e.g., `Terrier` could + * also be a `pet`. + * @type array<\Google\Cloud\VideoIntelligence\V1\LabelSegment>|\Google\Protobuf\Internal\RepeatedField $segments + * All video segments where a label was detected. + * @type array<\Google\Cloud\VideoIntelligence\V1\LabelFrame>|\Google\Protobuf\Internal\RepeatedField $frames + * All video frames where a label was detected. + * @type string $version + * Feature version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Detected entity. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Entity entity = 1; + * @return \Google\Cloud\VideoIntelligence\V1\Entity|null + */ + public function getEntity() + { + return $this->entity; + } + + public function hasEntity() + { + return isset($this->entity); + } + + public function clearEntity() + { + unset($this->entity); + } + + /** + * Detected entity. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Entity entity = 1; + * @param \Google\Cloud\VideoIntelligence\V1\Entity $var + * @return $this + */ + public function setEntity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\Entity::class); + $this->entity = $var; + + return $this; + } + + /** + * Common categories for the detected entity. + * For example, when the label is `Terrier`, the category is likely `dog`. And + * in some cases there might be more than one categories e.g., `Terrier` could + * also be a `pet`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Entity category_entities = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCategoryEntities() + { + return $this->category_entities; + } + + /** + * Common categories for the detected entity. + * For example, when the label is `Terrier`, the category is likely `dog`. And + * in some cases there might be more than one categories e.g., `Terrier` could + * also be a `pet`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Entity category_entities = 2; + * @param array<\Google\Cloud\VideoIntelligence\V1\Entity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCategoryEntities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\Entity::class); + $this->category_entities = $arr; + + return $this; + } + + /** + * All video segments where a label was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelSegment segments = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSegments() + { + return $this->segments; + } + + /** + * All video segments where a label was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelSegment segments = 3; + * @param array<\Google\Cloud\VideoIntelligence\V1\LabelSegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSegments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\LabelSegment::class); + $this->segments = $arr; + + return $this; + } + + /** + * All video frames where a label was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelFrame frames = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrames() + { + return $this->frames; + } + + /** + * All video frames where a label was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelFrame frames = 4; + * @param array<\Google\Cloud\VideoIntelligence\V1\LabelFrame>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\LabelFrame::class); + $this->frames = $arr; + + return $this; + } + + /** + * Feature version. + * + * Generated from protobuf field string version = 5; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Feature version. + * + * Generated from protobuf field string version = 5; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelDetectionConfig.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelDetectionConfig.php new file mode 100644 index 000000000000..b51b3128785f --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelDetectionConfig.php @@ -0,0 +1,267 @@ +google.cloud.videointelligence.v1.LabelDetectionConfig + */ +class LabelDetectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * What labels should be detected with LABEL_DETECTION, in addition to + * video-level labels or segment-level labels. + * If unspecified, defaults to `SHOT_MODE`. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.LabelDetectionMode label_detection_mode = 1; + */ + protected $label_detection_mode = 0; + /** + * Whether the video has been shot from a stationary (i.e., non-moving) + * camera. When set to true, might improve detection accuracy for moving + * objects. Should be used with `SHOT_AND_FRAME_MODE` enabled. + * + * Generated from protobuf field bool stationary_camera = 2; + */ + protected $stationary_camera = false; + /** + * Model to use for label detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 3; + */ + protected $model = ''; + /** + * The confidence threshold we perform filtering on the labels from + * frame-level detection. If not set, it is set to 0.4 by default. The valid + * range for this threshold is [0.1, 0.9]. Any value set outside of this + * range will be clipped. + * Note: For best results, follow the default threshold. We will update + * the default threshold everytime when we release a new model. + * + * Generated from protobuf field float frame_confidence_threshold = 4; + */ + protected $frame_confidence_threshold = 0.0; + /** + * The confidence threshold we perform filtering on the labels from + * video-level and shot-level detections. If not set, it's set to 0.3 by + * default. The valid range for this threshold is [0.1, 0.9]. Any value set + * outside of this range will be clipped. + * Note: For best results, follow the default threshold. We will update + * the default threshold everytime when we release a new model. + * + * Generated from protobuf field float video_confidence_threshold = 5; + */ + protected $video_confidence_threshold = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $label_detection_mode + * What labels should be detected with LABEL_DETECTION, in addition to + * video-level labels or segment-level labels. + * If unspecified, defaults to `SHOT_MODE`. + * @type bool $stationary_camera + * Whether the video has been shot from a stationary (i.e., non-moving) + * camera. When set to true, might improve detection accuracy for moving + * objects. Should be used with `SHOT_AND_FRAME_MODE` enabled. + * @type string $model + * Model to use for label detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * @type float $frame_confidence_threshold + * The confidence threshold we perform filtering on the labels from + * frame-level detection. If not set, it is set to 0.4 by default. The valid + * range for this threshold is [0.1, 0.9]. Any value set outside of this + * range will be clipped. + * Note: For best results, follow the default threshold. We will update + * the default threshold everytime when we release a new model. + * @type float $video_confidence_threshold + * The confidence threshold we perform filtering on the labels from + * video-level and shot-level detections. If not set, it's set to 0.3 by + * default. The valid range for this threshold is [0.1, 0.9]. Any value set + * outside of this range will be clipped. + * Note: For best results, follow the default threshold. We will update + * the default threshold everytime when we release a new model. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * What labels should be detected with LABEL_DETECTION, in addition to + * video-level labels or segment-level labels. + * If unspecified, defaults to `SHOT_MODE`. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.LabelDetectionMode label_detection_mode = 1; + * @return int + */ + public function getLabelDetectionMode() + { + return $this->label_detection_mode; + } + + /** + * What labels should be detected with LABEL_DETECTION, in addition to + * video-level labels or segment-level labels. + * If unspecified, defaults to `SHOT_MODE`. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.LabelDetectionMode label_detection_mode = 1; + * @param int $var + * @return $this + */ + public function setLabelDetectionMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VideoIntelligence\V1\LabelDetectionMode::class); + $this->label_detection_mode = $var; + + return $this; + } + + /** + * Whether the video has been shot from a stationary (i.e., non-moving) + * camera. When set to true, might improve detection accuracy for moving + * objects. Should be used with `SHOT_AND_FRAME_MODE` enabled. + * + * Generated from protobuf field bool stationary_camera = 2; + * @return bool + */ + public function getStationaryCamera() + { + return $this->stationary_camera; + } + + /** + * Whether the video has been shot from a stationary (i.e., non-moving) + * camera. When set to true, might improve detection accuracy for moving + * objects. Should be used with `SHOT_AND_FRAME_MODE` enabled. + * + * Generated from protobuf field bool stationary_camera = 2; + * @param bool $var + * @return $this + */ + public function setStationaryCamera($var) + { + GPBUtil::checkBool($var); + $this->stationary_camera = $var; + + return $this; + } + + /** + * Model to use for label detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 3; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Model to use for label detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 3; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * The confidence threshold we perform filtering on the labels from + * frame-level detection. If not set, it is set to 0.4 by default. The valid + * range for this threshold is [0.1, 0.9]. Any value set outside of this + * range will be clipped. + * Note: For best results, follow the default threshold. We will update + * the default threshold everytime when we release a new model. + * + * Generated from protobuf field float frame_confidence_threshold = 4; + * @return float + */ + public function getFrameConfidenceThreshold() + { + return $this->frame_confidence_threshold; + } + + /** + * The confidence threshold we perform filtering on the labels from + * frame-level detection. If not set, it is set to 0.4 by default. The valid + * range for this threshold is [0.1, 0.9]. Any value set outside of this + * range will be clipped. + * Note: For best results, follow the default threshold. We will update + * the default threshold everytime when we release a new model. + * + * Generated from protobuf field float frame_confidence_threshold = 4; + * @param float $var + * @return $this + */ + public function setFrameConfidenceThreshold($var) + { + GPBUtil::checkFloat($var); + $this->frame_confidence_threshold = $var; + + return $this; + } + + /** + * The confidence threshold we perform filtering on the labels from + * video-level and shot-level detections. If not set, it's set to 0.3 by + * default. The valid range for this threshold is [0.1, 0.9]. Any value set + * outside of this range will be clipped. + * Note: For best results, follow the default threshold. We will update + * the default threshold everytime when we release a new model. + * + * Generated from protobuf field float video_confidence_threshold = 5; + * @return float + */ + public function getVideoConfidenceThreshold() + { + return $this->video_confidence_threshold; + } + + /** + * The confidence threshold we perform filtering on the labels from + * video-level and shot-level detections. If not set, it's set to 0.3 by + * default. The valid range for this threshold is [0.1, 0.9]. Any value set + * outside of this range will be clipped. + * Note: For best results, follow the default threshold. We will update + * the default threshold everytime when we release a new model. + * + * Generated from protobuf field float video_confidence_threshold = 5; + * @param float $var + * @return $this + */ + public function setVideoConfidenceThreshold($var) + { + GPBUtil::checkFloat($var); + $this->video_confidence_threshold = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelDetectionMode.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelDetectionMode.php new file mode 100644 index 000000000000..0f2117f3fd5c --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelDetectionMode.php @@ -0,0 +1,68 @@ +google.cloud.videointelligence.v1.LabelDetectionMode + */ +class LabelDetectionMode +{ + /** + * Unspecified. + * + * Generated from protobuf enum LABEL_DETECTION_MODE_UNSPECIFIED = 0; + */ + const LABEL_DETECTION_MODE_UNSPECIFIED = 0; + /** + * Detect shot-level labels. + * + * Generated from protobuf enum SHOT_MODE = 1; + */ + const SHOT_MODE = 1; + /** + * Detect frame-level labels. + * + * Generated from protobuf enum FRAME_MODE = 2; + */ + const FRAME_MODE = 2; + /** + * Detect both shot-level and frame-level labels. + * + * Generated from protobuf enum SHOT_AND_FRAME_MODE = 3; + */ + const SHOT_AND_FRAME_MODE = 3; + + private static $valueToName = [ + self::LABEL_DETECTION_MODE_UNSPECIFIED => 'LABEL_DETECTION_MODE_UNSPECIFIED', + self::SHOT_MODE => 'SHOT_MODE', + self::FRAME_MODE => 'FRAME_MODE', + self::SHOT_AND_FRAME_MODE => 'SHOT_AND_FRAME_MODE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelFrame.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelFrame.php new file mode 100644 index 000000000000..4d84657a20c0 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelFrame.php @@ -0,0 +1,115 @@ +google.cloud.videointelligence.v1.LabelFrame + */ +class LabelFrame extends \Google\Protobuf\Internal\Message +{ + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 1; + */ + protected $time_offset = null; + /** + * Confidence that the label is accurate. Range: [0, 1]. + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $time_offset + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * @type float $confidence + * Confidence that the label is accurate. Range: [0, 1]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeOffset() + { + return $this->time_offset; + } + + public function hasTimeOffset() + { + return isset($this->time_offset); + } + + public function clearTimeOffset() + { + unset($this->time_offset); + } + + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->time_offset = $var; + + return $this; + } + + /** + * Confidence that the label is accurate. Range: [0, 1]. + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Confidence that the label is accurate. Range: [0, 1]. + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelSegment.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelSegment.php new file mode 100644 index 000000000000..c605883d7957 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LabelSegment.php @@ -0,0 +1,111 @@ +google.cloud.videointelligence.v1.LabelSegment + */ +class LabelSegment extends \Google\Protobuf\Internal\Message +{ + /** + * Video segment where a label was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 1; + */ + protected $segment = null; + /** + * Confidence that the label is accurate. Range: [0, 1]. + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1\VideoSegment $segment + * Video segment where a label was detected. + * @type float $confidence + * Confidence that the label is accurate. Range: [0, 1]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Video segment where a label was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 1; + * @return \Google\Cloud\VideoIntelligence\V1\VideoSegment|null + */ + public function getSegment() + { + return $this->segment; + } + + public function hasSegment() + { + return isset($this->segment); + } + + public function clearSegment() + { + unset($this->segment); + } + + /** + * Video segment where a label was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 1; + * @param \Google\Cloud\VideoIntelligence\V1\VideoSegment $var + * @return $this + */ + public function setSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\VideoSegment::class); + $this->segment = $var; + + return $this; + } + + /** + * Confidence that the label is accurate. Range: [0, 1]. + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Confidence that the label is accurate. Range: [0, 1]. + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Likelihood.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Likelihood.php new file mode 100644 index 000000000000..605525be5d52 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Likelihood.php @@ -0,0 +1,82 @@ +google.cloud.videointelligence.v1.Likelihood + */ +class Likelihood +{ + /** + * Unspecified likelihood. + * + * Generated from protobuf enum LIKELIHOOD_UNSPECIFIED = 0; + */ + const LIKELIHOOD_UNSPECIFIED = 0; + /** + * Very unlikely. + * + * Generated from protobuf enum VERY_UNLIKELY = 1; + */ + const VERY_UNLIKELY = 1; + /** + * Unlikely. + * + * Generated from protobuf enum UNLIKELY = 2; + */ + const UNLIKELY = 2; + /** + * Possible. + * + * Generated from protobuf enum POSSIBLE = 3; + */ + const POSSIBLE = 3; + /** + * Likely. + * + * Generated from protobuf enum LIKELY = 4; + */ + const LIKELY = 4; + /** + * Very likely. + * + * Generated from protobuf enum VERY_LIKELY = 5; + */ + const VERY_LIKELY = 5; + + private static $valueToName = [ + self::LIKELIHOOD_UNSPECIFIED => 'LIKELIHOOD_UNSPECIFIED', + self::VERY_UNLIKELY => 'VERY_UNLIKELY', + self::UNLIKELY => 'UNLIKELY', + self::POSSIBLE => 'POSSIBLE', + self::LIKELY => 'LIKELY', + self::VERY_LIKELY => 'VERY_LIKELY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LogoRecognitionAnnotation.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LogoRecognitionAnnotation.php new file mode 100644 index 000000000000..2745490b4b1f --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/LogoRecognitionAnnotation.php @@ -0,0 +1,157 @@ +google.cloud.videointelligence.v1.LogoRecognitionAnnotation + */ +class LogoRecognitionAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Entity category information to specify the logo class that all the logo + * tracks within this LogoRecognitionAnnotation are recognized as. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Entity entity = 1; + */ + protected $entity = null; + /** + * All logo tracks where the recognized logo appears. Each track corresponds + * to one logo instance appearing in consecutive frames. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Track tracks = 2; + */ + private $tracks; + /** + * All video segments where the recognized logo appears. There might be + * multiple instances of the same logo class appearing in one VideoSegment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoSegment segments = 3; + */ + private $segments; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1\Entity $entity + * Entity category information to specify the logo class that all the logo + * tracks within this LogoRecognitionAnnotation are recognized as. + * @type array<\Google\Cloud\VideoIntelligence\V1\Track>|\Google\Protobuf\Internal\RepeatedField $tracks + * All logo tracks where the recognized logo appears. Each track corresponds + * to one logo instance appearing in consecutive frames. + * @type array<\Google\Cloud\VideoIntelligence\V1\VideoSegment>|\Google\Protobuf\Internal\RepeatedField $segments + * All video segments where the recognized logo appears. There might be + * multiple instances of the same logo class appearing in one VideoSegment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Entity category information to specify the logo class that all the logo + * tracks within this LogoRecognitionAnnotation are recognized as. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Entity entity = 1; + * @return \Google\Cloud\VideoIntelligence\V1\Entity|null + */ + public function getEntity() + { + return $this->entity; + } + + public function hasEntity() + { + return isset($this->entity); + } + + public function clearEntity() + { + unset($this->entity); + } + + /** + * Entity category information to specify the logo class that all the logo + * tracks within this LogoRecognitionAnnotation are recognized as. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Entity entity = 1; + * @param \Google\Cloud\VideoIntelligence\V1\Entity $var + * @return $this + */ + public function setEntity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\Entity::class); + $this->entity = $var; + + return $this; + } + + /** + * All logo tracks where the recognized logo appears. Each track corresponds + * to one logo instance appearing in consecutive frames. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Track tracks = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTracks() + { + return $this->tracks; + } + + /** + * All logo tracks where the recognized logo appears. Each track corresponds + * to one logo instance appearing in consecutive frames. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Track tracks = 2; + * @param array<\Google\Cloud\VideoIntelligence\V1\Track>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTracks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\Track::class); + $this->tracks = $arr; + + return $this; + } + + /** + * All video segments where the recognized logo appears. There might be + * multiple instances of the same logo class appearing in one VideoSegment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoSegment segments = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSegments() + { + return $this->segments; + } + + /** + * All video segments where the recognized logo appears. There might be + * multiple instances of the same logo class appearing in one VideoSegment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoSegment segments = 3; + * @param array<\Google\Cloud\VideoIntelligence\V1\VideoSegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSegments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\VideoSegment::class); + $this->segments = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/NormalizedBoundingBox.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/NormalizedBoundingBox.php new file mode 100644 index 000000000000..8f33cb0d7cb5 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/NormalizedBoundingBox.php @@ -0,0 +1,171 @@ +google.cloud.videointelligence.v1.NormalizedBoundingBox + */ +class NormalizedBoundingBox extends \Google\Protobuf\Internal\Message +{ + /** + * Left X coordinate. + * + * Generated from protobuf field float left = 1; + */ + protected $left = 0.0; + /** + * Top Y coordinate. + * + * Generated from protobuf field float top = 2; + */ + protected $top = 0.0; + /** + * Right X coordinate. + * + * Generated from protobuf field float right = 3; + */ + protected $right = 0.0; + /** + * Bottom Y coordinate. + * + * Generated from protobuf field float bottom = 4; + */ + protected $bottom = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $left + * Left X coordinate. + * @type float $top + * Top Y coordinate. + * @type float $right + * Right X coordinate. + * @type float $bottom + * Bottom Y coordinate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Left X coordinate. + * + * Generated from protobuf field float left = 1; + * @return float + */ + public function getLeft() + { + return $this->left; + } + + /** + * Left X coordinate. + * + * Generated from protobuf field float left = 1; + * @param float $var + * @return $this + */ + public function setLeft($var) + { + GPBUtil::checkFloat($var); + $this->left = $var; + + return $this; + } + + /** + * Top Y coordinate. + * + * Generated from protobuf field float top = 2; + * @return float + */ + public function getTop() + { + return $this->top; + } + + /** + * Top Y coordinate. + * + * Generated from protobuf field float top = 2; + * @param float $var + * @return $this + */ + public function setTop($var) + { + GPBUtil::checkFloat($var); + $this->top = $var; + + return $this; + } + + /** + * Right X coordinate. + * + * Generated from protobuf field float right = 3; + * @return float + */ + public function getRight() + { + return $this->right; + } + + /** + * Right X coordinate. + * + * Generated from protobuf field float right = 3; + * @param float $var + * @return $this + */ + public function setRight($var) + { + GPBUtil::checkFloat($var); + $this->right = $var; + + return $this; + } + + /** + * Bottom Y coordinate. + * + * Generated from protobuf field float bottom = 4; + * @return float + */ + public function getBottom() + { + return $this->bottom; + } + + /** + * Bottom Y coordinate. + * + * Generated from protobuf field float bottom = 4; + * @param float $var + * @return $this + */ + public function setBottom($var) + { + GPBUtil::checkFloat($var); + $this->bottom = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/NormalizedBoundingPoly.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/NormalizedBoundingPoly.php new file mode 100644 index 000000000000..f69adf5d9169 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/NormalizedBoundingPoly.php @@ -0,0 +1,81 @@ +google.cloud.videointelligence.v1.NormalizedBoundingPoly + */ +class NormalizedBoundingPoly extends \Google\Protobuf\Internal\Message +{ + /** + * Normalized vertices of the bounding polygon. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.NormalizedVertex vertices = 1; + */ + private $vertices; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1\NormalizedVertex>|\Google\Protobuf\Internal\RepeatedField $vertices + * Normalized vertices of the bounding polygon. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Normalized vertices of the bounding polygon. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.NormalizedVertex vertices = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getVertices() + { + return $this->vertices; + } + + /** + * Normalized vertices of the bounding polygon. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.NormalizedVertex vertices = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1\NormalizedVertex>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setVertices($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\NormalizedVertex::class); + $this->vertices = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/NormalizedVertex.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/NormalizedVertex.php new file mode 100644 index 000000000000..a30850203838 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/NormalizedVertex.php @@ -0,0 +1,103 @@ +google.cloud.videointelligence.v1.NormalizedVertex + */ +class NormalizedVertex extends \Google\Protobuf\Internal\Message +{ + /** + * X coordinate. + * + * Generated from protobuf field float x = 1; + */ + protected $x = 0.0; + /** + * Y coordinate. + * + * Generated from protobuf field float y = 2; + */ + protected $y = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $x + * X coordinate. + * @type float $y + * Y coordinate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * X coordinate. + * + * Generated from protobuf field float x = 1; + * @return float + */ + public function getX() + { + return $this->x; + } + + /** + * X coordinate. + * + * Generated from protobuf field float x = 1; + * @param float $var + * @return $this + */ + public function setX($var) + { + GPBUtil::checkFloat($var); + $this->x = $var; + + return $this; + } + + /** + * Y coordinate. + * + * Generated from protobuf field float y = 2; + * @return float + */ + public function getY() + { + return $this->y; + } + + /** + * Y coordinate. + * + * Generated from protobuf field float y = 2; + * @param float $var + * @return $this + */ + public function setY($var) + { + GPBUtil::checkFloat($var); + $this->y = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ObjectTrackingAnnotation.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ObjectTrackingAnnotation.php new file mode 100644 index 000000000000..8ba52ba7fbb1 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ObjectTrackingAnnotation.php @@ -0,0 +1,284 @@ +google.cloud.videointelligence.v1.ObjectTrackingAnnotation + */ +class ObjectTrackingAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Entity to specify the object category that this track is labeled as. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Entity entity = 1; + */ + protected $entity = null; + /** + * Object category's labeling confidence of this track. + * + * Generated from protobuf field float confidence = 4; + */ + protected $confidence = 0.0; + /** + * Information corresponding to all frames where this object track appears. + * Non-streaming batch mode: it may be one or multiple ObjectTrackingFrame + * messages in frames. + * Streaming mode: it can only be one ObjectTrackingFrame message in frames. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.ObjectTrackingFrame frames = 2; + */ + private $frames; + /** + * Feature version. + * + * Generated from protobuf field string version = 6; + */ + protected $version = ''; + protected $track_info; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1\VideoSegment $segment + * Non-streaming batch mode ONLY. + * Each object track corresponds to one video segment where it appears. + * @type int|string $track_id + * Streaming mode ONLY. + * In streaming mode, we do not know the end time of a tracked object + * before it is completed. Hence, there is no VideoSegment info returned. + * Instead, we provide a unique identifiable integer track_id so that + * the customers can correlate the results of the ongoing + * ObjectTrackAnnotation of the same track_id over time. + * @type \Google\Cloud\VideoIntelligence\V1\Entity $entity + * Entity to specify the object category that this track is labeled as. + * @type float $confidence + * Object category's labeling confidence of this track. + * @type array<\Google\Cloud\VideoIntelligence\V1\ObjectTrackingFrame>|\Google\Protobuf\Internal\RepeatedField $frames + * Information corresponding to all frames where this object track appears. + * Non-streaming batch mode: it may be one or multiple ObjectTrackingFrame + * messages in frames. + * Streaming mode: it can only be one ObjectTrackingFrame message in frames. + * @type string $version + * Feature version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Non-streaming batch mode ONLY. + * Each object track corresponds to one video segment where it appears. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 3; + * @return \Google\Cloud\VideoIntelligence\V1\VideoSegment|null + */ + public function getSegment() + { + return $this->readOneof(3); + } + + public function hasSegment() + { + return $this->hasOneof(3); + } + + /** + * Non-streaming batch mode ONLY. + * Each object track corresponds to one video segment where it appears. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 3; + * @param \Google\Cloud\VideoIntelligence\V1\VideoSegment $var + * @return $this + */ + public function setSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\VideoSegment::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Streaming mode ONLY. + * In streaming mode, we do not know the end time of a tracked object + * before it is completed. Hence, there is no VideoSegment info returned. + * Instead, we provide a unique identifiable integer track_id so that + * the customers can correlate the results of the ongoing + * ObjectTrackAnnotation of the same track_id over time. + * + * Generated from protobuf field int64 track_id = 5; + * @return int|string + */ + public function getTrackId() + { + return $this->readOneof(5); + } + + public function hasTrackId() + { + return $this->hasOneof(5); + } + + /** + * Streaming mode ONLY. + * In streaming mode, we do not know the end time of a tracked object + * before it is completed. Hence, there is no VideoSegment info returned. + * Instead, we provide a unique identifiable integer track_id so that + * the customers can correlate the results of the ongoing + * ObjectTrackAnnotation of the same track_id over time. + * + * Generated from protobuf field int64 track_id = 5; + * @param int|string $var + * @return $this + */ + public function setTrackId($var) + { + GPBUtil::checkInt64($var); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Entity to specify the object category that this track is labeled as. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Entity entity = 1; + * @return \Google\Cloud\VideoIntelligence\V1\Entity|null + */ + public function getEntity() + { + return $this->entity; + } + + public function hasEntity() + { + return isset($this->entity); + } + + public function clearEntity() + { + unset($this->entity); + } + + /** + * Entity to specify the object category that this track is labeled as. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Entity entity = 1; + * @param \Google\Cloud\VideoIntelligence\V1\Entity $var + * @return $this + */ + public function setEntity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\Entity::class); + $this->entity = $var; + + return $this; + } + + /** + * Object category's labeling confidence of this track. + * + * Generated from protobuf field float confidence = 4; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Object category's labeling confidence of this track. + * + * Generated from protobuf field float confidence = 4; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * Information corresponding to all frames where this object track appears. + * Non-streaming batch mode: it may be one or multiple ObjectTrackingFrame + * messages in frames. + * Streaming mode: it can only be one ObjectTrackingFrame message in frames. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.ObjectTrackingFrame frames = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrames() + { + return $this->frames; + } + + /** + * Information corresponding to all frames where this object track appears. + * Non-streaming batch mode: it may be one or multiple ObjectTrackingFrame + * messages in frames. + * Streaming mode: it can only be one ObjectTrackingFrame message in frames. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.ObjectTrackingFrame frames = 2; + * @param array<\Google\Cloud\VideoIntelligence\V1\ObjectTrackingFrame>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\ObjectTrackingFrame::class); + $this->frames = $arr; + + return $this; + } + + /** + * Feature version. + * + * Generated from protobuf field string version = 6; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Feature version. + * + * Generated from protobuf field string version = 6; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * @return string + */ + public function getTrackInfo() + { + return $this->whichOneof("track_info"); + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ObjectTrackingConfig.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ObjectTrackingConfig.php new file mode 100644 index 000000000000..25de54434f6e --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ObjectTrackingConfig.php @@ -0,0 +1,75 @@ +google.cloud.videointelligence.v1.ObjectTrackingConfig + */ +class ObjectTrackingConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Model to use for object tracking. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + */ + protected $model = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Model to use for object tracking. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Model to use for object tracking. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Model to use for object tracking. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ObjectTrackingFrame.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ObjectTrackingFrame.php new file mode 100644 index 000000000000..88cc134fb3c3 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ObjectTrackingFrame.php @@ -0,0 +1,122 @@ +google.cloud.videointelligence.v1.ObjectTrackingFrame + */ +class ObjectTrackingFrame extends \Google\Protobuf\Internal\Message +{ + /** + * The normalized bounding box location of this object track for the frame. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + protected $normalized_bounding_box = null; + /** + * The timestamp of the frame in microseconds. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + */ + protected $time_offset = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox $normalized_bounding_box + * The normalized bounding box location of this object track for the frame. + * @type \Google\Protobuf\Duration $time_offset + * The timestamp of the frame in microseconds. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * The normalized bounding box location of this object track for the frame. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.NormalizedBoundingBox normalized_bounding_box = 1; + * @return \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox|null + */ + public function getNormalizedBoundingBox() + { + return $this->normalized_bounding_box; + } + + public function hasNormalizedBoundingBox() + { + return isset($this->normalized_bounding_box); + } + + public function clearNormalizedBoundingBox() + { + unset($this->normalized_bounding_box); + } + + /** + * The normalized bounding box location of this object track for the frame. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.NormalizedBoundingBox normalized_bounding_box = 1; + * @param \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox $var + * @return $this + */ + public function setNormalizedBoundingBox($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox::class); + $this->normalized_bounding_box = $var; + + return $this; + } + + /** + * The timestamp of the frame in microseconds. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeOffset() + { + return $this->time_offset; + } + + public function hasTimeOffset() + { + return isset($this->time_offset); + } + + public function clearTimeOffset() + { + unset($this->time_offset); + } + + /** + * The timestamp of the frame in microseconds. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->time_offset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/PersonDetectionAnnotation.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/PersonDetectionAnnotation.php new file mode 100644 index 000000000000..6d98140dbbef --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/PersonDetectionAnnotation.php @@ -0,0 +1,101 @@ +google.cloud.videointelligence.v1.PersonDetectionAnnotation + */ +class PersonDetectionAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * The detected tracks of a person. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Track tracks = 1; + */ + private $tracks; + /** + * Feature version. + * + * Generated from protobuf field string version = 2; + */ + protected $version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1\Track>|\Google\Protobuf\Internal\RepeatedField $tracks + * The detected tracks of a person. + * @type string $version + * Feature version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * The detected tracks of a person. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Track tracks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTracks() + { + return $this->tracks; + } + + /** + * The detected tracks of a person. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.Track tracks = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1\Track>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTracks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\Track::class); + $this->tracks = $arr; + + return $this; + } + + /** + * Feature version. + * + * Generated from protobuf field string version = 2; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Feature version. + * + * Generated from protobuf field string version = 2; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/PersonDetectionConfig.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/PersonDetectionConfig.php new file mode 100644 index 000000000000..d3bb4963b47c --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/PersonDetectionConfig.php @@ -0,0 +1,155 @@ +google.cloud.videointelligence.v1.PersonDetectionConfig + */ +class PersonDetectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Whether bounding boxes are included in the person detection annotation + * output. + * + * Generated from protobuf field bool include_bounding_boxes = 1; + */ + protected $include_bounding_boxes = false; + /** + * Whether to enable pose landmarks detection. Ignored if + * 'include_bounding_boxes' is set to false. + * + * Generated from protobuf field bool include_pose_landmarks = 2; + */ + protected $include_pose_landmarks = false; + /** + * Whether to enable person attributes detection, such as cloth color (black, + * blue, etc), type (coat, dress, etc), pattern (plain, floral, etc), hair, + * etc. + * Ignored if 'include_bounding_boxes' is set to false. + * + * Generated from protobuf field bool include_attributes = 3; + */ + protected $include_attributes = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $include_bounding_boxes + * Whether bounding boxes are included in the person detection annotation + * output. + * @type bool $include_pose_landmarks + * Whether to enable pose landmarks detection. Ignored if + * 'include_bounding_boxes' is set to false. + * @type bool $include_attributes + * Whether to enable person attributes detection, such as cloth color (black, + * blue, etc), type (coat, dress, etc), pattern (plain, floral, etc), hair, + * etc. + * Ignored if 'include_bounding_boxes' is set to false. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Whether bounding boxes are included in the person detection annotation + * output. + * + * Generated from protobuf field bool include_bounding_boxes = 1; + * @return bool + */ + public function getIncludeBoundingBoxes() + { + return $this->include_bounding_boxes; + } + + /** + * Whether bounding boxes are included in the person detection annotation + * output. + * + * Generated from protobuf field bool include_bounding_boxes = 1; + * @param bool $var + * @return $this + */ + public function setIncludeBoundingBoxes($var) + { + GPBUtil::checkBool($var); + $this->include_bounding_boxes = $var; + + return $this; + } + + /** + * Whether to enable pose landmarks detection. Ignored if + * 'include_bounding_boxes' is set to false. + * + * Generated from protobuf field bool include_pose_landmarks = 2; + * @return bool + */ + public function getIncludePoseLandmarks() + { + return $this->include_pose_landmarks; + } + + /** + * Whether to enable pose landmarks detection. Ignored if + * 'include_bounding_boxes' is set to false. + * + * Generated from protobuf field bool include_pose_landmarks = 2; + * @param bool $var + * @return $this + */ + public function setIncludePoseLandmarks($var) + { + GPBUtil::checkBool($var); + $this->include_pose_landmarks = $var; + + return $this; + } + + /** + * Whether to enable person attributes detection, such as cloth color (black, + * blue, etc), type (coat, dress, etc), pattern (plain, floral, etc), hair, + * etc. + * Ignored if 'include_bounding_boxes' is set to false. + * + * Generated from protobuf field bool include_attributes = 3; + * @return bool + */ + public function getIncludeAttributes() + { + return $this->include_attributes; + } + + /** + * Whether to enable person attributes detection, such as cloth color (black, + * blue, etc), type (coat, dress, etc), pattern (plain, floral, etc), hair, + * etc. + * Ignored if 'include_bounding_boxes' is set to false. + * + * Generated from protobuf field bool include_attributes = 3; + * @param bool $var + * @return $this + */ + public function setIncludeAttributes($var) + { + GPBUtil::checkBool($var); + $this->include_attributes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ShotChangeDetectionConfig.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ShotChangeDetectionConfig.php new file mode 100644 index 000000000000..48f8998705f7 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/ShotChangeDetectionConfig.php @@ -0,0 +1,75 @@ +google.cloud.videointelligence.v1.ShotChangeDetectionConfig + */ +class ShotChangeDetectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Model to use for shot change detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + */ + protected $model = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Model to use for shot change detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Model to use for shot change detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Model to use for shot change detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechContext.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechContext.php new file mode 100644 index 000000000000..e8e49aff263a --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechContext.php @@ -0,0 +1,88 @@ +google.cloud.videointelligence.v1.SpeechContext + */ +class SpeechContext extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. A list of strings containing words and phrases "hints" so that + * the speech recognition is more likely to recognize them. This can be used + * to improve the accuracy for specific words and phrases, for example, if + * specific commands are typically spoken by the user. This can also be used + * to add additional words to the vocabulary of the recognizer. See + * [usage limits](https://cloud.google.com/speech/limits#content). + * + * Generated from protobuf field repeated string phrases = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $phrases; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $phrases + * Optional. A list of strings containing words and phrases "hints" so that + * the speech recognition is more likely to recognize them. This can be used + * to improve the accuracy for specific words and phrases, for example, if + * specific commands are typically spoken by the user. This can also be used + * to add additional words to the vocabulary of the recognizer. See + * [usage limits](https://cloud.google.com/speech/limits#content). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Optional. A list of strings containing words and phrases "hints" so that + * the speech recognition is more likely to recognize them. This can be used + * to improve the accuracy for specific words and phrases, for example, if + * specific commands are typically spoken by the user. This can also be used + * to add additional words to the vocabulary of the recognizer. See + * [usage limits](https://cloud.google.com/speech/limits#content). + * + * Generated from protobuf field repeated string phrases = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPhrases() + { + return $this->phrases; + } + + /** + * Optional. A list of strings containing words and phrases "hints" so that + * the speech recognition is more likely to recognize them. This can be used + * to improve the accuracy for specific words and phrases, for example, if + * specific commands are typically spoken by the user. This can also be used + * to add additional words to the vocabulary of the recognizer. See + * [usage limits](https://cloud.google.com/speech/limits#content). + * + * Generated from protobuf field repeated string phrases = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPhrases($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->phrases = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechRecognitionAlternative.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechRecognitionAlternative.php new file mode 100644 index 000000000000..38d349c1b07b --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechRecognitionAlternative.php @@ -0,0 +1,163 @@ +google.cloud.videointelligence.v1.SpeechRecognitionAlternative + */ +class SpeechRecognitionAlternative extends \Google\Protobuf\Internal\Message +{ + /** + * Transcript text representing the words that the user spoke. + * + * Generated from protobuf field string transcript = 1; + */ + protected $transcript = ''; + /** + * Output only. The confidence estimate between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. This field is set only for the top alternative. + * This field is not guaranteed to be accurate and users should not rely on it + * to be always provided. + * The default of 0.0 is a sentinel value indicating `confidence` was not set. + * + * Generated from protobuf field float confidence = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $confidence = 0.0; + /** + * Output only. A list of word-specific information for each recognized word. + * Note: When `enable_speaker_diarization` is set to true, you will see all + * the words from the beginning of the audio. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.WordInfo words = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $words; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $transcript + * Transcript text representing the words that the user spoke. + * @type float $confidence + * Output only. The confidence estimate between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. This field is set only for the top alternative. + * This field is not guaranteed to be accurate and users should not rely on it + * to be always provided. + * The default of 0.0 is a sentinel value indicating `confidence` was not set. + * @type array<\Google\Cloud\VideoIntelligence\V1\WordInfo>|\Google\Protobuf\Internal\RepeatedField $words + * Output only. A list of word-specific information for each recognized word. + * Note: When `enable_speaker_diarization` is set to true, you will see all + * the words from the beginning of the audio. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Transcript text representing the words that the user spoke. + * + * Generated from protobuf field string transcript = 1; + * @return string + */ + public function getTranscript() + { + return $this->transcript; + } + + /** + * Transcript text representing the words that the user spoke. + * + * Generated from protobuf field string transcript = 1; + * @param string $var + * @return $this + */ + public function setTranscript($var) + { + GPBUtil::checkString($var, True); + $this->transcript = $var; + + return $this; + } + + /** + * Output only. The confidence estimate between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. This field is set only for the top alternative. + * This field is not guaranteed to be accurate and users should not rely on it + * to be always provided. + * The default of 0.0 is a sentinel value indicating `confidence` was not set. + * + * Generated from protobuf field float confidence = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Output only. The confidence estimate between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. This field is set only for the top alternative. + * This field is not guaranteed to be accurate and users should not rely on it + * to be always provided. + * The default of 0.0 is a sentinel value indicating `confidence` was not set. + * + * Generated from protobuf field float confidence = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * Output only. A list of word-specific information for each recognized word. + * Note: When `enable_speaker_diarization` is set to true, you will see all + * the words from the beginning of the audio. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.WordInfo words = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWords() + { + return $this->words; + } + + /** + * Output only. A list of word-specific information for each recognized word. + * Note: When `enable_speaker_diarization` is set to true, you will see all + * the words from the beginning of the audio. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.WordInfo words = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\VideoIntelligence\V1\WordInfo>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWords($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\WordInfo::class); + $this->words = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechTranscription.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechTranscription.php new file mode 100644 index 000000000000..b42482f5ddf1 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechTranscription.php @@ -0,0 +1,121 @@ +google.cloud.videointelligence.v1.SpeechTranscription + */ +class SpeechTranscription extends \Google\Protobuf\Internal\Message +{ + /** + * May contain one or more recognition hypotheses (up to the maximum specified + * in `max_alternatives`). These alternatives are ordered in terms of + * accuracy, with the top (first) alternative being the most probable, as + * ranked by the recognizer. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.SpeechRecognitionAlternative alternatives = 1; + */ + private $alternatives; + /** + * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag of the language in this result. This language code was + * detected to have the most likelihood of being spoken in the audio. + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1\SpeechRecognitionAlternative>|\Google\Protobuf\Internal\RepeatedField $alternatives + * May contain one or more recognition hypotheses (up to the maximum specified + * in `max_alternatives`). These alternatives are ordered in terms of + * accuracy, with the top (first) alternative being the most probable, as + * ranked by the recognizer. + * @type string $language_code + * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag of the language in this result. This language code was + * detected to have the most likelihood of being spoken in the audio. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * May contain one or more recognition hypotheses (up to the maximum specified + * in `max_alternatives`). These alternatives are ordered in terms of + * accuracy, with the top (first) alternative being the most probable, as + * ranked by the recognizer. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.SpeechRecognitionAlternative alternatives = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAlternatives() + { + return $this->alternatives; + } + + /** + * May contain one or more recognition hypotheses (up to the maximum specified + * in `max_alternatives`). These alternatives are ordered in terms of + * accuracy, with the top (first) alternative being the most probable, as + * ranked by the recognizer. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.SpeechRecognitionAlternative alternatives = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1\SpeechRecognitionAlternative>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAlternatives($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\SpeechRecognitionAlternative::class); + $this->alternatives = $arr; + + return $this; + } + + /** + * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag of the language in this result. This language code was + * detected to have the most likelihood of being spoken in the audio. + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + * language tag of the language in this result. This language code was + * detected to have the most likelihood of being spoken in the audio. + * + * Generated from protobuf field string language_code = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechTranscriptionConfig.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechTranscriptionConfig.php new file mode 100644 index 000000000000..1c0f54e6f1b2 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/SpeechTranscriptionConfig.php @@ -0,0 +1,447 @@ +google.cloud.videointelligence.v1.SpeechTranscriptionConfig + */ +class SpeechTranscriptionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Required. *Required* The language of the supplied audio as a + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * Example: "en-US". + * See [Language Support](https://cloud.google.com/speech/docs/languages) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $language_code = ''; + /** + * Optional. Maximum number of recognition hypotheses to be returned. + * Specifically, the maximum number of `SpeechRecognitionAlternative` messages + * within each `SpeechTranscription`. The server may return fewer than + * `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will + * return a maximum of one. If omitted, will return a maximum of one. + * + * Generated from protobuf field int32 max_alternatives = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $max_alternatives = 0; + /** + * Optional. If set to `true`, the server will attempt to filter out + * profanities, replacing all but the initial character in each filtered word + * with asterisks, e.g. "f***". If set to `false` or omitted, profanities + * won't be filtered out. + * + * Generated from protobuf field bool filter_profanity = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter_profanity = false; + /** + * Optional. A means to provide context to assist the speech recognition. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.SpeechContext speech_contexts = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $speech_contexts; + /** + * Optional. If 'true', adds punctuation to recognition result hypotheses. + * This feature is only available in select languages. Setting this for + * requests in other languages has no effect at all. The default 'false' value + * does not add punctuation to result hypotheses. NOTE: "This is currently + * offered as an experimental service, complimentary to all users. In the + * future this may be exclusively available as a premium feature." + * + * Generated from protobuf field bool enable_automatic_punctuation = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_automatic_punctuation = false; + /** + * Optional. For file formats, such as MXF or MKV, supporting multiple audio + * tracks, specify up to two tracks. Default: track 0. + * + * Generated from protobuf field repeated int32 audio_tracks = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $audio_tracks; + /** + * Optional. If 'true', enables speaker detection for each recognized word in + * the top alternative of the recognition result using a speaker_tag provided + * in the WordInfo. + * Note: When this is true, we send all the words from the beginning of the + * audio for the top alternative in every consecutive response. + * This is done in order to improve our speaker tags as our models learn to + * identify the speakers in the conversation over time. + * + * Generated from protobuf field bool enable_speaker_diarization = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_speaker_diarization = false; + /** + * Optional. If set, specifies the estimated number of speakers in the + * conversation. If not set, defaults to '2'. Ignored unless + * enable_speaker_diarization is set to true. + * + * Generated from protobuf field int32 diarization_speaker_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $diarization_speaker_count = 0; + /** + * Optional. If `true`, the top result includes a list of words and the + * confidence for those words. If `false`, no word-level confidence + * information is returned. The default is `false`. + * + * Generated from protobuf field bool enable_word_confidence = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_word_confidence = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $language_code + * Required. *Required* The language of the supplied audio as a + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * Example: "en-US". + * See [Language Support](https://cloud.google.com/speech/docs/languages) + * for a list of the currently supported language codes. + * @type int $max_alternatives + * Optional. Maximum number of recognition hypotheses to be returned. + * Specifically, the maximum number of `SpeechRecognitionAlternative` messages + * within each `SpeechTranscription`. The server may return fewer than + * `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will + * return a maximum of one. If omitted, will return a maximum of one. + * @type bool $filter_profanity + * Optional. If set to `true`, the server will attempt to filter out + * profanities, replacing all but the initial character in each filtered word + * with asterisks, e.g. "f***". If set to `false` or omitted, profanities + * won't be filtered out. + * @type array<\Google\Cloud\VideoIntelligence\V1\SpeechContext>|\Google\Protobuf\Internal\RepeatedField $speech_contexts + * Optional. A means to provide context to assist the speech recognition. + * @type bool $enable_automatic_punctuation + * Optional. If 'true', adds punctuation to recognition result hypotheses. + * This feature is only available in select languages. Setting this for + * requests in other languages has no effect at all. The default 'false' value + * does not add punctuation to result hypotheses. NOTE: "This is currently + * offered as an experimental service, complimentary to all users. In the + * future this may be exclusively available as a premium feature." + * @type array|\Google\Protobuf\Internal\RepeatedField $audio_tracks + * Optional. For file formats, such as MXF or MKV, supporting multiple audio + * tracks, specify up to two tracks. Default: track 0. + * @type bool $enable_speaker_diarization + * Optional. If 'true', enables speaker detection for each recognized word in + * the top alternative of the recognition result using a speaker_tag provided + * in the WordInfo. + * Note: When this is true, we send all the words from the beginning of the + * audio for the top alternative in every consecutive response. + * This is done in order to improve our speaker tags as our models learn to + * identify the speakers in the conversation over time. + * @type int $diarization_speaker_count + * Optional. If set, specifies the estimated number of speakers in the + * conversation. If not set, defaults to '2'. Ignored unless + * enable_speaker_diarization is set to true. + * @type bool $enable_word_confidence + * Optional. If `true`, the top result includes a list of words and the + * confidence for those words. If `false`, no word-level confidence + * information is returned. The default is `false`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Required. *Required* The language of the supplied audio as a + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * Example: "en-US". + * See [Language Support](https://cloud.google.com/speech/docs/languages) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Required. *Required* The language of the supplied audio as a + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * Example: "en-US". + * See [Language Support](https://cloud.google.com/speech/docs/languages) + * for a list of the currently supported language codes. + * + * Generated from protobuf field string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + + /** + * Optional. Maximum number of recognition hypotheses to be returned. + * Specifically, the maximum number of `SpeechRecognitionAlternative` messages + * within each `SpeechTranscription`. The server may return fewer than + * `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will + * return a maximum of one. If omitted, will return a maximum of one. + * + * Generated from protobuf field int32 max_alternatives = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getMaxAlternatives() + { + return $this->max_alternatives; + } + + /** + * Optional. Maximum number of recognition hypotheses to be returned. + * Specifically, the maximum number of `SpeechRecognitionAlternative` messages + * within each `SpeechTranscription`. The server may return fewer than + * `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will + * return a maximum of one. If omitted, will return a maximum of one. + * + * Generated from protobuf field int32 max_alternatives = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setMaxAlternatives($var) + { + GPBUtil::checkInt32($var); + $this->max_alternatives = $var; + + return $this; + } + + /** + * Optional. If set to `true`, the server will attempt to filter out + * profanities, replacing all but the initial character in each filtered word + * with asterisks, e.g. "f***". If set to `false` or omitted, profanities + * won't be filtered out. + * + * Generated from protobuf field bool filter_profanity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getFilterProfanity() + { + return $this->filter_profanity; + } + + /** + * Optional. If set to `true`, the server will attempt to filter out + * profanities, replacing all but the initial character in each filtered word + * with asterisks, e.g. "f***". If set to `false` or omitted, profanities + * won't be filtered out. + * + * Generated from protobuf field bool filter_profanity = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setFilterProfanity($var) + { + GPBUtil::checkBool($var); + $this->filter_profanity = $var; + + return $this; + } + + /** + * Optional. A means to provide context to assist the speech recognition. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.SpeechContext speech_contexts = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpeechContexts() + { + return $this->speech_contexts; + } + + /** + * Optional. A means to provide context to assist the speech recognition. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.SpeechContext speech_contexts = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\VideoIntelligence\V1\SpeechContext>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpeechContexts($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\SpeechContext::class); + $this->speech_contexts = $arr; + + return $this; + } + + /** + * Optional. If 'true', adds punctuation to recognition result hypotheses. + * This feature is only available in select languages. Setting this for + * requests in other languages has no effect at all. The default 'false' value + * does not add punctuation to result hypotheses. NOTE: "This is currently + * offered as an experimental service, complimentary to all users. In the + * future this may be exclusively available as a premium feature." + * + * Generated from protobuf field bool enable_automatic_punctuation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableAutomaticPunctuation() + { + return $this->enable_automatic_punctuation; + } + + /** + * Optional. If 'true', adds punctuation to recognition result hypotheses. + * This feature is only available in select languages. Setting this for + * requests in other languages has no effect at all. The default 'false' value + * does not add punctuation to result hypotheses. NOTE: "This is currently + * offered as an experimental service, complimentary to all users. In the + * future this may be exclusively available as a premium feature." + * + * Generated from protobuf field bool enable_automatic_punctuation = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableAutomaticPunctuation($var) + { + GPBUtil::checkBool($var); + $this->enable_automatic_punctuation = $var; + + return $this; + } + + /** + * Optional. For file formats, such as MXF or MKV, supporting multiple audio + * tracks, specify up to two tracks. Default: track 0. + * + * Generated from protobuf field repeated int32 audio_tracks = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAudioTracks() + { + return $this->audio_tracks; + } + + /** + * Optional. For file formats, such as MXF or MKV, supporting multiple audio + * tracks, specify up to two tracks. Default: track 0. + * + * Generated from protobuf field repeated int32 audio_tracks = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAudioTracks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32); + $this->audio_tracks = $arr; + + return $this; + } + + /** + * Optional. If 'true', enables speaker detection for each recognized word in + * the top alternative of the recognition result using a speaker_tag provided + * in the WordInfo. + * Note: When this is true, we send all the words from the beginning of the + * audio for the top alternative in every consecutive response. + * This is done in order to improve our speaker tags as our models learn to + * identify the speakers in the conversation over time. + * + * Generated from protobuf field bool enable_speaker_diarization = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableSpeakerDiarization() + { + return $this->enable_speaker_diarization; + } + + /** + * Optional. If 'true', enables speaker detection for each recognized word in + * the top alternative of the recognition result using a speaker_tag provided + * in the WordInfo. + * Note: When this is true, we send all the words from the beginning of the + * audio for the top alternative in every consecutive response. + * This is done in order to improve our speaker tags as our models learn to + * identify the speakers in the conversation over time. + * + * Generated from protobuf field bool enable_speaker_diarization = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableSpeakerDiarization($var) + { + GPBUtil::checkBool($var); + $this->enable_speaker_diarization = $var; + + return $this; + } + + /** + * Optional. If set, specifies the estimated number of speakers in the + * conversation. If not set, defaults to '2'. Ignored unless + * enable_speaker_diarization is set to true. + * + * Generated from protobuf field int32 diarization_speaker_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDiarizationSpeakerCount() + { + return $this->diarization_speaker_count; + } + + /** + * Optional. If set, specifies the estimated number of speakers in the + * conversation. If not set, defaults to '2'. Ignored unless + * enable_speaker_diarization is set to true. + * + * Generated from protobuf field int32 diarization_speaker_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDiarizationSpeakerCount($var) + { + GPBUtil::checkInt32($var); + $this->diarization_speaker_count = $var; + + return $this; + } + + /** + * Optional. If `true`, the top result includes a list of words and the + * confidence for those words. If `false`, no word-level confidence + * information is returned. The default is `false`. + * + * Generated from protobuf field bool enable_word_confidence = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableWordConfidence() + { + return $this->enable_word_confidence; + } + + /** + * Optional. If `true`, the top result includes a list of words and the + * confidence for those words. If `false`, no word-level confidence + * information is returned. The default is `false`. + * + * Generated from protobuf field bool enable_word_confidence = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableWordConfidence($var) + { + GPBUtil::checkBool($var); + $this->enable_word_confidence = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextAnnotation.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextAnnotation.php new file mode 100644 index 000000000000..da9a3b3e6f89 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextAnnotation.php @@ -0,0 +1,137 @@ +google.cloud.videointelligence.v1.TextAnnotation + */ +class TextAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * The detected text. + * + * Generated from protobuf field string text = 1; + */ + protected $text = ''; + /** + * All video segments where OCR detected text appears. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.TextSegment segments = 2; + */ + private $segments; + /** + * Feature version. + * + * Generated from protobuf field string version = 3; + */ + protected $version = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $text + * The detected text. + * @type array<\Google\Cloud\VideoIntelligence\V1\TextSegment>|\Google\Protobuf\Internal\RepeatedField $segments + * All video segments where OCR detected text appears. + * @type string $version + * Feature version. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * The detected text. + * + * Generated from protobuf field string text = 1; + * @return string + */ + public function getText() + { + return $this->text; + } + + /** + * The detected text. + * + * Generated from protobuf field string text = 1; + * @param string $var + * @return $this + */ + public function setText($var) + { + GPBUtil::checkString($var, True); + $this->text = $var; + + return $this; + } + + /** + * All video segments where OCR detected text appears. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.TextSegment segments = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSegments() + { + return $this->segments; + } + + /** + * All video segments where OCR detected text appears. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.TextSegment segments = 2; + * @param array<\Google\Cloud\VideoIntelligence\V1\TextSegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSegments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\TextSegment::class); + $this->segments = $arr; + + return $this; + } + + /** + * Feature version. + * + * Generated from protobuf field string version = 3; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Feature version. + * + * Generated from protobuf field string version = 3; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextDetectionConfig.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextDetectionConfig.php new file mode 100644 index 000000000000..4b5eadb6e3bd --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextDetectionConfig.php @@ -0,0 +1,121 @@ +google.cloud.videointelligence.v1.TextDetectionConfig + */ +class TextDetectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Language hint can be specified if the language to be detected is known a + * priori. It can increase the accuracy of the detection. Language hint must + * be language code in BCP-47 format. + * Automatic language detection is performed if no hint is provided. + * + * Generated from protobuf field repeated string language_hints = 1; + */ + private $language_hints; + /** + * Model to use for text detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 2; + */ + protected $model = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $language_hints + * Language hint can be specified if the language to be detected is known a + * priori. It can increase the accuracy of the detection. Language hint must + * be language code in BCP-47 format. + * Automatic language detection is performed if no hint is provided. + * @type string $model + * Model to use for text detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Language hint can be specified if the language to be detected is known a + * priori. It can increase the accuracy of the detection. Language hint must + * be language code in BCP-47 format. + * Automatic language detection is performed if no hint is provided. + * + * Generated from protobuf field repeated string language_hints = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLanguageHints() + { + return $this->language_hints; + } + + /** + * Language hint can be specified if the language to be detected is known a + * priori. It can increase the accuracy of the detection. Language hint must + * be language code in BCP-47 format. + * Automatic language detection is performed if no hint is provided. + * + * Generated from protobuf field repeated string language_hints = 1; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLanguageHints($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->language_hints = $arr; + + return $this; + } + + /** + * Model to use for text detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 2; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Model to use for text detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 2; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextFrame.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextFrame.php new file mode 100644 index 000000000000..eb2062c90da5 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextFrame.php @@ -0,0 +1,123 @@ +google.cloud.videointelligence.v1.TextFrame + */ +class TextFrame extends \Google\Protobuf\Internal\Message +{ + /** + * Bounding polygon of the detected text for this frame. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.NormalizedBoundingPoly rotated_bounding_box = 1; + */ + protected $rotated_bounding_box = null; + /** + * Timestamp of this frame. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + */ + protected $time_offset = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingPoly $rotated_bounding_box + * Bounding polygon of the detected text for this frame. + * @type \Google\Protobuf\Duration $time_offset + * Timestamp of this frame. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Bounding polygon of the detected text for this frame. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.NormalizedBoundingPoly rotated_bounding_box = 1; + * @return \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingPoly|null + */ + public function getRotatedBoundingBox() + { + return $this->rotated_bounding_box; + } + + public function hasRotatedBoundingBox() + { + return isset($this->rotated_bounding_box); + } + + public function clearRotatedBoundingBox() + { + unset($this->rotated_bounding_box); + } + + /** + * Bounding polygon of the detected text for this frame. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.NormalizedBoundingPoly rotated_bounding_box = 1; + * @param \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingPoly $var + * @return $this + */ + public function setRotatedBoundingBox($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingPoly::class); + $this->rotated_bounding_box = $var; + + return $this; + } + + /** + * Timestamp of this frame. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeOffset() + { + return $this->time_offset; + } + + public function hasTimeOffset() + { + return isset($this->time_offset); + } + + public function clearTimeOffset() + { + unset($this->time_offset); + } + + /** + * Timestamp of this frame. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->time_offset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextSegment.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextSegment.php new file mode 100644 index 000000000000..8c0f1485df06 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TextSegment.php @@ -0,0 +1,149 @@ +google.cloud.videointelligence.v1.TextSegment + */ +class TextSegment extends \Google\Protobuf\Internal\Message +{ + /** + * Video segment where a text snippet was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 1; + */ + protected $segment = null; + /** + * Confidence for the track of detected text. It is calculated as the highest + * over all frames where OCR detected text appears. + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + /** + * Information related to the frames where OCR detected text appears. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.TextFrame frames = 3; + */ + private $frames; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1\VideoSegment $segment + * Video segment where a text snippet was detected. + * @type float $confidence + * Confidence for the track of detected text. It is calculated as the highest + * over all frames where OCR detected text appears. + * @type array<\Google\Cloud\VideoIntelligence\V1\TextFrame>|\Google\Protobuf\Internal\RepeatedField $frames + * Information related to the frames where OCR detected text appears. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Video segment where a text snippet was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 1; + * @return \Google\Cloud\VideoIntelligence\V1\VideoSegment|null + */ + public function getSegment() + { + return $this->segment; + } + + public function hasSegment() + { + return isset($this->segment); + } + + public function clearSegment() + { + unset($this->segment); + } + + /** + * Video segment where a text snippet was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 1; + * @param \Google\Cloud\VideoIntelligence\V1\VideoSegment $var + * @return $this + */ + public function setSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\VideoSegment::class); + $this->segment = $var; + + return $this; + } + + /** + * Confidence for the track of detected text. It is calculated as the highest + * over all frames where OCR detected text appears. + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Confidence for the track of detected text. It is calculated as the highest + * over all frames where OCR detected text appears. + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * Information related to the frames where OCR detected text appears. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.TextFrame frames = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrames() + { + return $this->frames; + } + + /** + * Information related to the frames where OCR detected text appears. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.TextFrame frames = 3; + * @param array<\Google\Cloud\VideoIntelligence\V1\TextFrame>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\TextFrame::class); + $this->frames = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TimestampedObject.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TimestampedObject.php new file mode 100644 index 000000000000..44afbfdf9242 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/TimestampedObject.php @@ -0,0 +1,195 @@ +google.cloud.videointelligence.v1.TimestampedObject + */ +class TimestampedObject extends \Google\Protobuf\Internal\Message +{ + /** + * Normalized Bounding box in a frame, where the object is located. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.NormalizedBoundingBox normalized_bounding_box = 1; + */ + protected $normalized_bounding_box = null; + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the video frame for this object. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + */ + protected $time_offset = null; + /** + * Optional. The attributes of the object in the bounding box. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.DetectedAttribute attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $attributes; + /** + * Optional. The detected landmarks. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.DetectedLandmark landmarks = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $landmarks; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox $normalized_bounding_box + * Normalized Bounding box in a frame, where the object is located. + * @type \Google\Protobuf\Duration $time_offset + * Time-offset, relative to the beginning of the video, + * corresponding to the video frame for this object. + * @type array<\Google\Cloud\VideoIntelligence\V1\DetectedAttribute>|\Google\Protobuf\Internal\RepeatedField $attributes + * Optional. The attributes of the object in the bounding box. + * @type array<\Google\Cloud\VideoIntelligence\V1\DetectedLandmark>|\Google\Protobuf\Internal\RepeatedField $landmarks + * Optional. The detected landmarks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Normalized Bounding box in a frame, where the object is located. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.NormalizedBoundingBox normalized_bounding_box = 1; + * @return \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox|null + */ + public function getNormalizedBoundingBox() + { + return $this->normalized_bounding_box; + } + + public function hasNormalizedBoundingBox() + { + return isset($this->normalized_bounding_box); + } + + public function clearNormalizedBoundingBox() + { + unset($this->normalized_bounding_box); + } + + /** + * Normalized Bounding box in a frame, where the object is located. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.NormalizedBoundingBox normalized_bounding_box = 1; + * @param \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox $var + * @return $this + */ + public function setNormalizedBoundingBox($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\NormalizedBoundingBox::class); + $this->normalized_bounding_box = $var; + + return $this; + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the video frame for this object. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeOffset() + { + return $this->time_offset; + } + + public function hasTimeOffset() + { + return isset($this->time_offset); + } + + public function clearTimeOffset() + { + unset($this->time_offset); + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the video frame for this object. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->time_offset = $var; + + return $this; + } + + /** + * Optional. The attributes of the object in the bounding box. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.DetectedAttribute attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Optional. The attributes of the object in the bounding box. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.DetectedAttribute attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\VideoIntelligence\V1\DetectedAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\DetectedAttribute::class); + $this->attributes = $arr; + + return $this; + } + + /** + * Optional. The detected landmarks. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.DetectedLandmark landmarks = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLandmarks() + { + return $this->landmarks; + } + + /** + * Optional. The detected landmarks. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.DetectedLandmark landmarks = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\VideoIntelligence\V1\DetectedLandmark>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLandmarks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\DetectedLandmark::class); + $this->landmarks = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Track.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Track.php new file mode 100644 index 000000000000..e4ac51167e87 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/Track.php @@ -0,0 +1,179 @@ +google.cloud.videointelligence.v1.Track + */ +class Track extends \Google\Protobuf\Internal\Message +{ + /** + * Video segment of a track. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 1; + */ + protected $segment = null; + /** + * The object with timestamp and attributes per frame in the track. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.TimestampedObject timestamped_objects = 2; + */ + private $timestamped_objects; + /** + * Optional. Attributes in the track level. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.DetectedAttribute attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $attributes; + /** + * Optional. The confidence score of the tracked object. + * + * Generated from protobuf field float confidence = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $confidence = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1\VideoSegment $segment + * Video segment of a track. + * @type array<\Google\Cloud\VideoIntelligence\V1\TimestampedObject>|\Google\Protobuf\Internal\RepeatedField $timestamped_objects + * The object with timestamp and attributes per frame in the track. + * @type array<\Google\Cloud\VideoIntelligence\V1\DetectedAttribute>|\Google\Protobuf\Internal\RepeatedField $attributes + * Optional. Attributes in the track level. + * @type float $confidence + * Optional. The confidence score of the tracked object. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Video segment of a track. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 1; + * @return \Google\Cloud\VideoIntelligence\V1\VideoSegment|null + */ + public function getSegment() + { + return $this->segment; + } + + public function hasSegment() + { + return isset($this->segment); + } + + public function clearSegment() + { + unset($this->segment); + } + + /** + * Video segment of a track. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 1; + * @param \Google\Cloud\VideoIntelligence\V1\VideoSegment $var + * @return $this + */ + public function setSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\VideoSegment::class); + $this->segment = $var; + + return $this; + } + + /** + * The object with timestamp and attributes per frame in the track. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.TimestampedObject timestamped_objects = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTimestampedObjects() + { + return $this->timestamped_objects; + } + + /** + * The object with timestamp and attributes per frame in the track. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.TimestampedObject timestamped_objects = 2; + * @param array<\Google\Cloud\VideoIntelligence\V1\TimestampedObject>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTimestampedObjects($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\TimestampedObject::class); + $this->timestamped_objects = $arr; + + return $this; + } + + /** + * Optional. Attributes in the track level. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.DetectedAttribute attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Optional. Attributes in the track level. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.DetectedAttribute attributes = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\VideoIntelligence\V1\DetectedAttribute>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAttributes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\DetectedAttribute::class); + $this->attributes = $arr; + + return $this; + } + + /** + * Optional. The confidence score of the tracked object. + * + * Generated from protobuf field float confidence = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Optional. The confidence score of the tracked object. + * + * Generated from protobuf field float confidence = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoAnnotationProgress.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoAnnotationProgress.php new file mode 100644 index 000000000000..e9502cd96acb --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoAnnotationProgress.php @@ -0,0 +1,283 @@ +google.cloud.videointelligence.v1.VideoAnnotationProgress + */ +class VideoAnnotationProgress extends \Google\Protobuf\Internal\Message +{ + /** + * Video file location in + * [Cloud Storage](https://cloud.google.com/storage/). + * + * Generated from protobuf field string input_uri = 1; + */ + protected $input_uri = ''; + /** + * Approximate percentage processed thus far. Guaranteed to be + * 100 when fully processed. + * + * Generated from protobuf field int32 progress_percent = 2; + */ + protected $progress_percent = 0; + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; + */ + protected $start_time = null; + /** + * Time of the most recent update. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + protected $update_time = null; + /** + * Specifies which feature is being tracked if the request contains more than + * one feature. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Feature feature = 5; + */ + protected $feature = 0; + /** + * Specifies which segment is being tracked if the request contains more than + * one segment. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 6; + */ + protected $segment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $input_uri + * Video file location in + * [Cloud Storage](https://cloud.google.com/storage/). + * @type int $progress_percent + * Approximate percentage processed thus far. Guaranteed to be + * 100 when fully processed. + * @type \Google\Protobuf\Timestamp $start_time + * Time when the request was received. + * @type \Google\Protobuf\Timestamp $update_time + * Time of the most recent update. + * @type int $feature + * Specifies which feature is being tracked if the request contains more than + * one feature. + * @type \Google\Cloud\VideoIntelligence\V1\VideoSegment $segment + * Specifies which segment is being tracked if the request contains more than + * one segment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Video file location in + * [Cloud Storage](https://cloud.google.com/storage/). + * + * Generated from protobuf field string input_uri = 1; + * @return string + */ + public function getInputUri() + { + return $this->input_uri; + } + + /** + * Video file location in + * [Cloud Storage](https://cloud.google.com/storage/). + * + * Generated from protobuf field string input_uri = 1; + * @param string $var + * @return $this + */ + public function setInputUri($var) + { + GPBUtil::checkString($var, True); + $this->input_uri = $var; + + return $this; + } + + /** + * Approximate percentage processed thus far. Guaranteed to be + * 100 when fully processed. + * + * Generated from protobuf field int32 progress_percent = 2; + * @return int + */ + public function getProgressPercent() + { + return $this->progress_percent; + } + + /** + * Approximate percentage processed thus far. Guaranteed to be + * 100 when fully processed. + * + * Generated from protobuf field int32 progress_percent = 2; + * @param int $var + * @return $this + */ + public function setProgressPercent($var) + { + GPBUtil::checkInt32($var); + $this->progress_percent = $var; + + return $this; + } + + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Time of the most recent update. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Time of the most recent update. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Specifies which feature is being tracked if the request contains more than + * one feature. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Feature feature = 5; + * @return int + */ + public function getFeature() + { + return $this->feature; + } + + /** + * Specifies which feature is being tracked if the request contains more than + * one feature. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.Feature feature = 5; + * @param int $var + * @return $this + */ + public function setFeature($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VideoIntelligence\V1\Feature::class); + $this->feature = $var; + + return $this; + } + + /** + * Specifies which segment is being tracked if the request contains more than + * one segment. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 6; + * @return \Google\Cloud\VideoIntelligence\V1\VideoSegment|null + */ + public function getSegment() + { + return $this->segment; + } + + public function hasSegment() + { + return isset($this->segment); + } + + public function clearSegment() + { + unset($this->segment); + } + + /** + * Specifies which segment is being tracked if the request contains more than + * one segment. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 6; + * @param \Google\Cloud\VideoIntelligence\V1\VideoSegment $var + * @return $this + */ + public function setSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\VideoSegment::class); + $this->segment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoAnnotationResults.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoAnnotationResults.php new file mode 100644 index 000000000000..e97685870f14 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoAnnotationResults.php @@ -0,0 +1,710 @@ +google.cloud.videointelligence.v1.VideoAnnotationResults + */ +class VideoAnnotationResults extends \Google\Protobuf\Internal\Message +{ + /** + * Video file location in + * [Cloud Storage](https://cloud.google.com/storage/). + * + * Generated from protobuf field string input_uri = 1; + */ + protected $input_uri = ''; + /** + * Video segment on which the annotation is run. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 10; + */ + protected $segment = null; + /** + * Topical label annotations on video level or user-specified segment level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation segment_label_annotations = 2; + */ + private $segment_label_annotations; + /** + * Presence label annotations on video level or user-specified segment level. + * There is exactly one element for each unique label. Compared to the + * existing topical `segment_label_annotations`, this field presents more + * fine-grained, segment-level labels detected in video content and is made + * available only when the client sets `LabelDetectionConfig.model` to + * "builtin/latest" in the request. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation segment_presence_label_annotations = 23; + */ + private $segment_presence_label_annotations; + /** + * Topical label annotations on shot level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation shot_label_annotations = 3; + */ + private $shot_label_annotations; + /** + * Presence label annotations on shot level. There is exactly one element for + * each unique label. Compared to the existing topical + * `shot_label_annotations`, this field presents more fine-grained, shot-level + * labels detected in video content and is made available only when the client + * sets `LabelDetectionConfig.model` to "builtin/latest" in the request. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation shot_presence_label_annotations = 24; + */ + private $shot_presence_label_annotations; + /** + * Label annotations on frame level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation frame_label_annotations = 4; + */ + private $frame_label_annotations; + /** + * Deprecated. Please use `face_detection_annotations` instead. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.FaceAnnotation face_annotations = 5 [deprecated = true]; + * @deprecated + */ + private $face_annotations; + /** + * Face detection annotations. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.FaceDetectionAnnotation face_detection_annotations = 13; + */ + private $face_detection_annotations; + /** + * Shot annotations. Each shot is represented as a video segment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoSegment shot_annotations = 6; + */ + private $shot_annotations; + /** + * Explicit content annotation. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.ExplicitContentAnnotation explicit_annotation = 7; + */ + protected $explicit_annotation = null; + /** + * Speech transcription. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.SpeechTranscription speech_transcriptions = 11; + */ + private $speech_transcriptions; + /** + * OCR text detection and tracking. + * Annotations for list of detected text snippets. Each will have list of + * frame information associated with it. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.TextAnnotation text_annotations = 12; + */ + private $text_annotations; + /** + * Annotations for list of objects detected and tracked in video. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.ObjectTrackingAnnotation object_annotations = 14; + */ + private $object_annotations; + /** + * Annotations for list of logos detected, tracked and recognized in video. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LogoRecognitionAnnotation logo_recognition_annotations = 19; + */ + private $logo_recognition_annotations; + /** + * Person detection annotations. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.PersonDetectionAnnotation person_detection_annotations = 20; + */ + private $person_detection_annotations; + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + * + * Generated from protobuf field .google.rpc.Status error = 9; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $input_uri + * Video file location in + * [Cloud Storage](https://cloud.google.com/storage/). + * @type \Google\Cloud\VideoIntelligence\V1\VideoSegment $segment + * Video segment on which the annotation is run. + * @type array<\Google\Cloud\VideoIntelligence\V1\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $segment_label_annotations + * Topical label annotations on video level or user-specified segment level. + * There is exactly one element for each unique label. + * @type array<\Google\Cloud\VideoIntelligence\V1\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $segment_presence_label_annotations + * Presence label annotations on video level or user-specified segment level. + * There is exactly one element for each unique label. Compared to the + * existing topical `segment_label_annotations`, this field presents more + * fine-grained, segment-level labels detected in video content and is made + * available only when the client sets `LabelDetectionConfig.model` to + * "builtin/latest" in the request. + * @type array<\Google\Cloud\VideoIntelligence\V1\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $shot_label_annotations + * Topical label annotations on shot level. + * There is exactly one element for each unique label. + * @type array<\Google\Cloud\VideoIntelligence\V1\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $shot_presence_label_annotations + * Presence label annotations on shot level. There is exactly one element for + * each unique label. Compared to the existing topical + * `shot_label_annotations`, this field presents more fine-grained, shot-level + * labels detected in video content and is made available only when the client + * sets `LabelDetectionConfig.model` to "builtin/latest" in the request. + * @type array<\Google\Cloud\VideoIntelligence\V1\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $frame_label_annotations + * Label annotations on frame level. + * There is exactly one element for each unique label. + * @type array<\Google\Cloud\VideoIntelligence\V1\FaceAnnotation>|\Google\Protobuf\Internal\RepeatedField $face_annotations + * Deprecated. Please use `face_detection_annotations` instead. + * @type array<\Google\Cloud\VideoIntelligence\V1\FaceDetectionAnnotation>|\Google\Protobuf\Internal\RepeatedField $face_detection_annotations + * Face detection annotations. + * @type array<\Google\Cloud\VideoIntelligence\V1\VideoSegment>|\Google\Protobuf\Internal\RepeatedField $shot_annotations + * Shot annotations. Each shot is represented as a video segment. + * @type \Google\Cloud\VideoIntelligence\V1\ExplicitContentAnnotation $explicit_annotation + * Explicit content annotation. + * @type array<\Google\Cloud\VideoIntelligence\V1\SpeechTranscription>|\Google\Protobuf\Internal\RepeatedField $speech_transcriptions + * Speech transcription. + * @type array<\Google\Cloud\VideoIntelligence\V1\TextAnnotation>|\Google\Protobuf\Internal\RepeatedField $text_annotations + * OCR text detection and tracking. + * Annotations for list of detected text snippets. Each will have list of + * frame information associated with it. + * @type array<\Google\Cloud\VideoIntelligence\V1\ObjectTrackingAnnotation>|\Google\Protobuf\Internal\RepeatedField $object_annotations + * Annotations for list of objects detected and tracked in video. + * @type array<\Google\Cloud\VideoIntelligence\V1\LogoRecognitionAnnotation>|\Google\Protobuf\Internal\RepeatedField $logo_recognition_annotations + * Annotations for list of logos detected, tracked and recognized in video. + * @type array<\Google\Cloud\VideoIntelligence\V1\PersonDetectionAnnotation>|\Google\Protobuf\Internal\RepeatedField $person_detection_annotations + * Person detection annotations. + * @type \Google\Rpc\Status $error + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Video file location in + * [Cloud Storage](https://cloud.google.com/storage/). + * + * Generated from protobuf field string input_uri = 1; + * @return string + */ + public function getInputUri() + { + return $this->input_uri; + } + + /** + * Video file location in + * [Cloud Storage](https://cloud.google.com/storage/). + * + * Generated from protobuf field string input_uri = 1; + * @param string $var + * @return $this + */ + public function setInputUri($var) + { + GPBUtil::checkString($var, True); + $this->input_uri = $var; + + return $this; + } + + /** + * Video segment on which the annotation is run. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 10; + * @return \Google\Cloud\VideoIntelligence\V1\VideoSegment|null + */ + public function getSegment() + { + return $this->segment; + } + + public function hasSegment() + { + return isset($this->segment); + } + + public function clearSegment() + { + unset($this->segment); + } + + /** + * Video segment on which the annotation is run. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.VideoSegment segment = 10; + * @param \Google\Cloud\VideoIntelligence\V1\VideoSegment $var + * @return $this + */ + public function setSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\VideoSegment::class); + $this->segment = $var; + + return $this; + } + + /** + * Topical label annotations on video level or user-specified segment level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation segment_label_annotations = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSegmentLabelAnnotations() + { + return $this->segment_label_annotations; + } + + /** + * Topical label annotations on video level or user-specified segment level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation segment_label_annotations = 2; + * @param array<\Google\Cloud\VideoIntelligence\V1\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSegmentLabelAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\LabelAnnotation::class); + $this->segment_label_annotations = $arr; + + return $this; + } + + /** + * Presence label annotations on video level or user-specified segment level. + * There is exactly one element for each unique label. Compared to the + * existing topical `segment_label_annotations`, this field presents more + * fine-grained, segment-level labels detected in video content and is made + * available only when the client sets `LabelDetectionConfig.model` to + * "builtin/latest" in the request. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation segment_presence_label_annotations = 23; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSegmentPresenceLabelAnnotations() + { + return $this->segment_presence_label_annotations; + } + + /** + * Presence label annotations on video level or user-specified segment level. + * There is exactly one element for each unique label. Compared to the + * existing topical `segment_label_annotations`, this field presents more + * fine-grained, segment-level labels detected in video content and is made + * available only when the client sets `LabelDetectionConfig.model` to + * "builtin/latest" in the request. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation segment_presence_label_annotations = 23; + * @param array<\Google\Cloud\VideoIntelligence\V1\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSegmentPresenceLabelAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\LabelAnnotation::class); + $this->segment_presence_label_annotations = $arr; + + return $this; + } + + /** + * Topical label annotations on shot level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation shot_label_annotations = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShotLabelAnnotations() + { + return $this->shot_label_annotations; + } + + /** + * Topical label annotations on shot level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation shot_label_annotations = 3; + * @param array<\Google\Cloud\VideoIntelligence\V1\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShotLabelAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\LabelAnnotation::class); + $this->shot_label_annotations = $arr; + + return $this; + } + + /** + * Presence label annotations on shot level. There is exactly one element for + * each unique label. Compared to the existing topical + * `shot_label_annotations`, this field presents more fine-grained, shot-level + * labels detected in video content and is made available only when the client + * sets `LabelDetectionConfig.model` to "builtin/latest" in the request. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation shot_presence_label_annotations = 24; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShotPresenceLabelAnnotations() + { + return $this->shot_presence_label_annotations; + } + + /** + * Presence label annotations on shot level. There is exactly one element for + * each unique label. Compared to the existing topical + * `shot_label_annotations`, this field presents more fine-grained, shot-level + * labels detected in video content and is made available only when the client + * sets `LabelDetectionConfig.model` to "builtin/latest" in the request. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation shot_presence_label_annotations = 24; + * @param array<\Google\Cloud\VideoIntelligence\V1\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShotPresenceLabelAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\LabelAnnotation::class); + $this->shot_presence_label_annotations = $arr; + + return $this; + } + + /** + * Label annotations on frame level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation frame_label_annotations = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrameLabelAnnotations() + { + return $this->frame_label_annotations; + } + + /** + * Label annotations on frame level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LabelAnnotation frame_label_annotations = 4; + * @param array<\Google\Cloud\VideoIntelligence\V1\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrameLabelAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\LabelAnnotation::class); + $this->frame_label_annotations = $arr; + + return $this; + } + + /** + * Deprecated. Please use `face_detection_annotations` instead. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.FaceAnnotation face_annotations = 5 [deprecated = true]; + * @return \Google\Protobuf\Internal\RepeatedField + * @deprecated + */ + public function getFaceAnnotations() + { + @trigger_error('face_annotations is deprecated.', E_USER_DEPRECATED); + return $this->face_annotations; + } + + /** + * Deprecated. Please use `face_detection_annotations` instead. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.FaceAnnotation face_annotations = 5 [deprecated = true]; + * @param array<\Google\Cloud\VideoIntelligence\V1\FaceAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + * @deprecated + */ + public function setFaceAnnotations($var) + { + @trigger_error('face_annotations is deprecated.', E_USER_DEPRECATED); + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\FaceAnnotation::class); + $this->face_annotations = $arr; + + return $this; + } + + /** + * Face detection annotations. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.FaceDetectionAnnotation face_detection_annotations = 13; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFaceDetectionAnnotations() + { + return $this->face_detection_annotations; + } + + /** + * Face detection annotations. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.FaceDetectionAnnotation face_detection_annotations = 13; + * @param array<\Google\Cloud\VideoIntelligence\V1\FaceDetectionAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFaceDetectionAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\FaceDetectionAnnotation::class); + $this->face_detection_annotations = $arr; + + return $this; + } + + /** + * Shot annotations. Each shot is represented as a video segment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoSegment shot_annotations = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShotAnnotations() + { + return $this->shot_annotations; + } + + /** + * Shot annotations. Each shot is represented as a video segment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoSegment shot_annotations = 6; + * @param array<\Google\Cloud\VideoIntelligence\V1\VideoSegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShotAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\VideoSegment::class); + $this->shot_annotations = $arr; + + return $this; + } + + /** + * Explicit content annotation. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.ExplicitContentAnnotation explicit_annotation = 7; + * @return \Google\Cloud\VideoIntelligence\V1\ExplicitContentAnnotation|null + */ + public function getExplicitAnnotation() + { + return $this->explicit_annotation; + } + + public function hasExplicitAnnotation() + { + return isset($this->explicit_annotation); + } + + public function clearExplicitAnnotation() + { + unset($this->explicit_annotation); + } + + /** + * Explicit content annotation. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.ExplicitContentAnnotation explicit_annotation = 7; + * @param \Google\Cloud\VideoIntelligence\V1\ExplicitContentAnnotation $var + * @return $this + */ + public function setExplicitAnnotation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\ExplicitContentAnnotation::class); + $this->explicit_annotation = $var; + + return $this; + } + + /** + * Speech transcription. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.SpeechTranscription speech_transcriptions = 11; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSpeechTranscriptions() + { + return $this->speech_transcriptions; + } + + /** + * Speech transcription. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.SpeechTranscription speech_transcriptions = 11; + * @param array<\Google\Cloud\VideoIntelligence\V1\SpeechTranscription>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSpeechTranscriptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\SpeechTranscription::class); + $this->speech_transcriptions = $arr; + + return $this; + } + + /** + * OCR text detection and tracking. + * Annotations for list of detected text snippets. Each will have list of + * frame information associated with it. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.TextAnnotation text_annotations = 12; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTextAnnotations() + { + return $this->text_annotations; + } + + /** + * OCR text detection and tracking. + * Annotations for list of detected text snippets. Each will have list of + * frame information associated with it. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.TextAnnotation text_annotations = 12; + * @param array<\Google\Cloud\VideoIntelligence\V1\TextAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTextAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\TextAnnotation::class); + $this->text_annotations = $arr; + + return $this; + } + + /** + * Annotations for list of objects detected and tracked in video. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.ObjectTrackingAnnotation object_annotations = 14; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getObjectAnnotations() + { + return $this->object_annotations; + } + + /** + * Annotations for list of objects detected and tracked in video. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.ObjectTrackingAnnotation object_annotations = 14; + * @param array<\Google\Cloud\VideoIntelligence\V1\ObjectTrackingAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setObjectAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\ObjectTrackingAnnotation::class); + $this->object_annotations = $arr; + + return $this; + } + + /** + * Annotations for list of logos detected, tracked and recognized in video. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LogoRecognitionAnnotation logo_recognition_annotations = 19; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getLogoRecognitionAnnotations() + { + return $this->logo_recognition_annotations; + } + + /** + * Annotations for list of logos detected, tracked and recognized in video. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.LogoRecognitionAnnotation logo_recognition_annotations = 19; + * @param array<\Google\Cloud\VideoIntelligence\V1\LogoRecognitionAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setLogoRecognitionAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\LogoRecognitionAnnotation::class); + $this->logo_recognition_annotations = $arr; + + return $this; + } + + /** + * Person detection annotations. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.PersonDetectionAnnotation person_detection_annotations = 20; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPersonDetectionAnnotations() + { + return $this->person_detection_annotations; + } + + /** + * Person detection annotations. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.PersonDetectionAnnotation person_detection_annotations = 20; + * @param array<\Google\Cloud\VideoIntelligence\V1\PersonDetectionAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPersonDetectionAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\PersonDetectionAnnotation::class); + $this->person_detection_annotations = $arr; + + return $this; + } + + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + * + * Generated from protobuf field .google.rpc.Status error = 9; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + * + * Generated from protobuf field .google.rpc.Status error = 9; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoContext.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoContext.php new file mode 100644 index 000000000000..b74187dab46d --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoContext.php @@ -0,0 +1,427 @@ +google.cloud.videointelligence.v1.VideoContext + */ +class VideoContext extends \Google\Protobuf\Internal\Message +{ + /** + * Video segments to annotate. The segments may overlap and are not required + * to be contiguous or span the whole video. If unspecified, each video is + * treated as a single segment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoSegment segments = 1; + */ + private $segments; + /** + * Config for LABEL_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.LabelDetectionConfig label_detection_config = 2; + */ + protected $label_detection_config = null; + /** + * Config for SHOT_CHANGE_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + protected $shot_change_detection_config = null; + /** + * Config for EXPLICIT_CONTENT_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + protected $explicit_content_detection_config = null; + /** + * Config for FACE_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.FaceDetectionConfig face_detection_config = 5; + */ + protected $face_detection_config = null; + /** + * Config for SPEECH_TRANSCRIPTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.SpeechTranscriptionConfig speech_transcription_config = 6; + */ + protected $speech_transcription_config = null; + /** + * Config for TEXT_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.TextDetectionConfig text_detection_config = 8; + */ + protected $text_detection_config = null; + /** + * Config for PERSON_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.PersonDetectionConfig person_detection_config = 11; + */ + protected $person_detection_config = null; + /** + * Config for OBJECT_TRACKING. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.ObjectTrackingConfig object_tracking_config = 13; + */ + protected $object_tracking_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1\VideoSegment>|\Google\Protobuf\Internal\RepeatedField $segments + * Video segments to annotate. The segments may overlap and are not required + * to be contiguous or span the whole video. If unspecified, each video is + * treated as a single segment. + * @type \Google\Cloud\VideoIntelligence\V1\LabelDetectionConfig $label_detection_config + * Config for LABEL_DETECTION. + * @type \Google\Cloud\VideoIntelligence\V1\ShotChangeDetectionConfig $shot_change_detection_config + * Config for SHOT_CHANGE_DETECTION. + * @type \Google\Cloud\VideoIntelligence\V1\ExplicitContentDetectionConfig $explicit_content_detection_config + * Config for EXPLICIT_CONTENT_DETECTION. + * @type \Google\Cloud\VideoIntelligence\V1\FaceDetectionConfig $face_detection_config + * Config for FACE_DETECTION. + * @type \Google\Cloud\VideoIntelligence\V1\SpeechTranscriptionConfig $speech_transcription_config + * Config for SPEECH_TRANSCRIPTION. + * @type \Google\Cloud\VideoIntelligence\V1\TextDetectionConfig $text_detection_config + * Config for TEXT_DETECTION. + * @type \Google\Cloud\VideoIntelligence\V1\PersonDetectionConfig $person_detection_config + * Config for PERSON_DETECTION. + * @type \Google\Cloud\VideoIntelligence\V1\ObjectTrackingConfig $object_tracking_config + * Config for OBJECT_TRACKING. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Video segments to annotate. The segments may overlap and are not required + * to be contiguous or span the whole video. If unspecified, each video is + * treated as a single segment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoSegment segments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSegments() + { + return $this->segments; + } + + /** + * Video segments to annotate. The segments may overlap and are not required + * to be contiguous or span the whole video. If unspecified, each video is + * treated as a single segment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1.VideoSegment segments = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1\VideoSegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSegments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1\VideoSegment::class); + $this->segments = $arr; + + return $this; + } + + /** + * Config for LABEL_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.LabelDetectionConfig label_detection_config = 2; + * @return \Google\Cloud\VideoIntelligence\V1\LabelDetectionConfig|null + */ + public function getLabelDetectionConfig() + { + return $this->label_detection_config; + } + + public function hasLabelDetectionConfig() + { + return isset($this->label_detection_config); + } + + public function clearLabelDetectionConfig() + { + unset($this->label_detection_config); + } + + /** + * Config for LABEL_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.LabelDetectionConfig label_detection_config = 2; + * @param \Google\Cloud\VideoIntelligence\V1\LabelDetectionConfig $var + * @return $this + */ + public function setLabelDetectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\LabelDetectionConfig::class); + $this->label_detection_config = $var; + + return $this; + } + + /** + * Config for SHOT_CHANGE_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.ShotChangeDetectionConfig shot_change_detection_config = 3; + * @return \Google\Cloud\VideoIntelligence\V1\ShotChangeDetectionConfig|null + */ + public function getShotChangeDetectionConfig() + { + return $this->shot_change_detection_config; + } + + public function hasShotChangeDetectionConfig() + { + return isset($this->shot_change_detection_config); + } + + public function clearShotChangeDetectionConfig() + { + unset($this->shot_change_detection_config); + } + + /** + * Config for SHOT_CHANGE_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.ShotChangeDetectionConfig shot_change_detection_config = 3; + * @param \Google\Cloud\VideoIntelligence\V1\ShotChangeDetectionConfig $var + * @return $this + */ + public function setShotChangeDetectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\ShotChangeDetectionConfig::class); + $this->shot_change_detection_config = $var; + + return $this; + } + + /** + * Config for EXPLICIT_CONTENT_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + * @return \Google\Cloud\VideoIntelligence\V1\ExplicitContentDetectionConfig|null + */ + public function getExplicitContentDetectionConfig() + { + return $this->explicit_content_detection_config; + } + + public function hasExplicitContentDetectionConfig() + { + return isset($this->explicit_content_detection_config); + } + + public function clearExplicitContentDetectionConfig() + { + unset($this->explicit_content_detection_config); + } + + /** + * Config for EXPLICIT_CONTENT_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + * @param \Google\Cloud\VideoIntelligence\V1\ExplicitContentDetectionConfig $var + * @return $this + */ + public function setExplicitContentDetectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\ExplicitContentDetectionConfig::class); + $this->explicit_content_detection_config = $var; + + return $this; + } + + /** + * Config for FACE_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.FaceDetectionConfig face_detection_config = 5; + * @return \Google\Cloud\VideoIntelligence\V1\FaceDetectionConfig|null + */ + public function getFaceDetectionConfig() + { + return $this->face_detection_config; + } + + public function hasFaceDetectionConfig() + { + return isset($this->face_detection_config); + } + + public function clearFaceDetectionConfig() + { + unset($this->face_detection_config); + } + + /** + * Config for FACE_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.FaceDetectionConfig face_detection_config = 5; + * @param \Google\Cloud\VideoIntelligence\V1\FaceDetectionConfig $var + * @return $this + */ + public function setFaceDetectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\FaceDetectionConfig::class); + $this->face_detection_config = $var; + + return $this; + } + + /** + * Config for SPEECH_TRANSCRIPTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.SpeechTranscriptionConfig speech_transcription_config = 6; + * @return \Google\Cloud\VideoIntelligence\V1\SpeechTranscriptionConfig|null + */ + public function getSpeechTranscriptionConfig() + { + return $this->speech_transcription_config; + } + + public function hasSpeechTranscriptionConfig() + { + return isset($this->speech_transcription_config); + } + + public function clearSpeechTranscriptionConfig() + { + unset($this->speech_transcription_config); + } + + /** + * Config for SPEECH_TRANSCRIPTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.SpeechTranscriptionConfig speech_transcription_config = 6; + * @param \Google\Cloud\VideoIntelligence\V1\SpeechTranscriptionConfig $var + * @return $this + */ + public function setSpeechTranscriptionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\SpeechTranscriptionConfig::class); + $this->speech_transcription_config = $var; + + return $this; + } + + /** + * Config for TEXT_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.TextDetectionConfig text_detection_config = 8; + * @return \Google\Cloud\VideoIntelligence\V1\TextDetectionConfig|null + */ + public function getTextDetectionConfig() + { + return $this->text_detection_config; + } + + public function hasTextDetectionConfig() + { + return isset($this->text_detection_config); + } + + public function clearTextDetectionConfig() + { + unset($this->text_detection_config); + } + + /** + * Config for TEXT_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.TextDetectionConfig text_detection_config = 8; + * @param \Google\Cloud\VideoIntelligence\V1\TextDetectionConfig $var + * @return $this + */ + public function setTextDetectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\TextDetectionConfig::class); + $this->text_detection_config = $var; + + return $this; + } + + /** + * Config for PERSON_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.PersonDetectionConfig person_detection_config = 11; + * @return \Google\Cloud\VideoIntelligence\V1\PersonDetectionConfig|null + */ + public function getPersonDetectionConfig() + { + return $this->person_detection_config; + } + + public function hasPersonDetectionConfig() + { + return isset($this->person_detection_config); + } + + public function clearPersonDetectionConfig() + { + unset($this->person_detection_config); + } + + /** + * Config for PERSON_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.PersonDetectionConfig person_detection_config = 11; + * @param \Google\Cloud\VideoIntelligence\V1\PersonDetectionConfig $var + * @return $this + */ + public function setPersonDetectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\PersonDetectionConfig::class); + $this->person_detection_config = $var; + + return $this; + } + + /** + * Config for OBJECT_TRACKING. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.ObjectTrackingConfig object_tracking_config = 13; + * @return \Google\Cloud\VideoIntelligence\V1\ObjectTrackingConfig|null + */ + public function getObjectTrackingConfig() + { + return $this->object_tracking_config; + } + + public function hasObjectTrackingConfig() + { + return isset($this->object_tracking_config); + } + + public function clearObjectTrackingConfig() + { + unset($this->object_tracking_config); + } + + /** + * Config for OBJECT_TRACKING. + * + * Generated from protobuf field .google.cloud.videointelligence.v1.ObjectTrackingConfig object_tracking_config = 13; + * @param \Google\Cloud\VideoIntelligence\V1\ObjectTrackingConfig $var + * @return $this + */ + public function setObjectTrackingConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1\ObjectTrackingConfig::class); + $this->object_tracking_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoSegment.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoSegment.php new file mode 100644 index 000000000000..5153eebff212 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/VideoSegment.php @@ -0,0 +1,129 @@ +google.cloud.videointelligence.v1.VideoSegment + */ +class VideoSegment extends \Google\Protobuf\Internal\Message +{ + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the start of the segment (inclusive). + * + * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; + */ + protected $start_time_offset = null; + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the end of the segment (inclusive). + * + * Generated from protobuf field .google.protobuf.Duration end_time_offset = 2; + */ + protected $end_time_offset = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $start_time_offset + * Time-offset, relative to the beginning of the video, + * corresponding to the start of the segment (inclusive). + * @type \Google\Protobuf\Duration $end_time_offset + * Time-offset, relative to the beginning of the video, + * corresponding to the end of the segment (inclusive). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the start of the segment (inclusive). + * + * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getStartTimeOffset() + { + return $this->start_time_offset; + } + + public function hasStartTimeOffset() + { + return isset($this->start_time_offset); + } + + public function clearStartTimeOffset() + { + unset($this->start_time_offset); + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the start of the segment (inclusive). + * + * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setStartTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->start_time_offset = $var; + + return $this; + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the end of the segment (inclusive). + * + * Generated from protobuf field .google.protobuf.Duration end_time_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getEndTimeOffset() + { + return $this->end_time_offset; + } + + public function hasEndTimeOffset() + { + return isset($this->end_time_offset); + } + + public function clearEndTimeOffset() + { + unset($this->end_time_offset); + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the end of the segment (inclusive). + * + * Generated from protobuf field .google.protobuf.Duration end_time_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEndTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->end_time_offset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/WordInfo.php b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/WordInfo.php new file mode 100644 index 000000000000..9e83ca0bd3d6 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/proto/src/Google/Cloud/VideoIntelligence/V1/WordInfo.php @@ -0,0 +1,281 @@ +google.cloud.videointelligence.v1.WordInfo + */ +class WordInfo extends \Google\Protobuf\Internal\Message +{ + /** + * Time offset relative to the beginning of the audio, and + * corresponding to the start of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is an + * experimental feature and the accuracy of the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration start_time = 1; + */ + protected $start_time = null; + /** + * Time offset relative to the beginning of the audio, and + * corresponding to the end of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is an + * experimental feature and the accuracy of the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration end_time = 2; + */ + protected $end_time = null; + /** + * The word corresponding to this set of information. + * + * Generated from protobuf field string word = 3; + */ + protected $word = ''; + /** + * Output only. The confidence estimate between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. This field is set only for the top alternative. + * This field is not guaranteed to be accurate and users should not rely on it + * to be always provided. + * The default of 0.0 is a sentinel value indicating `confidence` was not set. + * + * Generated from protobuf field float confidence = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $confidence = 0.0; + /** + * Output only. A distinct integer value is assigned for every speaker within + * the audio. This field specifies which one of those speakers was detected to + * have spoken this word. Value ranges from 1 up to diarization_speaker_count, + * and is only set if speaker diarization is enabled. + * + * Generated from protobuf field int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $speaker_tag = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $start_time + * Time offset relative to the beginning of the audio, and + * corresponding to the start of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is an + * experimental feature and the accuracy of the time offset can vary. + * @type \Google\Protobuf\Duration $end_time + * Time offset relative to the beginning of the audio, and + * corresponding to the end of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is an + * experimental feature and the accuracy of the time offset can vary. + * @type string $word + * The word corresponding to this set of information. + * @type float $confidence + * Output only. The confidence estimate between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. This field is set only for the top alternative. + * This field is not guaranteed to be accurate and users should not rely on it + * to be always provided. + * The default of 0.0 is a sentinel value indicating `confidence` was not set. + * @type int $speaker_tag + * Output only. A distinct integer value is assigned for every speaker within + * the audio. This field specifies which one of those speakers was detected to + * have spoken this word. Value ranges from 1 up to diarization_speaker_count, + * and is only set if speaker diarization is enabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Time offset relative to the beginning of the audio, and + * corresponding to the start of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is an + * experimental feature and the accuracy of the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration start_time = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time offset relative to the beginning of the audio, and + * corresponding to the start of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is an + * experimental feature and the accuracy of the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration start_time = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->start_time = $var; + + return $this; + } + + /** + * Time offset relative to the beginning of the audio, and + * corresponding to the end of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is an + * experimental feature and the accuracy of the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration end_time = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Time offset relative to the beginning of the audio, and + * corresponding to the end of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is an + * experimental feature and the accuracy of the time offset can vary. + * + * Generated from protobuf field .google.protobuf.Duration end_time = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->end_time = $var; + + return $this; + } + + /** + * The word corresponding to this set of information. + * + * Generated from protobuf field string word = 3; + * @return string + */ + public function getWord() + { + return $this->word; + } + + /** + * The word corresponding to this set of information. + * + * Generated from protobuf field string word = 3; + * @param string $var + * @return $this + */ + public function setWord($var) + { + GPBUtil::checkString($var, True); + $this->word = $var; + + return $this; + } + + /** + * Output only. The confidence estimate between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. This field is set only for the top alternative. + * This field is not guaranteed to be accurate and users should not rely on it + * to be always provided. + * The default of 0.0 is a sentinel value indicating `confidence` was not set. + * + * Generated from protobuf field float confidence = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Output only. The confidence estimate between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. This field is set only for the top alternative. + * This field is not guaranteed to be accurate and users should not rely on it + * to be always provided. + * The default of 0.0 is a sentinel value indicating `confidence` was not set. + * + * Generated from protobuf field float confidence = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + + /** + * Output only. A distinct integer value is assigned for every speaker within + * the audio. This field specifies which one of those speakers was detected to + * have spoken this word. Value ranges from 1 up to diarization_speaker_count, + * and is only set if speaker diarization is enabled. + * + * Generated from protobuf field int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getSpeakerTag() + { + return $this->speaker_tag; + } + + /** + * Output only. A distinct integer value is assigned for every speaker within + * the audio. This field specifies which one of those speakers was detected to + * have spoken this word. Value ranges from 1 up to diarization_speaker_count, + * and is only set if speaker diarization is enabled. + * + * Generated from protobuf field int32 speaker_tag = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setSpeakerTag($var) + { + GPBUtil::checkInt32($var); + $this->speaker_tag = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1/samples/V1/VideoIntelligenceServiceClient/annotate_video.php b/owl-bot-staging/VideoIntelligence/v1/samples/V1/VideoIntelligenceServiceClient/annotate_video.php new file mode 100644 index 000000000000..db898623b6b9 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/samples/V1/VideoIntelligenceServiceClient/annotate_video.php @@ -0,0 +1,72 @@ +annotateVideo($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AnnotateVideoResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} +// [END videointelligence_v1_generated_VideoIntelligenceService_AnnotateVideo_sync] diff --git a/owl-bot-staging/VideoIntelligence/v1/src/V1/Client/VideoIntelligenceServiceClient.php b/owl-bot-staging/VideoIntelligence/v1/src/V1/Client/VideoIntelligenceServiceClient.php new file mode 100644 index 000000000000..76d018759f9c --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/src/V1/Client/VideoIntelligenceServiceClient.php @@ -0,0 +1,229 @@ + self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/video_intelligence_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/video_intelligence_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/video_intelligence_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/video_intelligence_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'videointelligence.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** Handles execution of the async variants for each documented method. */ + public function __call($method, $args) + { + if (substr($method, -5) !== 'Async') { + trigger_error('Call to undefined method ' . __CLASS__ . "::$method()", E_USER_ERROR); + } + + array_unshift($args, substr($method, 0, -5)); + return call_user_func_array([$this, 'startAsyncCall'], $args); + } + + /** + * Performs asynchronous video annotation. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `AnnotateVideoProgress` (progress). + * `Operation.response` contains `AnnotateVideoResponse` (results). + * + * The async variant is {@see VideoIntelligenceServiceClient::annotateVideoAsync()} + * . + * + * @example samples/V1/VideoIntelligenceServiceClient/annotate_video.php + * + * @param AnnotateVideoRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function annotateVideo(AnnotateVideoRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('AnnotateVideo', $request, $callOptions)->wait(); + } +} diff --git a/owl-bot-staging/VideoIntelligence/v1/src/V1/Gapic/VideoIntelligenceServiceGapicClient.php b/owl-bot-staging/VideoIntelligence/v1/src/V1/Gapic/VideoIntelligenceServiceGapicClient.php new file mode 100644 index 000000000000..2c6b2480eb6f --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/src/V1/Gapic/VideoIntelligenceServiceGapicClient.php @@ -0,0 +1,341 @@ +annotateVideo(); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $videoIntelligenceServiceClient->annotateVideo(); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $videoIntelligenceServiceClient->resumeOperation($operationName, 'annotateVideo'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $videoIntelligenceServiceClient->close(); + * } + * ``` + * + * @deprecated Please use the new service client {@see \Google\Cloud\VideoIntelligence\V1\Client\VideoIntelligenceServiceClient}. + */ +class VideoIntelligenceServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.videointelligence.v1.VideoIntelligenceService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'videointelligence.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'videointelligence.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/video_intelligence_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/video_intelligence_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/video_intelligence_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/video_intelligence_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'videointelligence.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Performs asynchronous video annotation. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `AnnotateVideoProgress` (progress). + * `Operation.response` contains `AnnotateVideoResponse` (results). + * + * Sample code: + * ``` + * $videoIntelligenceServiceClient = new VideoIntelligenceServiceClient(); + * try { + * $operationResponse = $videoIntelligenceServiceClient->annotateVideo(); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $videoIntelligenceServiceClient->annotateVideo(); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $videoIntelligenceServiceClient->resumeOperation($operationName, 'annotateVideo'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $videoIntelligenceServiceClient->close(); + * } + * ``` + * + * @param array $optionalArgs { + * Optional. + * + * @type string $inputUri + * Input video location. Currently, only + * [Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported. URIs must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). To identify + * multiple videos, a video URI may include wildcards in the `object-id`. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` must be unset. + * @type string $inputContent + * The video data bytes. + * If unset, the input video(s) should be specified via the `input_uri`. + * If set, `input_uri` must be unset. + * @type int[] $features + * Required. Requested video annotation features. + * For allowed values, use constants defined on {@see \Google\Cloud\VideoIntelligence\V1\Feature} + * @type VideoContext $videoContext + * Additional video context and/or feature-specific parameters. + * @type string $outputUri + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported. These must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * @type string $locationId + * Optional. Cloud region where annotation should take place. Supported cloud + * regions are: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + * region is specified, the region will be determined based on video file + * location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + */ + public function annotateVideo(array $optionalArgs = []) + { + $request = new AnnotateVideoRequest(); + if (isset($optionalArgs['inputUri'])) { + $request->setInputUri($optionalArgs['inputUri']); + } + + if (isset($optionalArgs['inputContent'])) { + $request->setInputContent($optionalArgs['inputContent']); + } + + if (isset($optionalArgs['features'])) { + $request->setFeatures($optionalArgs['features']); + } + + if (isset($optionalArgs['videoContext'])) { + $request->setVideoContext($optionalArgs['videoContext']); + } + + if (isset($optionalArgs['outputUri'])) { + $request->setOutputUri($optionalArgs['outputUri']); + } + + if (isset($optionalArgs['locationId'])) { + $request->setLocationId($optionalArgs['locationId']); + } + + return $this->startOperationsCall('AnnotateVideo', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } +} diff --git a/owl-bot-staging/VideoIntelligence/v1/src/V1/VideoIntelligenceServiceClient.php b/owl-bot-staging/VideoIntelligence/v1/src/V1/VideoIntelligenceServiceClient.php new file mode 100644 index 000000000000..4d9a09e26369 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/src/V1/VideoIntelligenceServiceClient.php @@ -0,0 +1,34 @@ + [ + 'google.cloud.videointelligence.v1.VideoIntelligenceService' => [ + 'AnnotateVideo' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\VideoIntelligence\V1\AnnotateVideoResponse', + 'metadataReturnType' => '\Google\Cloud\VideoIntelligence\V1\AnnotateVideoProgress', + 'initialPollDelayMillis' => '20000', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '45000', + 'totalPollTimeoutMillis' => '86400000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + ], + ], + ], +]; diff --git a/owl-bot-staging/VideoIntelligence/v1/src/V1/resources/video_intelligence_service_rest_client_config.php b/owl-bot-staging/VideoIntelligence/v1/src/V1/resources/video_intelligence_service_rest_client_config.php new file mode 100644 index 000000000000..9dfb17be6a1e --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/src/V1/resources/video_intelligence_service_rest_client_config.php @@ -0,0 +1,100 @@ + [ + 'google.cloud.videointelligence.v1.VideoIntelligenceService' => [ + 'AnnotateVideo' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/videos:annotate', + 'body' => '*', + ], + ], + 'google.longrunning.Operations' => [ + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/operations/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1/operations/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/operations/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/VideoIntelligence/v1/tests/Unit/V1/Client/VideoIntelligenceServiceClientTest.php b/owl-bot-staging/VideoIntelligence/v1/tests/Unit/V1/Client/VideoIntelligenceServiceClientTest.php new file mode 100644 index 000000000000..b2c08dabadf3 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/tests/Unit/V1/Client/VideoIntelligenceServiceClientTest.php @@ -0,0 +1,238 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return VideoIntelligenceServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new VideoIntelligenceServiceClient($options); + } + + /** @test */ + public function annotateVideoTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/annotateVideoTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new AnnotateVideoResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/annotateVideoTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + $request = new AnnotateVideoRequest(); + $response = $gapicClient->annotateVideo($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.videointelligence.v1.VideoIntelligenceService/AnnotateVideo', $actualApiFuncCall); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/annotateVideoTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function annotateVideoExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/annotateVideoTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + $request = new AnnotateVideoRequest(); + $response = $gapicClient->annotateVideo($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/annotateVideoTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function annotateVideoAsyncTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/annotateVideoTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new AnnotateVideoResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/annotateVideoTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + $request = new AnnotateVideoRequest(); + $response = $gapicClient->annotateVideoAsync($request)->wait(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.videointelligence.v1.VideoIntelligenceService/AnnotateVideo', $actualApiFuncCall); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/annotateVideoTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/VideoIntelligence/v1/tests/Unit/V1/VideoIntelligenceServiceClientTest.php b/owl-bot-staging/VideoIntelligence/v1/tests/Unit/V1/VideoIntelligenceServiceClientTest.php new file mode 100644 index 000000000000..28e39ed5bd77 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1/tests/Unit/V1/VideoIntelligenceServiceClientTest.php @@ -0,0 +1,176 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return VideoIntelligenceServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new VideoIntelligenceServiceClient($options); + } + + /** @test */ + public function annotateVideoTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/annotateVideoTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new AnnotateVideoResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/annotateVideoTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + $response = $gapicClient->annotateVideo(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.videointelligence.v1.VideoIntelligenceService/AnnotateVideo', $actualApiFuncCall); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/annotateVideoTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function annotateVideoExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/annotateVideoTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + $response = $gapicClient->annotateVideo(); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/annotateVideoTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +} diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/GPBMetadata/Google/Cloud/Videointelligence/V1Beta2/VideoIntelligence.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/GPBMetadata/Google/Cloud/Videointelligence/V1Beta2/VideoIntelligence.php new file mode 100644 index 0000000000000000000000000000000000000000..b458c796ae975efc4854848a1532c2f502cfe15b GIT binary patch literal 5849 zcmb_g&2QVt6|W@QiJxr8p<_ojnv~I|yNPv4{Q%eKY(JP06*KHkZhpncw^Ty?OIK zf9i}K_(0w#HgR=E26F$6%*I4^T*|0HExGRxhs2c)dg7QCaTQr^bmVrYE31uG_Z}Yg zsP7u2B9AB?S)^oG)E|^i%>kjN&4^{0BVrq*bo#JQm|hN6wB(W^WC7Uv3Gp1=AoBiU z?Ky59=uGeJ3)o(r!}eaJVS6tg);R1V0K?KfPZm2`3Bm9Sknx}6_btz~p=HI~1MtSdR2O`HO}Q7S?NurhnvDwwmG)-a+YGkaRn$(^D=mE7yu5a6> zJ?eEFo|#uuH;zKX56;dnIzHMpF&&wH;>>^c$T51y=v)5+&x&OE321l5rqr9l{&l$3a#McxlLMEbdoQQ`#gynz*~Q<@0! zACa$p44iZmmQCC7ndZA@AtPsYm!(Zu4L%tZLtwMQ5`JEhns9wc5Yi=HAuH#0*UBX& z(DyR8Db3(qE%(oAR{8=~g@ZK#f5r+qgwK~hn-@%|U+1cwG3hn{^;x9<0@t5Q$w&pr zThtJY(9A($FghaSjXS(oGBu+;0pmZkTJr40xpq8f4=hvo?V z#ZCNtUK0;EN+SY6TM6^d;O%hwFq6 zh+x55xiYWJ^VrW3LE46!;(DUC?!M6sys=$f`fjTaw{ z4u>9L!e{yNcI30DKq=A9B9-9=u?OeQ1f;n5OwoiD;oL~F3fDrShVrgfGa?uXyC6=f z0q?j(ShB@K03oXBVz49y@>eo$7UDiEsWvm&8(w0uw%{*bhytH)Kz^68Jaz-x~|CogvLbpjvB0Yhn05Wuh5;^{o3rq=BYQascjbubIJq3^%7WI7j zs!+-5nY&u`JQv&=EDgEyy~2V(DbH)tByNK0DT=&bK#yR{p{`9wuI`NAXqNdiVwqz~ z2O?B!<@uG1PhvK2r*umM^dPoAxPj)rDpHWb+~SX5vrXNTplz>(q^{93X$2N6G7RXN zmGY2d)Cm~CtAcBe#=&)*mDXUXPZ^^p7>>+tw%CO{uO$(O{y$VK{w@Q{95#s3Phs1R z)lL_qz%P&I&5GIfr-*%N1^ROa*0_F&NFkfq*gxspx@igatw?I3f#97{zWnLDY9@VJ zjdLL2(Zj2N1cCp@0&I!iW}@&B@qCMUvl_iuupQP@%@Tc!K6&(DR&YapIIj-r3iV^y z65Yx)aA4ef1HXjZLtZCls2miI_eMU1^&!SuOL}2Zc;N^0dLfl7ZCDphNFpu?#P_?o zegYdL>dYpXg=?Zon!EE$m5gc}bm<-}64#|}VObzbk=gj1P=Xg*(SyzKK=h9A9DE}a z=@m#5l{9=L@T^0E@GN=~0bO=I&CcE8A2M(|wS*7Q5ek`^*9BO|21G1t_{1{sh7(0@ z5ifSY#w_ez!iUFBq+Hyz#BW-u1bN@V0Sgh0iztQp@_#u{^i%GM)x^iaM#4XlexZY& zMmk*4K@t4kuQG5gd}ZOAXrrlCyI&ru+L!I)L$%&&w$#S@cccw$B&s#_Kx?R7wcc%Y z+UptYRX2~Hb-G&pS+%{dCYG|&UD#1y9v-ynEnM!jyK1|eSkFlk7RPEmd1hhH1xb{G zxC<8z@qLg}lC|fZMq0mBSQe`ACDd#Upm|h%u8OVeS#FnDuC^OmVj;K3uz8E`S!oBh z4q9KR2d!tFP9x=ko3Q#qJ^Bj2iY;HElohxh|CQx`9d?e7TeSmqJ%?@GQn+tHx&e7{ zH2knwewT%UNXq0K?U=Zyra`2?WnlFjPo%kT^mE6;XZp^aC_xhQ10|mM6wP;4C6#$t z_XA>{=WCQPf3HgMyZ__pUH{9!{_8i{JH^8JF{D=s6PHvndpq5CRrxeMU<|dxv52SO z4D>HmWz3l4RZ6ATuV1GYOS;d-!2t9V$I{slul(BYv#^H;BP%bVLG8{(jz{wtJU`F!Oevy-v(|Uf#$Gs; z4aTy`Wa;5tR*ZYU$vy}`D;0rSsZ7D*r(kb?32O(VpMDgN!9ETKo{9OWczhZ&W}{+f LFvENcZvp-T)I626 literal 0 HcmV?d00001 diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/AnnotateVideoProgress.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/AnnotateVideoProgress.php new file mode 100644 index 000000000000..a62db0ec9e6d --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/AnnotateVideoProgress.php @@ -0,0 +1,69 @@ +google.cloud.videointelligence.v1beta2.AnnotateVideoProgress + */ +class AnnotateVideoProgress extends \Google\Protobuf\Internal\Message +{ + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.VideoAnnotationProgress annotation_progress = 1; + */ + private $annotation_progress; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\VideoAnnotationProgress>|\Google\Protobuf\Internal\RepeatedField $annotation_progress + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.VideoAnnotationProgress annotation_progress = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnnotationProgress() + { + return $this->annotation_progress; + } + + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.VideoAnnotationProgress annotation_progress = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\VideoAnnotationProgress>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnnotationProgress($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\VideoAnnotationProgress::class); + $this->annotation_progress = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/AnnotateVideoRequest.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/AnnotateVideoRequest.php new file mode 100644 index 000000000000..b051328890df --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/AnnotateVideoRequest.php @@ -0,0 +1,327 @@ +google.cloud.videointelligence.v1beta2.AnnotateVideoRequest + */ +class AnnotateVideoRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Input video location. Currently, only + * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). A video URI + * may include wildcards in `object-id`, and thus identify multiple videos. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` should be unset. + * + * Generated from protobuf field string input_uri = 1; + */ + protected $input_uri = ''; + /** + * The video data bytes. + * If unset, the input video(s) should be specified via `input_uri`. + * If set, `input_uri` should be unset. + * + * Generated from protobuf field bytes input_content = 6; + */ + protected $input_content = ''; + /** + * Required. Requested video annotation features. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.Feature features = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + private $features; + /** + * Additional video context and/or feature-specific parameters. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.VideoContext video_context = 3; + */ + protected $video_context = null; + /** + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * + * Generated from protobuf field string output_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $output_uri = ''; + /** + * Optional. Cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + * is specified, a region will be determined based on video file location. + * + * Generated from protobuf field string location_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $location_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $input_uri + * Input video location. Currently, only + * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). A video URI + * may include wildcards in `object-id`, and thus identify multiple videos. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` should be unset. + * @type string $input_content + * The video data bytes. + * If unset, the input video(s) should be specified via `input_uri`. + * If set, `input_uri` should be unset. + * @type array|\Google\Protobuf\Internal\RepeatedField $features + * Required. Requested video annotation features. + * @type \Google\Cloud\VideoIntelligence\V1beta2\VideoContext $video_context + * Additional video context and/or feature-specific parameters. + * @type string $output_uri + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * @type string $location_id + * Optional. Cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + * is specified, a region will be determined based on video file location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Input video location. Currently, only + * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). A video URI + * may include wildcards in `object-id`, and thus identify multiple videos. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` should be unset. + * + * Generated from protobuf field string input_uri = 1; + * @return string + */ + public function getInputUri() + { + return $this->input_uri; + } + + /** + * Input video location. Currently, only + * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). A video URI + * may include wildcards in `object-id`, and thus identify multiple videos. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` should be unset. + * + * Generated from protobuf field string input_uri = 1; + * @param string $var + * @return $this + */ + public function setInputUri($var) + { + GPBUtil::checkString($var, True); + $this->input_uri = $var; + + return $this; + } + + /** + * The video data bytes. + * If unset, the input video(s) should be specified via `input_uri`. + * If set, `input_uri` should be unset. + * + * Generated from protobuf field bytes input_content = 6; + * @return string + */ + public function getInputContent() + { + return $this->input_content; + } + + /** + * The video data bytes. + * If unset, the input video(s) should be specified via `input_uri`. + * If set, `input_uri` should be unset. + * + * Generated from protobuf field bytes input_content = 6; + * @param string $var + * @return $this + */ + public function setInputContent($var) + { + GPBUtil::checkString($var, False); + $this->input_content = $var; + + return $this; + } + + /** + * Required. Requested video annotation features. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.Feature features = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFeatures() + { + return $this->features; + } + + /** + * Required. Requested video annotation features. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.Feature features = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFeatures($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\VideoIntelligence\V1beta2\Feature::class); + $this->features = $arr; + + return $this; + } + + /** + * Additional video context and/or feature-specific parameters. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.VideoContext video_context = 3; + * @return \Google\Cloud\VideoIntelligence\V1beta2\VideoContext|null + */ + public function getVideoContext() + { + return $this->video_context; + } + + public function hasVideoContext() + { + return isset($this->video_context); + } + + public function clearVideoContext() + { + unset($this->video_context); + } + + /** + * Additional video context and/or feature-specific parameters. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.VideoContext video_context = 3; + * @param \Google\Cloud\VideoIntelligence\V1beta2\VideoContext $var + * @return $this + */ + public function setVideoContext($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1beta2\VideoContext::class); + $this->video_context = $var; + + return $this; + } + + /** + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * + * Generated from protobuf field string output_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOutputUri() + { + return $this->output_uri; + } + + /** + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * + * Generated from protobuf field string output_uri = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOutputUri($var) + { + GPBUtil::checkString($var, True); + $this->output_uri = $var; + + return $this; + } + + /** + * Optional. Cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + * is specified, a region will be determined based on video file location. + * + * Generated from protobuf field string location_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getLocationId() + { + return $this->location_id; + } + + /** + * Optional. Cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + * is specified, a region will be determined based on video file location. + * + * Generated from protobuf field string location_id = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setLocationId($var) + { + GPBUtil::checkString($var, True); + $this->location_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/AnnotateVideoResponse.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/AnnotateVideoResponse.php new file mode 100644 index 000000000000..15bca10c2956 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/AnnotateVideoResponse.php @@ -0,0 +1,69 @@ +google.cloud.videointelligence.v1beta2.AnnotateVideoResponse + */ +class AnnotateVideoResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.VideoAnnotationResults annotation_results = 1; + */ + private $annotation_results; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\VideoAnnotationResults>|\Google\Protobuf\Internal\RepeatedField $annotation_results + * Annotation results for all videos specified in `AnnotateVideoRequest`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.VideoAnnotationResults annotation_results = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAnnotationResults() + { + return $this->annotation_results; + } + + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.VideoAnnotationResults annotation_results = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\VideoAnnotationResults>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAnnotationResults($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\VideoAnnotationResults::class); + $this->annotation_results = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/Entity.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/Entity.php new file mode 100644 index 000000000000..93ddc343cce2 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/Entity.php @@ -0,0 +1,143 @@ +google.cloud.videointelligence.v1beta2.Entity + */ +class Entity extends \Google\Protobuf\Internal\Message +{ + /** + * Opaque entity ID. Some IDs may be available in + * [Google Knowledge Graph Search + * API](https://developers.google.com/knowledge-graph/). + * + * Generated from protobuf field string entity_id = 1; + */ + protected $entity_id = ''; + /** + * Textual description, e.g. `Fixed-gear bicycle`. + * + * Generated from protobuf field string description = 2; + */ + protected $description = ''; + /** + * Language code for `description` in BCP-47 format. + * + * Generated from protobuf field string language_code = 3; + */ + protected $language_code = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $entity_id + * Opaque entity ID. Some IDs may be available in + * [Google Knowledge Graph Search + * API](https://developers.google.com/knowledge-graph/). + * @type string $description + * Textual description, e.g. `Fixed-gear bicycle`. + * @type string $language_code + * Language code for `description` in BCP-47 format. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Opaque entity ID. Some IDs may be available in + * [Google Knowledge Graph Search + * API](https://developers.google.com/knowledge-graph/). + * + * Generated from protobuf field string entity_id = 1; + * @return string + */ + public function getEntityId() + { + return $this->entity_id; + } + + /** + * Opaque entity ID. Some IDs may be available in + * [Google Knowledge Graph Search + * API](https://developers.google.com/knowledge-graph/). + * + * Generated from protobuf field string entity_id = 1; + * @param string $var + * @return $this + */ + public function setEntityId($var) + { + GPBUtil::checkString($var, True); + $this->entity_id = $var; + + return $this; + } + + /** + * Textual description, e.g. `Fixed-gear bicycle`. + * + * Generated from protobuf field string description = 2; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Textual description, e.g. `Fixed-gear bicycle`. + * + * Generated from protobuf field string description = 2; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Language code for `description` in BCP-47 format. + * + * Generated from protobuf field string language_code = 3; + * @return string + */ + public function getLanguageCode() + { + return $this->language_code; + } + + /** + * Language code for `description` in BCP-47 format. + * + * Generated from protobuf field string language_code = 3; + * @param string $var + * @return $this + */ + public function setLanguageCode($var) + { + GPBUtil::checkString($var, True); + $this->language_code = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ExplicitContentAnnotation.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ExplicitContentAnnotation.php new file mode 100644 index 000000000000..56d9364b24ed --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ExplicitContentAnnotation.php @@ -0,0 +1,69 @@ +google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation + */ +class ExplicitContentAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * All video frames where explicit content was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.ExplicitContentFrame frames = 1; + */ + private $frames; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\ExplicitContentFrame>|\Google\Protobuf\Internal\RepeatedField $frames + * All video frames where explicit content was detected. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * All video frames where explicit content was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.ExplicitContentFrame frames = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrames() + { + return $this->frames; + } + + /** + * All video frames where explicit content was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.ExplicitContentFrame frames = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\ExplicitContentFrame>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\ExplicitContentFrame::class); + $this->frames = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ExplicitContentDetectionConfig.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ExplicitContentDetectionConfig.php new file mode 100644 index 000000000000..75f2f4a8af89 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ExplicitContentDetectionConfig.php @@ -0,0 +1,75 @@ +google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig + */ +class ExplicitContentDetectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Model to use for explicit content detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + */ + protected $model = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Model to use for explicit content detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Model to use for explicit content detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Model to use for explicit content detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ExplicitContentFrame.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ExplicitContentFrame.php new file mode 100644 index 000000000000..a4acccf7f268 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ExplicitContentFrame.php @@ -0,0 +1,115 @@ +google.cloud.videointelligence.v1beta2.ExplicitContentFrame + */ +class ExplicitContentFrame extends \Google\Protobuf\Internal\Message +{ + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 1; + */ + protected $time_offset = null; + /** + * Likelihood of the pornography content.. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.Likelihood pornography_likelihood = 2; + */ + protected $pornography_likelihood = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $time_offset + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * @type int $pornography_likelihood + * Likelihood of the pornography content.. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeOffset() + { + return $this->time_offset; + } + + public function hasTimeOffset() + { + return isset($this->time_offset); + } + + public function clearTimeOffset() + { + unset($this->time_offset); + } + + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->time_offset = $var; + + return $this; + } + + /** + * Likelihood of the pornography content.. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.Likelihood pornography_likelihood = 2; + * @return int + */ + public function getPornographyLikelihood() + { + return $this->pornography_likelihood; + } + + /** + * Likelihood of the pornography content.. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.Likelihood pornography_likelihood = 2; + * @param int $var + * @return $this + */ + public function setPornographyLikelihood($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VideoIntelligence\V1beta2\Likelihood::class); + $this->pornography_likelihood = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceAnnotation.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceAnnotation.php new file mode 100644 index 000000000000..7b8e31709109 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceAnnotation.php @@ -0,0 +1,135 @@ +google.cloud.videointelligence.v1beta2.FaceAnnotation + */ +class FaceAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Thumbnail of a representative face view (in JPEG format). + * + * Generated from protobuf field bytes thumbnail = 1; + */ + protected $thumbnail = ''; + /** + * All video segments where a face was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.FaceSegment segments = 2; + */ + private $segments; + /** + * All video frames where a face was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.FaceFrame frames = 3; + */ + private $frames; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $thumbnail + * Thumbnail of a representative face view (in JPEG format). + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\FaceSegment>|\Google\Protobuf\Internal\RepeatedField $segments + * All video segments where a face was detected. + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\FaceFrame>|\Google\Protobuf\Internal\RepeatedField $frames + * All video frames where a face was detected. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Thumbnail of a representative face view (in JPEG format). + * + * Generated from protobuf field bytes thumbnail = 1; + * @return string + */ + public function getThumbnail() + { + return $this->thumbnail; + } + + /** + * Thumbnail of a representative face view (in JPEG format). + * + * Generated from protobuf field bytes thumbnail = 1; + * @param string $var + * @return $this + */ + public function setThumbnail($var) + { + GPBUtil::checkString($var, False); + $this->thumbnail = $var; + + return $this; + } + + /** + * All video segments where a face was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.FaceSegment segments = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSegments() + { + return $this->segments; + } + + /** + * All video segments where a face was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.FaceSegment segments = 2; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\FaceSegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSegments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\FaceSegment::class); + $this->segments = $arr; + + return $this; + } + + /** + * All video frames where a face was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.FaceFrame frames = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrames() + { + return $this->frames; + } + + /** + * All video frames where a face was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.FaceFrame frames = 3; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\FaceFrame>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\FaceFrame::class); + $this->frames = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceDetectionConfig.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceDetectionConfig.php new file mode 100644 index 000000000000..350580eb3ff3 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceDetectionConfig.php @@ -0,0 +1,109 @@ +google.cloud.videointelligence.v1beta2.FaceDetectionConfig + */ +class FaceDetectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Model to use for face detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + */ + protected $model = ''; + /** + * Whether bounding boxes be included in the face annotation output. + * + * Generated from protobuf field bool include_bounding_boxes = 2; + */ + protected $include_bounding_boxes = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Model to use for face detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * @type bool $include_bounding_boxes + * Whether bounding boxes be included in the face annotation output. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Model to use for face detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Model to use for face detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + + /** + * Whether bounding boxes be included in the face annotation output. + * + * Generated from protobuf field bool include_bounding_boxes = 2; + * @return bool + */ + public function getIncludeBoundingBoxes() + { + return $this->include_bounding_boxes; + } + + /** + * Whether bounding boxes be included in the face annotation output. + * + * Generated from protobuf field bool include_bounding_boxes = 2; + * @param bool $var + * @return $this + */ + public function setIncludeBoundingBoxes($var) + { + GPBUtil::checkBool($var); + $this->include_bounding_boxes = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceFrame.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceFrame.php new file mode 100644 index 000000000000..4e0b3f33afed --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceFrame.php @@ -0,0 +1,123 @@ +google.cloud.videointelligence.v1beta2.FaceFrame + */ +class FaceFrame extends \Google\Protobuf\Internal\Message +{ + /** + * Normalized Bounding boxes in a frame. + * There can be more than one boxes if the same face is detected in multiple + * locations within the current frame. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.NormalizedBoundingBox normalized_bounding_boxes = 1; + */ + private $normalized_bounding_boxes; + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + */ + protected $time_offset = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\NormalizedBoundingBox>|\Google\Protobuf\Internal\RepeatedField $normalized_bounding_boxes + * Normalized Bounding boxes in a frame. + * There can be more than one boxes if the same face is detected in multiple + * locations within the current frame. + * @type \Google\Protobuf\Duration $time_offset + * Time-offset, relative to the beginning of the video, + * corresponding to the video frame for this location. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Normalized Bounding boxes in a frame. + * There can be more than one boxes if the same face is detected in multiple + * locations within the current frame. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.NormalizedBoundingBox normalized_bounding_boxes = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNormalizedBoundingBoxes() + { + return $this->normalized_bounding_boxes; + } + + /** + * Normalized Bounding boxes in a frame. + * There can be more than one boxes if the same face is detected in multiple + * locations within the current frame. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.NormalizedBoundingBox normalized_bounding_boxes = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\NormalizedBoundingBox>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNormalizedBoundingBoxes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\NormalizedBoundingBox::class); + $this->normalized_bounding_boxes = $arr; + + return $this; + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeOffset() + { + return $this->time_offset; + } + + public function hasTimeOffset() + { + return isset($this->time_offset); + } + + public function clearTimeOffset() + { + unset($this->time_offset); + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->time_offset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceSegment.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceSegment.php new file mode 100644 index 000000000000..47abe5a8e46b --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/FaceSegment.php @@ -0,0 +1,77 @@ +google.cloud.videointelligence.v1beta2.FaceSegment + */ +class FaceSegment extends \Google\Protobuf\Internal\Message +{ + /** + * Video segment where a face was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.VideoSegment segment = 1; + */ + protected $segment = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1beta2\VideoSegment $segment + * Video segment where a face was detected. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Video segment where a face was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.VideoSegment segment = 1; + * @return \Google\Cloud\VideoIntelligence\V1beta2\VideoSegment|null + */ + public function getSegment() + { + return $this->segment; + } + + public function hasSegment() + { + return isset($this->segment); + } + + public function clearSegment() + { + unset($this->segment); + } + + /** + * Video segment where a face was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.VideoSegment segment = 1; + * @param \Google\Cloud\VideoIntelligence\V1beta2\VideoSegment $var + * @return $this + */ + public function setSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1beta2\VideoSegment::class); + $this->segment = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/Feature.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/Feature.php new file mode 100644 index 000000000000..bee87e3b163f --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/Feature.php @@ -0,0 +1,75 @@ +google.cloud.videointelligence.v1beta2.Feature + */ +class Feature +{ + /** + * Unspecified. + * + * Generated from protobuf enum FEATURE_UNSPECIFIED = 0; + */ + const FEATURE_UNSPECIFIED = 0; + /** + * Label detection. Detect objects, such as dog or flower. + * + * Generated from protobuf enum LABEL_DETECTION = 1; + */ + const LABEL_DETECTION = 1; + /** + * Shot change detection. + * + * Generated from protobuf enum SHOT_CHANGE_DETECTION = 2; + */ + const SHOT_CHANGE_DETECTION = 2; + /** + * Explicit content detection. + * + * Generated from protobuf enum EXPLICIT_CONTENT_DETECTION = 3; + */ + const EXPLICIT_CONTENT_DETECTION = 3; + /** + * Human face detection and tracking. + * + * Generated from protobuf enum FACE_DETECTION = 4; + */ + const FACE_DETECTION = 4; + + private static $valueToName = [ + self::FEATURE_UNSPECIFIED => 'FEATURE_UNSPECIFIED', + self::LABEL_DETECTION => 'LABEL_DETECTION', + self::SHOT_CHANGE_DETECTION => 'SHOT_CHANGE_DETECTION', + self::EXPLICIT_CONTENT_DETECTION => 'EXPLICIT_CONTENT_DETECTION', + self::FACE_DETECTION => 'FACE_DETECTION', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelAnnotation.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelAnnotation.php new file mode 100644 index 000000000000..3aa1f0ee7dfc --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelAnnotation.php @@ -0,0 +1,191 @@ +google.cloud.videointelligence.v1beta2.LabelAnnotation + */ +class LabelAnnotation extends \Google\Protobuf\Internal\Message +{ + /** + * Detected entity. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.Entity entity = 1; + */ + protected $entity = null; + /** + * Common categories for the detected entity. + * E.g. when the label is `Terrier` the category is likely `dog`. And in some + * cases there might be more than one categories e.g. `Terrier` could also be + * a `pet`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.Entity category_entities = 2; + */ + private $category_entities; + /** + * All video segments where a label was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelSegment segments = 3; + */ + private $segments; + /** + * All video frames where a label was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelFrame frames = 4; + */ + private $frames; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1beta2\Entity $entity + * Detected entity. + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\Entity>|\Google\Protobuf\Internal\RepeatedField $category_entities + * Common categories for the detected entity. + * E.g. when the label is `Terrier` the category is likely `dog`. And in some + * cases there might be more than one categories e.g. `Terrier` could also be + * a `pet`. + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\LabelSegment>|\Google\Protobuf\Internal\RepeatedField $segments + * All video segments where a label was detected. + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\LabelFrame>|\Google\Protobuf\Internal\RepeatedField $frames + * All video frames where a label was detected. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Detected entity. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.Entity entity = 1; + * @return \Google\Cloud\VideoIntelligence\V1beta2\Entity|null + */ + public function getEntity() + { + return $this->entity; + } + + public function hasEntity() + { + return isset($this->entity); + } + + public function clearEntity() + { + unset($this->entity); + } + + /** + * Detected entity. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.Entity entity = 1; + * @param \Google\Cloud\VideoIntelligence\V1beta2\Entity $var + * @return $this + */ + public function setEntity($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1beta2\Entity::class); + $this->entity = $var; + + return $this; + } + + /** + * Common categories for the detected entity. + * E.g. when the label is `Terrier` the category is likely `dog`. And in some + * cases there might be more than one categories e.g. `Terrier` could also be + * a `pet`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.Entity category_entities = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCategoryEntities() + { + return $this->category_entities; + } + + /** + * Common categories for the detected entity. + * E.g. when the label is `Terrier` the category is likely `dog`. And in some + * cases there might be more than one categories e.g. `Terrier` could also be + * a `pet`. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.Entity category_entities = 2; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\Entity>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCategoryEntities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\Entity::class); + $this->category_entities = $arr; + + return $this; + } + + /** + * All video segments where a label was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelSegment segments = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSegments() + { + return $this->segments; + } + + /** + * All video segments where a label was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelSegment segments = 3; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\LabelSegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSegments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\LabelSegment::class); + $this->segments = $arr; + + return $this; + } + + /** + * All video frames where a label was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelFrame frames = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrames() + { + return $this->frames; + } + + /** + * All video frames where a label was detected. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelFrame frames = 4; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\LabelFrame>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrames($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\LabelFrame::class); + $this->frames = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelDetectionConfig.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelDetectionConfig.php new file mode 100644 index 000000000000..ae04363e8791 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelDetectionConfig.php @@ -0,0 +1,159 @@ +google.cloud.videointelligence.v1beta2.LabelDetectionConfig + */ +class LabelDetectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * What labels should be detected with LABEL_DETECTION, in addition to + * video-level labels or segment-level labels. + * If unspecified, defaults to `SHOT_MODE`. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.LabelDetectionMode label_detection_mode = 1; + */ + protected $label_detection_mode = 0; + /** + * Whether the video has been shot from a stationary (i.e. non-moving) camera. + * When set to true, might improve detection accuracy for moving objects. + * Should be used with `SHOT_AND_FRAME_MODE` enabled. + * + * Generated from protobuf field bool stationary_camera = 2; + */ + protected $stationary_camera = false; + /** + * Model to use for label detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 3; + */ + protected $model = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $label_detection_mode + * What labels should be detected with LABEL_DETECTION, in addition to + * video-level labels or segment-level labels. + * If unspecified, defaults to `SHOT_MODE`. + * @type bool $stationary_camera + * Whether the video has been shot from a stationary (i.e. non-moving) camera. + * When set to true, might improve detection accuracy for moving objects. + * Should be used with `SHOT_AND_FRAME_MODE` enabled. + * @type string $model + * Model to use for label detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * What labels should be detected with LABEL_DETECTION, in addition to + * video-level labels or segment-level labels. + * If unspecified, defaults to `SHOT_MODE`. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.LabelDetectionMode label_detection_mode = 1; + * @return int + */ + public function getLabelDetectionMode() + { + return $this->label_detection_mode; + } + + /** + * What labels should be detected with LABEL_DETECTION, in addition to + * video-level labels or segment-level labels. + * If unspecified, defaults to `SHOT_MODE`. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.LabelDetectionMode label_detection_mode = 1; + * @param int $var + * @return $this + */ + public function setLabelDetectionMode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VideoIntelligence\V1beta2\LabelDetectionMode::class); + $this->label_detection_mode = $var; + + return $this; + } + + /** + * Whether the video has been shot from a stationary (i.e. non-moving) camera. + * When set to true, might improve detection accuracy for moving objects. + * Should be used with `SHOT_AND_FRAME_MODE` enabled. + * + * Generated from protobuf field bool stationary_camera = 2; + * @return bool + */ + public function getStationaryCamera() + { + return $this->stationary_camera; + } + + /** + * Whether the video has been shot from a stationary (i.e. non-moving) camera. + * When set to true, might improve detection accuracy for moving objects. + * Should be used with `SHOT_AND_FRAME_MODE` enabled. + * + * Generated from protobuf field bool stationary_camera = 2; + * @param bool $var + * @return $this + */ + public function setStationaryCamera($var) + { + GPBUtil::checkBool($var); + $this->stationary_camera = $var; + + return $this; + } + + /** + * Model to use for label detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 3; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Model to use for label detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 3; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelDetectionMode.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelDetectionMode.php new file mode 100644 index 000000000000..32e8cfccd76e --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelDetectionMode.php @@ -0,0 +1,68 @@ +google.cloud.videointelligence.v1beta2.LabelDetectionMode + */ +class LabelDetectionMode +{ + /** + * Unspecified. + * + * Generated from protobuf enum LABEL_DETECTION_MODE_UNSPECIFIED = 0; + */ + const LABEL_DETECTION_MODE_UNSPECIFIED = 0; + /** + * Detect shot-level labels. + * + * Generated from protobuf enum SHOT_MODE = 1; + */ + const SHOT_MODE = 1; + /** + * Detect frame-level labels. + * + * Generated from protobuf enum FRAME_MODE = 2; + */ + const FRAME_MODE = 2; + /** + * Detect both shot-level and frame-level labels. + * + * Generated from protobuf enum SHOT_AND_FRAME_MODE = 3; + */ + const SHOT_AND_FRAME_MODE = 3; + + private static $valueToName = [ + self::LABEL_DETECTION_MODE_UNSPECIFIED => 'LABEL_DETECTION_MODE_UNSPECIFIED', + self::SHOT_MODE => 'SHOT_MODE', + self::FRAME_MODE => 'FRAME_MODE', + self::SHOT_AND_FRAME_MODE => 'SHOT_AND_FRAME_MODE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelFrame.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelFrame.php new file mode 100644 index 000000000000..5f8c46878c3e --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelFrame.php @@ -0,0 +1,115 @@ +google.cloud.videointelligence.v1beta2.LabelFrame + */ +class LabelFrame extends \Google\Protobuf\Internal\Message +{ + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 1; + */ + protected $time_offset = null; + /** + * Confidence that the label is accurate. Range: [0, 1]. + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $time_offset + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * @type float $confidence + * Confidence that the label is accurate. Range: [0, 1]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getTimeOffset() + { + return $this->time_offset; + } + + public function hasTimeOffset() + { + return isset($this->time_offset); + } + + public function clearTimeOffset() + { + unset($this->time_offset); + } + + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + * + * Generated from protobuf field .google.protobuf.Duration time_offset = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->time_offset = $var; + + return $this; + } + + /** + * Confidence that the label is accurate. Range: [0, 1]. + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Confidence that the label is accurate. Range: [0, 1]. + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelSegment.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelSegment.php new file mode 100644 index 000000000000..a88a5e7cd07c --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/LabelSegment.php @@ -0,0 +1,111 @@ +google.cloud.videointelligence.v1beta2.LabelSegment + */ +class LabelSegment extends \Google\Protobuf\Internal\Message +{ + /** + * Video segment where a label was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.VideoSegment segment = 1; + */ + protected $segment = null; + /** + * Confidence that the label is accurate. Range: [0, 1]. + * + * Generated from protobuf field float confidence = 2; + */ + protected $confidence = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VideoIntelligence\V1beta2\VideoSegment $segment + * Video segment where a label was detected. + * @type float $confidence + * Confidence that the label is accurate. Range: [0, 1]. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Video segment where a label was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.VideoSegment segment = 1; + * @return \Google\Cloud\VideoIntelligence\V1beta2\VideoSegment|null + */ + public function getSegment() + { + return $this->segment; + } + + public function hasSegment() + { + return isset($this->segment); + } + + public function clearSegment() + { + unset($this->segment); + } + + /** + * Video segment where a label was detected. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.VideoSegment segment = 1; + * @param \Google\Cloud\VideoIntelligence\V1beta2\VideoSegment $var + * @return $this + */ + public function setSegment($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1beta2\VideoSegment::class); + $this->segment = $var; + + return $this; + } + + /** + * Confidence that the label is accurate. Range: [0, 1]. + * + * Generated from protobuf field float confidence = 2; + * @return float + */ + public function getConfidence() + { + return $this->confidence; + } + + /** + * Confidence that the label is accurate. Range: [0, 1]. + * + * Generated from protobuf field float confidence = 2; + * @param float $var + * @return $this + */ + public function setConfidence($var) + { + GPBUtil::checkFloat($var); + $this->confidence = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/Likelihood.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/Likelihood.php new file mode 100644 index 000000000000..e6446ff822aa --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/Likelihood.php @@ -0,0 +1,82 @@ +google.cloud.videointelligence.v1beta2.Likelihood + */ +class Likelihood +{ + /** + * Unspecified likelihood. + * + * Generated from protobuf enum LIKELIHOOD_UNSPECIFIED = 0; + */ + const LIKELIHOOD_UNSPECIFIED = 0; + /** + * Very unlikely. + * + * Generated from protobuf enum VERY_UNLIKELY = 1; + */ + const VERY_UNLIKELY = 1; + /** + * Unlikely. + * + * Generated from protobuf enum UNLIKELY = 2; + */ + const UNLIKELY = 2; + /** + * Possible. + * + * Generated from protobuf enum POSSIBLE = 3; + */ + const POSSIBLE = 3; + /** + * Likely. + * + * Generated from protobuf enum LIKELY = 4; + */ + const LIKELY = 4; + /** + * Very likely. + * + * Generated from protobuf enum VERY_LIKELY = 5; + */ + const VERY_LIKELY = 5; + + private static $valueToName = [ + self::LIKELIHOOD_UNSPECIFIED => 'LIKELIHOOD_UNSPECIFIED', + self::VERY_UNLIKELY => 'VERY_UNLIKELY', + self::UNLIKELY => 'UNLIKELY', + self::POSSIBLE => 'POSSIBLE', + self::LIKELY => 'LIKELY', + self::VERY_LIKELY => 'VERY_LIKELY', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/NormalizedBoundingBox.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/NormalizedBoundingBox.php new file mode 100644 index 000000000000..06cb95229c8d --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/NormalizedBoundingBox.php @@ -0,0 +1,171 @@ +google.cloud.videointelligence.v1beta2.NormalizedBoundingBox + */ +class NormalizedBoundingBox extends \Google\Protobuf\Internal\Message +{ + /** + * Left X coordinate. + * + * Generated from protobuf field float left = 1; + */ + protected $left = 0.0; + /** + * Top Y coordinate. + * + * Generated from protobuf field float top = 2; + */ + protected $top = 0.0; + /** + * Right X coordinate. + * + * Generated from protobuf field float right = 3; + */ + protected $right = 0.0; + /** + * Bottom Y coordinate. + * + * Generated from protobuf field float bottom = 4; + */ + protected $bottom = 0.0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type float $left + * Left X coordinate. + * @type float $top + * Top Y coordinate. + * @type float $right + * Right X coordinate. + * @type float $bottom + * Bottom Y coordinate. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Left X coordinate. + * + * Generated from protobuf field float left = 1; + * @return float + */ + public function getLeft() + { + return $this->left; + } + + /** + * Left X coordinate. + * + * Generated from protobuf field float left = 1; + * @param float $var + * @return $this + */ + public function setLeft($var) + { + GPBUtil::checkFloat($var); + $this->left = $var; + + return $this; + } + + /** + * Top Y coordinate. + * + * Generated from protobuf field float top = 2; + * @return float + */ + public function getTop() + { + return $this->top; + } + + /** + * Top Y coordinate. + * + * Generated from protobuf field float top = 2; + * @param float $var + * @return $this + */ + public function setTop($var) + { + GPBUtil::checkFloat($var); + $this->top = $var; + + return $this; + } + + /** + * Right X coordinate. + * + * Generated from protobuf field float right = 3; + * @return float + */ + public function getRight() + { + return $this->right; + } + + /** + * Right X coordinate. + * + * Generated from protobuf field float right = 3; + * @param float $var + * @return $this + */ + public function setRight($var) + { + GPBUtil::checkFloat($var); + $this->right = $var; + + return $this; + } + + /** + * Bottom Y coordinate. + * + * Generated from protobuf field float bottom = 4; + * @return float + */ + public function getBottom() + { + return $this->bottom; + } + + /** + * Bottom Y coordinate. + * + * Generated from protobuf field float bottom = 4; + * @param float $var + * @return $this + */ + public function setBottom($var) + { + GPBUtil::checkFloat($var); + $this->bottom = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ShotChangeDetectionConfig.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ShotChangeDetectionConfig.php new file mode 100644 index 000000000000..f461114a29fd --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/ShotChangeDetectionConfig.php @@ -0,0 +1,75 @@ +google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig + */ +class ShotChangeDetectionConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Model to use for shot change detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + */ + protected $model = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $model + * Model to use for shot change detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Model to use for shot change detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @return string + */ + public function getModel() + { + return $this->model; + } + + /** + * Model to use for shot change detection. + * Supported values: "builtin/stable" (the default if unset) and + * "builtin/latest". + * + * Generated from protobuf field string model = 1; + * @param string $var + * @return $this + */ + public function setModel($var) + { + GPBUtil::checkString($var, True); + $this->model = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoAnnotationProgress.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoAnnotationProgress.php new file mode 100644 index 000000000000..5f45313b4864 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoAnnotationProgress.php @@ -0,0 +1,197 @@ +google.cloud.videointelligence.v1beta2.VideoAnnotationProgress + */ +class VideoAnnotationProgress extends \Google\Protobuf\Internal\Message +{ + /** + * Video file location in + * [Google Cloud Storage](https://cloud.google.com/storage/). + * + * Generated from protobuf field string input_uri = 1; + */ + protected $input_uri = ''; + /** + * Approximate percentage processed thus far. + * Guaranteed to be 100 when fully processed. + * + * Generated from protobuf field int32 progress_percent = 2; + */ + protected $progress_percent = 0; + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; + */ + protected $start_time = null; + /** + * Time of the most recent update. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + */ + protected $update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $input_uri + * Video file location in + * [Google Cloud Storage](https://cloud.google.com/storage/). + * @type int $progress_percent + * Approximate percentage processed thus far. + * Guaranteed to be 100 when fully processed. + * @type \Google\Protobuf\Timestamp $start_time + * Time when the request was received. + * @type \Google\Protobuf\Timestamp $update_time + * Time of the most recent update. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Video file location in + * [Google Cloud Storage](https://cloud.google.com/storage/). + * + * Generated from protobuf field string input_uri = 1; + * @return string + */ + public function getInputUri() + { + return $this->input_uri; + } + + /** + * Video file location in + * [Google Cloud Storage](https://cloud.google.com/storage/). + * + * Generated from protobuf field string input_uri = 1; + * @param string $var + * @return $this + */ + public function setInputUri($var) + { + GPBUtil::checkString($var, True); + $this->input_uri = $var; + + return $this; + } + + /** + * Approximate percentage processed thus far. + * Guaranteed to be 100 when fully processed. + * + * Generated from protobuf field int32 progress_percent = 2; + * @return int + */ + public function getProgressPercent() + { + return $this->progress_percent; + } + + /** + * Approximate percentage processed thus far. + * Guaranteed to be 100 when fully processed. + * + * Generated from protobuf field int32 progress_percent = 2; + * @param int $var + * @return $this + */ + public function setProgressPercent($var) + { + GPBUtil::checkInt32($var); + $this->progress_percent = $var; + + return $this; + } + + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Time when the request was received. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 3; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Time of the most recent update. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Time of the most recent update. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 4; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoAnnotationResults.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoAnnotationResults.php new file mode 100644 index 000000000000..976fddaf8c43 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoAnnotationResults.php @@ -0,0 +1,345 @@ +google.cloud.videointelligence.v1beta2.VideoAnnotationResults + */ +class VideoAnnotationResults extends \Google\Protobuf\Internal\Message +{ + /** + * Video file location in + * [Google Cloud Storage](https://cloud.google.com/storage/). + * + * Generated from protobuf field string input_uri = 1; + */ + protected $input_uri = ''; + /** + * Label annotations on video level or user specified segment level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelAnnotation segment_label_annotations = 2; + */ + private $segment_label_annotations; + /** + * Label annotations on shot level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelAnnotation shot_label_annotations = 3; + */ + private $shot_label_annotations; + /** + * Label annotations on frame level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelAnnotation frame_label_annotations = 4; + */ + private $frame_label_annotations; + /** + * Face annotations. There is exactly one element for each unique face. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.FaceAnnotation face_annotations = 5; + */ + private $face_annotations; + /** + * Shot annotations. Each shot is represented as a video segment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.VideoSegment shot_annotations = 6; + */ + private $shot_annotations; + /** + * Explicit content annotation. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation explicit_annotation = 7; + */ + protected $explicit_annotation = null; + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + * + * Generated from protobuf field .google.rpc.Status error = 9; + */ + protected $error = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $input_uri + * Video file location in + * [Google Cloud Storage](https://cloud.google.com/storage/). + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $segment_label_annotations + * Label annotations on video level or user specified segment level. + * There is exactly one element for each unique label. + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $shot_label_annotations + * Label annotations on shot level. + * There is exactly one element for each unique label. + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $frame_label_annotations + * Label annotations on frame level. + * There is exactly one element for each unique label. + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\FaceAnnotation>|\Google\Protobuf\Internal\RepeatedField $face_annotations + * Face annotations. There is exactly one element for each unique face. + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\VideoSegment>|\Google\Protobuf\Internal\RepeatedField $shot_annotations + * Shot annotations. Each shot is represented as a video segment. + * @type \Google\Cloud\VideoIntelligence\V1beta2\ExplicitContentAnnotation $explicit_annotation + * Explicit content annotation. + * @type \Google\Rpc\Status $error + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Video file location in + * [Google Cloud Storage](https://cloud.google.com/storage/). + * + * Generated from protobuf field string input_uri = 1; + * @return string + */ + public function getInputUri() + { + return $this->input_uri; + } + + /** + * Video file location in + * [Google Cloud Storage](https://cloud.google.com/storage/). + * + * Generated from protobuf field string input_uri = 1; + * @param string $var + * @return $this + */ + public function setInputUri($var) + { + GPBUtil::checkString($var, True); + $this->input_uri = $var; + + return $this; + } + + /** + * Label annotations on video level or user specified segment level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelAnnotation segment_label_annotations = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSegmentLabelAnnotations() + { + return $this->segment_label_annotations; + } + + /** + * Label annotations on video level or user specified segment level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelAnnotation segment_label_annotations = 2; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSegmentLabelAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\LabelAnnotation::class); + $this->segment_label_annotations = $arr; + + return $this; + } + + /** + * Label annotations on shot level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelAnnotation shot_label_annotations = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShotLabelAnnotations() + { + return $this->shot_label_annotations; + } + + /** + * Label annotations on shot level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelAnnotation shot_label_annotations = 3; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShotLabelAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\LabelAnnotation::class); + $this->shot_label_annotations = $arr; + + return $this; + } + + /** + * Label annotations on frame level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelAnnotation frame_label_annotations = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFrameLabelAnnotations() + { + return $this->frame_label_annotations; + } + + /** + * Label annotations on frame level. + * There is exactly one element for each unique label. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.LabelAnnotation frame_label_annotations = 4; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\LabelAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFrameLabelAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\LabelAnnotation::class); + $this->frame_label_annotations = $arr; + + return $this; + } + + /** + * Face annotations. There is exactly one element for each unique face. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.FaceAnnotation face_annotations = 5; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFaceAnnotations() + { + return $this->face_annotations; + } + + /** + * Face annotations. There is exactly one element for each unique face. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.FaceAnnotation face_annotations = 5; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\FaceAnnotation>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFaceAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\FaceAnnotation::class); + $this->face_annotations = $arr; + + return $this; + } + + /** + * Shot annotations. Each shot is represented as a video segment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.VideoSegment shot_annotations = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getShotAnnotations() + { + return $this->shot_annotations; + } + + /** + * Shot annotations. Each shot is represented as a video segment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.VideoSegment shot_annotations = 6; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\VideoSegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setShotAnnotations($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\VideoSegment::class); + $this->shot_annotations = $arr; + + return $this; + } + + /** + * Explicit content annotation. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation explicit_annotation = 7; + * @return \Google\Cloud\VideoIntelligence\V1beta2\ExplicitContentAnnotation|null + */ + public function getExplicitAnnotation() + { + return $this->explicit_annotation; + } + + public function hasExplicitAnnotation() + { + return isset($this->explicit_annotation); + } + + public function clearExplicitAnnotation() + { + unset($this->explicit_annotation); + } + + /** + * Explicit content annotation. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation explicit_annotation = 7; + * @param \Google\Cloud\VideoIntelligence\V1beta2\ExplicitContentAnnotation $var + * @return $this + */ + public function setExplicitAnnotation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1beta2\ExplicitContentAnnotation::class); + $this->explicit_annotation = $var; + + return $this; + } + + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + * + * Generated from protobuf field .google.rpc.Status error = 9; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + * + * Generated from protobuf field .google.rpc.Status error = 9; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoContext.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoContext.php new file mode 100644 index 000000000000..8d7922f911f3 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoContext.php @@ -0,0 +1,251 @@ +google.cloud.videointelligence.v1beta2.VideoContext + */ +class VideoContext extends \Google\Protobuf\Internal\Message +{ + /** + * Video segments to annotate. The segments may overlap and are not required + * to be contiguous or span the whole video. If unspecified, each video is + * treated as a single segment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1; + */ + private $segments; + /** + * Config for LABEL_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2; + */ + protected $label_detection_config = null; + /** + * Config for SHOT_CHANGE_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3; + */ + protected $shot_change_detection_config = null; + /** + * Config for EXPLICIT_CONTENT_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + */ + protected $explicit_content_detection_config = null; + /** + * Config for FACE_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5; + */ + protected $face_detection_config = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VideoIntelligence\V1beta2\VideoSegment>|\Google\Protobuf\Internal\RepeatedField $segments + * Video segments to annotate. The segments may overlap and are not required + * to be contiguous or span the whole video. If unspecified, each video is + * treated as a single segment. + * @type \Google\Cloud\VideoIntelligence\V1beta2\LabelDetectionConfig $label_detection_config + * Config for LABEL_DETECTION. + * @type \Google\Cloud\VideoIntelligence\V1beta2\ShotChangeDetectionConfig $shot_change_detection_config + * Config for SHOT_CHANGE_DETECTION. + * @type \Google\Cloud\VideoIntelligence\V1beta2\ExplicitContentDetectionConfig $explicit_content_detection_config + * Config for EXPLICIT_CONTENT_DETECTION. + * @type \Google\Cloud\VideoIntelligence\V1beta2\FaceDetectionConfig $face_detection_config + * Config for FACE_DETECTION. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Video segments to annotate. The segments may overlap and are not required + * to be contiguous or span the whole video. If unspecified, each video is + * treated as a single segment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSegments() + { + return $this->segments; + } + + /** + * Video segments to annotate. The segments may overlap and are not required + * to be contiguous or span the whole video. If unspecified, each video is + * treated as a single segment. + * + * Generated from protobuf field repeated .google.cloud.videointelligence.v1beta2.VideoSegment segments = 1; + * @param array<\Google\Cloud\VideoIntelligence\V1beta2\VideoSegment>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSegments($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VideoIntelligence\V1beta2\VideoSegment::class); + $this->segments = $arr; + + return $this; + } + + /** + * Config for LABEL_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2; + * @return \Google\Cloud\VideoIntelligence\V1beta2\LabelDetectionConfig|null + */ + public function getLabelDetectionConfig() + { + return $this->label_detection_config; + } + + public function hasLabelDetectionConfig() + { + return isset($this->label_detection_config); + } + + public function clearLabelDetectionConfig() + { + unset($this->label_detection_config); + } + + /** + * Config for LABEL_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.LabelDetectionConfig label_detection_config = 2; + * @param \Google\Cloud\VideoIntelligence\V1beta2\LabelDetectionConfig $var + * @return $this + */ + public function setLabelDetectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1beta2\LabelDetectionConfig::class); + $this->label_detection_config = $var; + + return $this; + } + + /** + * Config for SHOT_CHANGE_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3; + * @return \Google\Cloud\VideoIntelligence\V1beta2\ShotChangeDetectionConfig|null + */ + public function getShotChangeDetectionConfig() + { + return $this->shot_change_detection_config; + } + + public function hasShotChangeDetectionConfig() + { + return isset($this->shot_change_detection_config); + } + + public function clearShotChangeDetectionConfig() + { + unset($this->shot_change_detection_config); + } + + /** + * Config for SHOT_CHANGE_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig shot_change_detection_config = 3; + * @param \Google\Cloud\VideoIntelligence\V1beta2\ShotChangeDetectionConfig $var + * @return $this + */ + public function setShotChangeDetectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1beta2\ShotChangeDetectionConfig::class); + $this->shot_change_detection_config = $var; + + return $this; + } + + /** + * Config for EXPLICIT_CONTENT_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + * @return \Google\Cloud\VideoIntelligence\V1beta2\ExplicitContentDetectionConfig|null + */ + public function getExplicitContentDetectionConfig() + { + return $this->explicit_content_detection_config; + } + + public function hasExplicitContentDetectionConfig() + { + return isset($this->explicit_content_detection_config); + } + + public function clearExplicitContentDetectionConfig() + { + unset($this->explicit_content_detection_config); + } + + /** + * Config for EXPLICIT_CONTENT_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig explicit_content_detection_config = 4; + * @param \Google\Cloud\VideoIntelligence\V1beta2\ExplicitContentDetectionConfig $var + * @return $this + */ + public function setExplicitContentDetectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1beta2\ExplicitContentDetectionConfig::class); + $this->explicit_content_detection_config = $var; + + return $this; + } + + /** + * Config for FACE_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5; + * @return \Google\Cloud\VideoIntelligence\V1beta2\FaceDetectionConfig|null + */ + public function getFaceDetectionConfig() + { + return $this->face_detection_config; + } + + public function hasFaceDetectionConfig() + { + return isset($this->face_detection_config); + } + + public function clearFaceDetectionConfig() + { + unset($this->face_detection_config); + } + + /** + * Config for FACE_DETECTION. + * + * Generated from protobuf field .google.cloud.videointelligence.v1beta2.FaceDetectionConfig face_detection_config = 5; + * @param \Google\Cloud\VideoIntelligence\V1beta2\FaceDetectionConfig $var + * @return $this + */ + public function setFaceDetectionConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VideoIntelligence\V1beta2\FaceDetectionConfig::class); + $this->face_detection_config = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoSegment.php b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoSegment.php new file mode 100644 index 000000000000..c5e2afc5d21e --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/proto/src/Google/Cloud/VideoIntelligence/V1beta2/VideoSegment.php @@ -0,0 +1,129 @@ +google.cloud.videointelligence.v1beta2.VideoSegment + */ +class VideoSegment extends \Google\Protobuf\Internal\Message +{ + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the start of the segment (inclusive). + * + * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; + */ + protected $start_time_offset = null; + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the end of the segment (inclusive). + * + * Generated from protobuf field .google.protobuf.Duration end_time_offset = 2; + */ + protected $end_time_offset = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $start_time_offset + * Time-offset, relative to the beginning of the video, + * corresponding to the start of the segment (inclusive). + * @type \Google\Protobuf\Duration $end_time_offset + * Time-offset, relative to the beginning of the video, + * corresponding to the end of the segment (inclusive). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Videointelligence\V1Beta2\VideoIntelligence::initOnce(); + parent::__construct($data); + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the start of the segment (inclusive). + * + * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; + * @return \Google\Protobuf\Duration|null + */ + public function getStartTimeOffset() + { + return $this->start_time_offset; + } + + public function hasStartTimeOffset() + { + return isset($this->start_time_offset); + } + + public function clearStartTimeOffset() + { + unset($this->start_time_offset); + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the start of the segment (inclusive). + * + * Generated from protobuf field .google.protobuf.Duration start_time_offset = 1; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setStartTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->start_time_offset = $var; + + return $this; + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the end of the segment (inclusive). + * + * Generated from protobuf field .google.protobuf.Duration end_time_offset = 2; + * @return \Google\Protobuf\Duration|null + */ + public function getEndTimeOffset() + { + return $this->end_time_offset; + } + + public function hasEndTimeOffset() + { + return isset($this->end_time_offset); + } + + public function clearEndTimeOffset() + { + unset($this->end_time_offset); + } + + /** + * Time-offset, relative to the beginning of the video, + * corresponding to the end of the segment (inclusive). + * + * Generated from protobuf field .google.protobuf.Duration end_time_offset = 2; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEndTimeOffset($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->end_time_offset = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/samples/V1beta2/VideoIntelligenceServiceClient/annotate_video.php b/owl-bot-staging/VideoIntelligence/v1beta2/samples/V1beta2/VideoIntelligenceServiceClient/annotate_video.php new file mode 100644 index 000000000000..4a0f55e4118f --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/samples/V1beta2/VideoIntelligenceServiceClient/annotate_video.php @@ -0,0 +1,84 @@ +annotateVideo($features); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var AnnotateVideoResponse $result */ + $result = $response->getResult(); + printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); + } else { + /** @var Status $error */ + $error = $response->getError(); + printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); + } + } catch (ApiException $ex) { + printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); + } +} + +/** + * Helper to execute the sample. + * + * This sample has been automatically generated and should be regarded as a code + * template only. It will require modifications to work: + * - It may require correct/in-range values for request initialization. + * - It may require specifying regional endpoints when creating the service client, + * please see the apiEndpoint client configuration option for more details. + */ +function callSample(): void +{ + $featuresElement = Feature::FEATURE_UNSPECIFIED; + + annotate_video_sample($featuresElement); +} +// [END videointelligence_v1beta2_generated_VideoIntelligenceService_AnnotateVideo_sync] diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/Gapic/VideoIntelligenceServiceGapicClient.php b/owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/Gapic/VideoIntelligenceServiceGapicClient.php new file mode 100644 index 000000000000..fd333eeb6b7b --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/Gapic/VideoIntelligenceServiceGapicClient.php @@ -0,0 +1,350 @@ +annotateVideo($features); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $videoIntelligenceServiceClient->annotateVideo($features); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $videoIntelligenceServiceClient->resumeOperation($operationName, 'annotateVideo'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $videoIntelligenceServiceClient->close(); + * } + * ``` + * + * @experimental + * + * @deprecated This class will be removed in the next major version update. + */ +class VideoIntelligenceServiceGapicClient +{ + use GapicClientTrait; + + /** The name of the service. */ + const SERVICE_NAME = 'google.cloud.videointelligence.v1beta2.VideoIntelligenceService'; + + /** + * The default address of the service. + * + * @deprecated SERVICE_ADDRESS_TEMPLATE should be used instead. + */ + const SERVICE_ADDRESS = 'videointelligence.googleapis.com'; + + /** The address template of the service. */ + private const SERVICE_ADDRESS_TEMPLATE = 'videointelligence.UNIVERSE_DOMAIN'; + + /** The default port of the service. */ + const DEFAULT_SERVICE_PORT = 443; + + /** The name of the code generator, to be included in the agent header. */ + const CODEGEN_NAME = 'gapic'; + + /** The default scopes required by the service. */ + public static $serviceScopes = [ + 'https://www.googleapis.com/auth/cloud-platform', + ]; + + private $operationsClient; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT, + 'clientConfig' => __DIR__ . '/../resources/video_intelligence_service_client_config.json', + 'descriptorsConfigPath' => __DIR__ . '/../resources/video_intelligence_service_descriptor_config.php', + 'gcpApiConfigPath' => __DIR__ . '/../resources/video_intelligence_service_grpc_config.json', + 'credentialsConfig' => [ + 'defaultScopes' => self::$serviceScopes, + ], + 'transportConfig' => [ + 'rest' => [ + 'restClientConfigPath' => __DIR__ . '/../resources/video_intelligence_service_rest_client_config.php', + ], + ], + ]; + } + + /** + * Return an OperationsClient object with the same endpoint as $this. + * + * @return OperationsClient + * + * @experimental + */ + public function getOperationsClient() + { + return $this->operationsClient; + } + + /** + * Resume an existing long running operation that was previously started by a long + * running API method. If $methodName is not provided, or does not match a long + * running API method, then the operation can still be resumed, but the + * OperationResponse object will not deserialize the final response. + * + * @param string $operationName The name of the long running operation + * @param string $methodName The name of the method used to start the operation + * + * @return OperationResponse + * + * @experimental + */ + public function resumeOperation($operationName, $methodName = null) + { + $options = isset($this->descriptors[$methodName]['longRunning']) ? $this->descriptors[$methodName]['longRunning'] : []; + $operation = new OperationResponse($operationName, $this->getOperationsClient(), $options); + $operation->reload(); + return $operation; + } + + /** + * Constructor. + * + * @param array $options { + * Optional. Options for configuring the service API wrapper. + * + * @type string $apiEndpoint + * The address of the API remote host. May optionally include the port, formatted + * as ":". Default 'videointelligence.googleapis.com:443'. + * @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials + * The credentials to be used by the client to authorize API calls. This option + * accepts either a path to a credentials file, or a decoded credentials file as a + * PHP array. + * *Advanced usage*: In addition, this option can also accept a pre-constructed + * {@see \Google\Auth\FetchAuthTokenInterface} object or + * {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these + * objects are provided, any settings in $credentialsConfig will be ignored. + * @type array $credentialsConfig + * Options used to configure credentials, including auth token caching, for the + * client. For a full list of supporting configuration options, see + * {@see \Google\ApiCore\CredentialsWrapper::build()} . + * @type bool $disableRetries + * Determines whether or not retries defined by the client configuration should be + * disabled. Defaults to `false`. + * @type string|array $clientConfig + * Client method configuration, including retry settings. This option can be either + * a path to a JSON file, or a PHP array containing the decoded JSON data. By + * default this settings points to the default client config file, which is + * provided in the resources folder. + * @type string|TransportInterface $transport + * The transport used for executing network requests. May be either the string + * `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. + * *Advanced usage*: Additionally, it is possible to pass in an already + * instantiated {@see \Google\ApiCore\Transport\TransportInterface} object. Note + * that when this object is provided, any settings in $transportConfig, and any + * $apiEndpoint setting, will be ignored. + * @type array $transportConfig + * Configuration options that will be used to construct the transport. Options for + * each supported transport type should be passed in a key for that transport. For + * example: + * $transportConfig = [ + * 'grpc' => [...], + * 'rest' => [...], + * ]; + * See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and + * {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the + * supported options. + * @type callable $clientCertSource + * A callable which returns the client cert as a string. This can be used to + * provide a certificate and private key to the transport layer for mTLS. + * } + * + * @throws ValidationException + * + * @experimental + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + $this->operationsClient = $this->createOperationsClient($clientOptions); + } + + /** + * Performs asynchronous video annotation. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `AnnotateVideoProgress` (progress). + * `Operation.response` contains `AnnotateVideoResponse` (results). + * + * Sample code: + * ``` + * $videoIntelligenceServiceClient = new VideoIntelligenceServiceClient(); + * try { + * $features = []; + * $operationResponse = $videoIntelligenceServiceClient->annotateVideo($features); + * $operationResponse->pollUntilComplete(); + * if ($operationResponse->operationSucceeded()) { + * $result = $operationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $operationResponse->getError(); + * // handleError($error) + * } + * // Alternatively: + * // start the operation, keep the operation name, and resume later + * $operationResponse = $videoIntelligenceServiceClient->annotateVideo($features); + * $operationName = $operationResponse->getName(); + * // ... do other work + * $newOperationResponse = $videoIntelligenceServiceClient->resumeOperation($operationName, 'annotateVideo'); + * while (!$newOperationResponse->isDone()) { + * // ... do other work + * $newOperationResponse->reload(); + * } + * if ($newOperationResponse->operationSucceeded()) { + * $result = $newOperationResponse->getResult(); + * // doSomethingWith($result) + * } else { + * $error = $newOperationResponse->getError(); + * // handleError($error) + * } + * } finally { + * $videoIntelligenceServiceClient->close(); + * } + * ``` + * + * @param int[] $features Required. Requested video annotation features. + * For allowed values, use constants defined on {@see \Google\Cloud\VideoIntelligence\V1beta2\Feature} + * @param array $optionalArgs { + * Optional. + * + * @type string $inputUri + * Input video location. Currently, only + * [Google Cloud Storage](https://cloud.google.com/storage/) URIs are + * supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). A video URI + * may include wildcards in `object-id`, and thus identify multiple videos. + * Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be embedded + * in the request as `input_content`. If set, `input_content` should be unset. + * @type string $inputContent + * The video data bytes. + * If unset, the input video(s) should be specified via `input_uri`. + * If set, `input_uri` should be unset. + * @type VideoContext $videoContext + * Additional video context and/or feature-specific parameters. + * @type string $outputUri + * Optional. Location where the output (in JSON format) should be stored. + * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For + * more information, see [Request + * URIs](https://cloud.google.com/storage/docs/request-endpoints). + * @type string $locationId + * Optional. Cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region + * is specified, a region will be determined based on video file location. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\OperationResponse + * + * @throws ApiException if the remote call fails + * + * @experimental + */ + public function annotateVideo($features, array $optionalArgs = []) + { + $request = new AnnotateVideoRequest(); + $request->setFeatures($features); + if (isset($optionalArgs['inputUri'])) { + $request->setInputUri($optionalArgs['inputUri']); + } + + if (isset($optionalArgs['inputContent'])) { + $request->setInputContent($optionalArgs['inputContent']); + } + + if (isset($optionalArgs['videoContext'])) { + $request->setVideoContext($optionalArgs['videoContext']); + } + + if (isset($optionalArgs['outputUri'])) { + $request->setOutputUri($optionalArgs['outputUri']); + } + + if (isset($optionalArgs['locationId'])) { + $request->setLocationId($optionalArgs['locationId']); + } + + return $this->startOperationsCall('AnnotateVideo', $optionalArgs, $request, $this->getOperationsClient())->wait(); + } +} diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/VideoIntelligenceServiceClient.php b/owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/VideoIntelligenceServiceClient.php new file mode 100644 index 000000000000..3fe45cc8648b --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/VideoIntelligenceServiceClient.php @@ -0,0 +1,36 @@ + [ + 'google.cloud.videointelligence.v1beta2.VideoIntelligenceService' => [ + 'AnnotateVideo' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\VideoIntelligence\V1beta2\AnnotateVideoResponse', + 'metadataReturnType' => '\Google\Cloud\VideoIntelligence\V1beta2\AnnotateVideoProgress', + 'initialPollDelayMillis' => '20000', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '45000', + 'totalPollTimeoutMillis' => '86400000', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/resources/video_intelligence_service_rest_client_config.php b/owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/resources/video_intelligence_service_rest_client_config.php new file mode 100644 index 000000000000..eac8305109fa --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/src/V1beta2/resources/video_intelligence_service_rest_client_config.php @@ -0,0 +1,100 @@ + [ + 'google.cloud.videointelligence.v1beta2.VideoIntelligenceService' => [ + 'AnnotateVideo' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta2/videos:annotate', + 'body' => '*', + ], + ], + 'google.longrunning.Operations' => [ + 'ListOperations' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*}/operations', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetOperation' => [ + 'method' => 'get', + 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1beta2/operations/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'DeleteOperation' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/operations/*}', + 'additionalBindings' => [ + [ + 'method' => 'delete', + 'uriTemplate' => '/v1beta2/operations/{name=projects/*/locations/*/operations/*}', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CancelOperation' => [ + 'method' => 'post', + 'uriTemplate' => '/v1beta2/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1beta2/operations/{name=projects/*/locations/*/operations/*}:cancel', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + ], + ], + 'numericEnums' => true, +]; diff --git a/owl-bot-staging/VideoIntelligence/v1beta2/tests/Unit/V1beta2/VideoIntelligenceServiceClientTest.php b/owl-bot-staging/VideoIntelligence/v1beta2/tests/Unit/V1beta2/VideoIntelligenceServiceClientTest.php new file mode 100644 index 000000000000..1551f5a1c3e3 --- /dev/null +++ b/owl-bot-staging/VideoIntelligence/v1beta2/tests/Unit/V1beta2/VideoIntelligenceServiceClientTest.php @@ -0,0 +1,182 @@ +getMockBuilder(CredentialsWrapper::class)->disableOriginalConstructor()->getMock(); + } + + /** @return VideoIntelligenceServiceClient */ + private function createClient(array $options = []) + { + $options += [ + 'credentials' => $this->createCredentials(), + ]; + return new VideoIntelligenceServiceClient($options); + } + + /** @test */ + public function annotateVideoTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/annotateVideoTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new AnnotateVideoResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/annotateVideoTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $features = []; + $response = $gapicClient->annotateVideo($features); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.videointelligence.v1beta2.VideoIntelligenceService/AnnotateVideo', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getFeatures(); + $this->assertProtobufEquals($features, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/annotateVideoTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function annotateVideoExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/annotateVideoTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $operationsTransport->addResponse(null, $status); + // Mock request + $features = []; + $response = $gapicClient->annotateVideo($features); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/annotateVideoTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } +}